Skip to content

Rollup of 8 pull requests #119603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5c0e62c
Hide foreign `#[doc(hidden)]` paths in import suggestions
Jules-Bertholet Dec 20, 2023
90d6fe2
Imply outlives-bounds on lazy type aliases
fmease Dec 27, 2023
3ab43e5
Allow emitting diagnostics from the `#[diagnostic]` namespace without a
weiznich Dec 21, 2023
cd9425b
Replace some usage of `#[rustc_on_unimplemented]` with
weiznich Dec 22, 2023
eabf4df
Add a test that emitting diagnostics does not require the crate to use
weiznich Dec 23, 2023
cc31adc
Fix a rustdoc test
weiznich Dec 29, 2023
fdd991f
Add support for shell argfiles
djkoloski Dec 6, 2023
505c137
Rename some `Diagnostic` setters.
nnethercote Dec 23, 2023
5fe5d5d
Remove lots of `rustc_errors::` qualifiers in `lints.rs`.
nnethercote Jan 2, 2024
096b844
Remove forward for `downgrade_to_delayed_bug`.
nnethercote Jan 3, 2024
caefa55
Fix up `forward!` decls.
nnethercote Jan 3, 2024
b4a6239
Fix `forward!` so it doesn't require trailing commas in some cases.
nnethercote Jan 3, 2024
1e92223
Remove unused `DiagnosticBuilder::struct_almost_fatal`.
nnethercote Jan 3, 2024
9560c58
Avoid some `rustc_errors::` qualifiers.
nnethercote Jan 4, 2024
4d35981
Remove unused `struct_error` function.
nnethercote Jan 4, 2024
8e6bca6
Inline and remove `StringReader::struct_fatal_span_char`.
nnethercote Jan 4, 2024
1d48f69
Check yield terminator's resume type in borrowck
compiler-errors Jan 4, 2024
8388112
Remove `is_lint` field from `Level::Error`.
nnethercote Jan 4, 2024
4bc3552
cstore: Remove unnecessary locking from `CrateMetadata`
petrochenkov Jan 4, 2024
f603bab
rustc_mir_transform: Make DestinationPropagation stable for queries
Enselic Jan 3, 2024
9065e4b
Rollup merge of #118680 - djkoloski:shell_argfiles, r=compiler-errors
matthiaskrgr Jan 5, 2024
33d1c50
Rollup merge of #119151 - Jules-Bertholet:no-foreign-doc-hidden-sugge…
matthiaskrgr Jan 5, 2024
b4f4983
Rollup merge of #119216 - weiznich:use_diagnostic_namespace_in_stdlib…
matthiaskrgr Jan 5, 2024
2cf6067
Rollup merge of #119350 - fmease:lazy-ty-aliases-implied-bounds, r=co…
matthiaskrgr Jan 5, 2024
cf4cd93
Rollup merge of #119538 - nnethercote:cleanup-errors-5, r=compiler-er…
matthiaskrgr Jan 5, 2024
5cf7bbe
Rollup merge of #119563 - compiler-errors:coroutine-resume, r=oli-obk
matthiaskrgr Jan 5, 2024
2e1bdea
Rollup merge of #119589 - petrochenkov:cdatalock, r=Mark-Simulacrum
matthiaskrgr Jan 5, 2024
e147a1b
Rollup merge of #119591 - Enselic:DestinationPropagation-stable, r=cj…
matthiaskrgr Jan 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Replace some usage of #[rustc_on_unimplemented] with
`#[diagnostic::on_unimplemented]`

This commit replaces those `#[rustc_on_unimplemented]` attributes with
their equivalent `#[diagnostic::on_unimplemented]` where this is
supported (So no filter or any extended option)
  • Loading branch information
weiznich committed Dec 29, 2023
commit cd9425b8d1fe7c0c84e9743efc0223640ff4fe08
2 changes: 1 addition & 1 deletion library/core/src/future/future.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use crate::task::{Context, Poll};
#[must_use = "futures do nothing unless you `.await` or poll them"]
#[stable(feature = "futures_api", since = "1.36.0")]
#[lang = "future_trait"]
#[rustc_on_unimplemented(
#[diagnostic::on_unimplemented(
label = "`{Self}` is not a future",
message = "`{Self}` is not a future",
note = "{Self} must be a future or must implement `IntoFuture` to be awaited"
Expand Down
1 change: 1 addition & 0 deletions library/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@
#![feature(const_trait_impl)]
#![feature(decl_macro)]
#![feature(deprecated_suggestion)]
#![feature(diagnostic_namespace)]
#![feature(doc_cfg)]
#![feature(doc_cfg_hide)]
#![feature(doc_notable_trait)]
Expand Down
16 changes: 8 additions & 8 deletions library/core/src/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ macro marker_impls {
/// [ub]: ../../reference/behavior-considered-undefined.html
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "Send")]
#[rustc_on_unimplemented(
#[diagnostic::on_unimplemented(
message = "`{Self}` cannot be sent between threads safely",
label = "`{Self}` cannot be sent between threads safely"
)]
Expand Down Expand Up @@ -134,7 +134,7 @@ unsafe impl<T: Sync + ?Sized> Send for &T {}
#[doc(alias = "?", alias = "?Sized")]
#[stable(feature = "rust1", since = "1.0.0")]
#[lang = "sized"]
#[rustc_on_unimplemented(
#[diagnostic::on_unimplemented(
message = "the size for values of type `{Self}` cannot be known at compilation time",
label = "doesn't have a size known at compile-time"
)]
Expand Down Expand Up @@ -205,7 +205,7 @@ pub trait Unsize<T: ?Sized> {
/// [RFC1445]: https://github.com/rust-lang/rfcs/blob/master/text/1445-restrict-constants-in-patterns.md
/// [issue 63438]: https://github.com/rust-lang/rust/issues/63438
#[unstable(feature = "structural_match", issue = "31434")]
#[rustc_on_unimplemented(message = "the type `{Self}` does not `#[derive(PartialEq)]`")]
#[diagnostic::on_unimplemented(message = "the type `{Self}` does not `#[derive(PartialEq)]`")]
#[lang = "structural_peq"]
pub trait StructuralPartialEq {
// Empty.
Expand Down Expand Up @@ -273,7 +273,7 @@ marker_impls! {
/// of the two derives (`#[derive(PartialEq)]` and `#[derive(Eq)]`) and check
/// that both of them are present as part of structural-match checking.
#[unstable(feature = "structural_match", issue = "31434")]
#[rustc_on_unimplemented(message = "the type `{Self}` does not `#[derive(Eq)]`")]
#[diagnostic::on_unimplemented(message = "the type `{Self}` does not `#[derive(Eq)]`")]
#[lang = "structural_teq"]
pub trait StructuralEq {
// Empty.
Expand Down Expand Up @@ -941,7 +941,7 @@ marker_impls! {
/// [Pin]: crate::pin::Pin
/// [`pin` module]: crate::pin
#[stable(feature = "pin", since = "1.33.0")]
#[rustc_on_unimplemented(
#[diagnostic::on_unimplemented(
note = "consider using the `pin!` macro\nconsider using `Box::pin` if you need to access the pinned value outside of the current scope",
message = "`{Self}` cannot be unpinned"
)]
Expand Down Expand Up @@ -989,7 +989,7 @@ pub trait Destruct {}
/// for any user type.
#[unstable(feature = "tuple_trait", issue = "none")]
#[lang = "tuple_trait"]
#[rustc_on_unimplemented(message = "`{Self}` is not a tuple")]
#[diagnostic::on_unimplemented(message = "`{Self}` is not a tuple")]
#[rustc_deny_explicit_impl(implement_via_object = false)]
pub trait Tuple {}

Expand All @@ -999,7 +999,7 @@ pub trait Tuple {}
/// `*const ()` automatically implement this trait.
#[unstable(feature = "pointer_like_trait", issue = "none")]
#[lang = "pointer_like"]
#[rustc_on_unimplemented(
#[diagnostic::on_unimplemented(
message = "`{Self}` needs to have the same ABI as a pointer",
label = "`{Self}` needs to be a pointer-like type"
)]
Expand All @@ -1013,7 +1013,7 @@ pub trait PointerLike {}
/// are `StructuralPartialEq`.
#[lang = "const_param_ty"]
#[unstable(feature = "adt_const_params", issue = "95174")]
#[rustc_on_unimplemented(message = "`{Self}` can't be used as a const parameter type")]
#[diagnostic::on_unimplemented(message = "`{Self}` can't be used as a const parameter type")]
#[allow(multiple_supertrait_upcastable)]
pub trait ConstParamTy: StructuralEq + StructuralPartialEq + Eq {}

Expand Down
16 changes: 8 additions & 8 deletions library/core/src/ops/arith.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ sub_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
/// ```
#[lang = "mul"]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_on_unimplemented(
#[diagnostic::on_unimplemented(
message = "cannot multiply `{Self}` by `{Rhs}`",
label = "no implementation for `{Self} * {Rhs}`"
)]
Expand Down Expand Up @@ -441,7 +441,7 @@ mul_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
/// ```
#[lang = "div"]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_on_unimplemented(
#[diagnostic::on_unimplemented(
message = "cannot divide `{Self}` by `{Rhs}`",
label = "no implementation for `{Self} / {Rhs}`"
)]
Expand Down Expand Up @@ -543,7 +543,7 @@ div_impl_float! { f32 f64 }
/// ```
#[lang = "rem"]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_on_unimplemented(
#[diagnostic::on_unimplemented(
message = "cannot calculate the remainder of `{Self}` divided by `{Rhs}`",
label = "no implementation for `{Self} % {Rhs}`"
)]
Expand Down Expand Up @@ -729,7 +729,7 @@ neg_impl! { isize i8 i16 i32 i64 i128 f32 f64 }
/// ```
#[lang = "add_assign"]
#[stable(feature = "op_assign_traits", since = "1.8.0")]
#[rustc_on_unimplemented(
#[diagnostic::on_unimplemented(
message = "cannot add-assign `{Rhs}` to `{Self}`",
label = "no implementation for `{Self} += {Rhs}`"
)]
Expand Down Expand Up @@ -796,7 +796,7 @@ add_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
/// ```
#[lang = "sub_assign"]
#[stable(feature = "op_assign_traits", since = "1.8.0")]
#[rustc_on_unimplemented(
#[diagnostic::on_unimplemented(
message = "cannot subtract-assign `{Rhs}` from `{Self}`",
label = "no implementation for `{Self} -= {Rhs}`"
)]
Expand Down Expand Up @@ -854,7 +854,7 @@ sub_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
/// ```
#[lang = "mul_assign"]
#[stable(feature = "op_assign_traits", since = "1.8.0")]
#[rustc_on_unimplemented(
#[diagnostic::on_unimplemented(
message = "cannot multiply-assign `{Self}` by `{Rhs}`",
label = "no implementation for `{Self} *= {Rhs}`"
)]
Expand Down Expand Up @@ -912,7 +912,7 @@ mul_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
/// ```
#[lang = "div_assign"]
#[stable(feature = "op_assign_traits", since = "1.8.0")]
#[rustc_on_unimplemented(
#[diagnostic::on_unimplemented(
message = "cannot divide-assign `{Self}` by `{Rhs}`",
label = "no implementation for `{Self} /= {Rhs}`"
)]
Expand Down Expand Up @@ -973,7 +973,7 @@ div_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
/// ```
#[lang = "rem_assign"]
#[stable(feature = "op_assign_traits", since = "1.8.0")]
#[rustc_on_unimplemented(
#[diagnostic::on_unimplemented(
message = "cannot calculate and assign the remainder of `{Self}` divided by `{Rhs}`",
label = "no implementation for `{Self} %= {Rhs}`"
)]
Expand Down
20 changes: 10 additions & 10 deletions library/core/src/ops/bit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ impl Not for ! {
#[lang = "bitand"]
#[doc(alias = "&")]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_on_unimplemented(
#[diagnostic::on_unimplemented(
message = "no implementation for `{Self} & {Rhs}`",
label = "no implementation for `{Self} & {Rhs}`"
)]
Expand Down Expand Up @@ -237,7 +237,7 @@ bitand_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
#[lang = "bitor"]
#[doc(alias = "|")]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_on_unimplemented(
#[diagnostic::on_unimplemented(
message = "no implementation for `{Self} | {Rhs}`",
label = "no implementation for `{Self} | {Rhs}`"
)]
Expand Down Expand Up @@ -337,7 +337,7 @@ bitor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
#[lang = "bitxor"]
#[doc(alias = "^")]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_on_unimplemented(
#[diagnostic::on_unimplemented(
message = "no implementation for `{Self} ^ {Rhs}`",
label = "no implementation for `{Self} ^ {Rhs}`"
)]
Expand Down Expand Up @@ -436,7 +436,7 @@ bitxor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
#[lang = "shl"]
#[doc(alias = "<<")]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_on_unimplemented(
#[diagnostic::on_unimplemented(
message = "no implementation for `{Self} << {Rhs}`",
label = "no implementation for `{Self} << {Rhs}`"
)]
Expand Down Expand Up @@ -554,7 +554,7 @@ shl_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 isize i128 }
#[lang = "shr"]
#[doc(alias = ">>")]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_on_unimplemented(
#[diagnostic::on_unimplemented(
message = "no implementation for `{Self} >> {Rhs}`",
label = "no implementation for `{Self} >> {Rhs}`"
)]
Expand Down Expand Up @@ -681,7 +681,7 @@ shr_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }
#[lang = "bitand_assign"]
#[doc(alias = "&=")]
#[stable(feature = "op_assign_traits", since = "1.8.0")]
#[rustc_on_unimplemented(
#[diagnostic::on_unimplemented(
message = "no implementation for `{Self} &= {Rhs}`",
label = "no implementation for `{Self} &= {Rhs}`"
)]
Expand Down Expand Up @@ -752,7 +752,7 @@ bitand_assign_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
#[lang = "bitor_assign"]
#[doc(alias = "|=")]
#[stable(feature = "op_assign_traits", since = "1.8.0")]
#[rustc_on_unimplemented(
#[diagnostic::on_unimplemented(
message = "no implementation for `{Self} |= {Rhs}`",
label = "no implementation for `{Self} |= {Rhs}`"
)]
Expand Down Expand Up @@ -823,7 +823,7 @@ bitor_assign_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
#[lang = "bitxor_assign"]
#[doc(alias = "^=")]
#[stable(feature = "op_assign_traits", since = "1.8.0")]
#[rustc_on_unimplemented(
#[diagnostic::on_unimplemented(
message = "no implementation for `{Self} ^= {Rhs}`",
label = "no implementation for `{Self} ^= {Rhs}`"
)]
Expand Down Expand Up @@ -892,7 +892,7 @@ bitxor_assign_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
#[lang = "shl_assign"]
#[doc(alias = "<<=")]
#[stable(feature = "op_assign_traits", since = "1.8.0")]
#[rustc_on_unimplemented(
#[diagnostic::on_unimplemented(
message = "no implementation for `{Self} <<= {Rhs}`",
label = "no implementation for `{Self} <<= {Rhs}`"
)]
Expand Down Expand Up @@ -974,7 +974,7 @@ shl_assign_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }
#[lang = "shr_assign"]
#[doc(alias = ">>=")]
#[stable(feature = "op_assign_traits", since = "1.8.0")]
#[rustc_on_unimplemented(
#[diagnostic::on_unimplemented(
message = "no implementation for `{Self} >>= {Rhs}`",
label = "no implementation for `{Self} >>= {Rhs}`"
)]
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/ops/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
/// assert_eq!(nucleotide_count[Nucleotide::T], 12);
/// ```
#[lang = "index"]
#[rustc_on_unimplemented(
#[diagnostic::on_unimplemented(
message = "the type `{Self}` cannot be indexed by `{Idx}`",
label = "`{Self}` cannot be indexed by `{Idx}`"
)]
Expand Down
4 changes: 2 additions & 2 deletions library/core/src/panic/unwind_safe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ use crate::task::{Context, Poll};
/// implemented for any closed over variables passed to `catch_unwind`.
#[stable(feature = "catch_unwind", since = "1.9.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "unwind_safe_trait")]
#[rustc_on_unimplemented(
#[diagnostic::on_unimplemented(
message = "the type `{Self}` may not be safely transferred across an unwind boundary",
label = "`{Self}` may not be safely transferred across an unwind boundary"
)]
Expand All @@ -99,7 +99,7 @@ pub auto trait UnwindSafe {}
/// [`UnwindSafe`] trait, for more information see that documentation.
#[stable(feature = "catch_unwind", since = "1.9.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "ref_unwind_safe_trait")]
#[rustc_on_unimplemented(
#[diagnostic::on_unimplemented(
message = "the type `{Self}` may contain interior mutability and a reference may not be safely \
transferrable across a catch_unwind boundary",
label = "`{Self}` may contain interior mutability and a reference may not be safely \
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/proc-macro/meta-macro-hygiene.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ crate0::{{expn1}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt:
crate0::{{expn2}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Bang, "produce_it")
crate0::{{expn3}}: parent: crate0::{{expn2}}, call_site_ctxt: #3, def_site_ctxt: #0, kind: Macro(Bang, "meta_macro::print_def_site")
crate0::{{expn4}}: parent: crate0::{{expn3}}, call_site_ctxt: #4, def_site_ctxt: #0, kind: Macro(Bang, "$crate::dummy")
crate1::{{expnNNN}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Attr, "diagnostic::on_unimplemented")
crate1::{{expnNNN}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Attr, "diagnostic::on_unimplemented")
crate1::{{expnNNN}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Attr, "diagnostic::on_unimplemented")
crate1::{{expnNNN}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Attr, "derive")
crate1::{{expnNNN}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Attr, "derive")
crate1::{{expnNNN}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Bang, "include")
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/proc-macro/nonterminal-token-hygiene.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ crate0::{{expn1}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt:
crate0::{{expn2}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Bang, "outer")
crate0::{{expn3}}: parent: crate0::{{expn2}}, call_site_ctxt: #3, def_site_ctxt: #3, kind: Macro(Bang, "inner")
crate0::{{expn4}}: parent: crate0::{{expn3}}, call_site_ctxt: #5, def_site_ctxt: #0, kind: Macro(Bang, "print_bang")
crate1::{{expnNNN}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Attr, "diagnostic::on_unimplemented")
crate1::{{expnNNN}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Attr, "diagnostic::on_unimplemented")
crate1::{{expnNNN}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Attr, "diagnostic::on_unimplemented")
crate1::{{expnNNN}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Attr, "derive")
crate1::{{expnNNN}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Attr, "derive")
crate1::{{expnNNN}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Bang, "include")
Expand Down