Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5433b9d

Browse files
committedJan 16, 2024
Stabilize the #[diagnostic] namespace and #[diagnostic::on_unimplemented] attribute
This PR stabilizes the `#[diagnostic]` attribute namespace and a minimal option of the `#[diagnostic::on_unimplemented]` attribute. The `#[diagnostic]` attribute namespace is meant to provide a home for attribute that allow users to influence error messages emitted by the compiler. The compiler is not guaranteed to use any of this hints, however it should accept any (non-)existing attribute in this namespace and potentially emit lint-warnings for unused attributes and options. This is meant to allow discarding certain attributes/options in the future to allow fundamental changes to the compiler without the need to keep then non-meaningful options working. The `#[diagnostic::on_unimplemented]` attribute is allowed to appear on a trait definition. This allows crate authors to hint the compiler to emit a specific error message if a certain trait is not implemented. For the `#[diagnostic::on_unimplemented]` attribute the following options are implemented: * `message` which provides the text for the top level error message * `label` which provides the text for the label shown inline in the broken code in the error message * `note` which provides additional notes. The `note` option can appear several times, which results in several note messages being emitted. If any of the other options appears several times the first occurrence of the relevant option specifies the actually used value. Any other occurrence generates an lint warning. For any other non-existing option a lint-warning is generated. All three options accept a text as argument. This text is allowed to contain format parameters referring to generic argument or `Self` by name via the `{Self}` or `{NameOfGenericArgument}` syntax. For any non-existing argument a lint warning is generated. Tracking issue: rust-lang#111996
1 parent bf2637f commit 5433b9d

33 files changed

+262
-356
lines changed
 

‎compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
200200
);
201201
}
202202
}
203-
if !attr.is_doc_comment()
204-
&& let [seg, _] = attr.get_normal_item().path.segments.as_slice()
205-
&& seg.ident.name == sym::diagnostic
206-
&& !self.features.diagnostic_namespace
207-
{
208-
let msg = "`#[diagnostic]` attribute name space is experimental";
209-
gate!(self, diagnostic_namespace, seg.ident.span, msg);
210-
}
211203

212204
// Emit errors for non-staged-api crates.
213205
if !self.features.staged_api {

‎compiler/rustc_feature/src/accepted.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ declare_features! (
144144
(accepted, derive_default_enum, "1.62.0", Some(86985)),
145145
/// Allows the use of destructuring assignments.
146146
(accepted, destructuring_assignment, "1.59.0", Some(71126)),
147+
/// Allows using the `#[diagnostic]` attribute tool namespace
148+
(accepted, diagnostic_namespace, "CURRENT_RUSTC_VERSION", Some(111996)),
147149
/// Allows `#[doc(alias = "...")]`.
148150
(accepted, doc_alias, "1.48.0", Some(50146)),
149151
/// Allows `..` in tuple (struct) patterns.

‎compiler/rustc_feature/src/unstable.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,6 @@ declare_features! (
436436
(unstable, deprecated_safe, "1.61.0", Some(94978)),
437437
/// Allows having using `suggestion` in the `#[deprecated]` attribute.
438438
(unstable, deprecated_suggestion, "1.61.0", Some(94785)),
439-
/// Allows using the `#[diagnostic]` attribute tool namespace
440-
(unstable, diagnostic_namespace, "1.73.0", Some(111996)),
441439
/// Controls errors in trait implementations.
442440
(unstable, do_not_recommend, "1.67.0", Some(51992)),
443441
/// Tells rustdoc to automatically generate `#[doc(cfg(...))]`.

‎library/core/src/future/future.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,13 @@ use crate::task::{Context, Poll};
2828
#[must_use = "futures do nothing unless you `.await` or poll them"]
2929
#[stable(feature = "futures_api", since = "1.36.0")]
3030
#[lang = "future_trait"]
31-
#[diagnostic::on_unimplemented(
32-
label = "`{Self}` is not a future",
33-
message = "`{Self}` is not a future",
34-
note = "{Self} must be a future or must implement `IntoFuture` to be awaited"
31+
#[cfg_attr(
32+
not(bootstrap),
33+
diagnostic::on_unimplemented(
34+
label = "`{Self}` is not a future",
35+
message = "`{Self}` is not a future",
36+
note = "{Self} must be a future or must implement `IntoFuture` to be awaited"
37+
)
3538
)]
3639
pub trait Future {
3740
/// The type of value produced on completion.

‎library/core/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@
217217
#![feature(const_trait_impl)]
218218
#![feature(decl_macro)]
219219
#![feature(deprecated_suggestion)]
220-
#![feature(diagnostic_namespace)]
221220
#![feature(doc_cfg)]
222221
#![feature(doc_cfg_hide)]
223222
#![feature(doc_notable_trait)]

‎library/core/src/marker.rs

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,12 @@ macro marker_impls {
7575
/// [ub]: ../../reference/behavior-considered-undefined.html
7676
#[stable(feature = "rust1", since = "1.0.0")]
7777
#[cfg_attr(not(test), rustc_diagnostic_item = "Send")]
78-
#[diagnostic::on_unimplemented(
79-
message = "`{Self}` cannot be sent between threads safely",
80-
label = "`{Self}` cannot be sent between threads safely"
78+
#[cfg_attr(
79+
not(bootstrap),
80+
diagnostic::on_unimplemented(
81+
message = "`{Self}` cannot be sent between threads safely",
82+
label = "`{Self}` cannot be sent between threads safely"
83+
)
8184
)]
8285
pub unsafe auto trait Send {
8386
// empty.
@@ -134,9 +137,12 @@ unsafe impl<T: Sync + ?Sized> Send for &T {}
134137
#[doc(alias = "?", alias = "?Sized")]
135138
#[stable(feature = "rust1", since = "1.0.0")]
136139
#[lang = "sized"]
137-
#[diagnostic::on_unimplemented(
138-
message = "the size for values of type `{Self}` cannot be known at compilation time",
139-
label = "doesn't have a size known at compile-time"
140+
#[cfg_attr(
141+
not(bootstrap),
142+
diagnostic::on_unimplemented(
143+
message = "the size for values of type `{Self}` cannot be known at compilation time",
144+
label = "doesn't have a size known at compile-time"
145+
)
140146
)]
141147
#[fundamental] // for Default, for example, which requires that `[T]: !Default` be evaluatable
142148
#[rustc_specialization_trait]
@@ -205,7 +211,10 @@ pub trait Unsize<T: ?Sized> {
205211
/// [RFC1445]: https://github.com/rust-lang/rfcs/blob/master/text/1445-restrict-constants-in-patterns.md
206212
/// [issue 63438]: https://github.com/rust-lang/rust/issues/63438
207213
#[unstable(feature = "structural_match", issue = "31434")]
208-
#[diagnostic::on_unimplemented(message = "the type `{Self}` does not `#[derive(PartialEq)]`")]
214+
#[cfg_attr(
215+
not(bootstrap),
216+
diagnostic::on_unimplemented(message = "the type `{Self}` does not `#[derive(PartialEq)]`")
217+
)]
209218
#[lang = "structural_peq"]
210219
pub trait StructuralPartialEq {
211220
// Empty.
@@ -273,7 +282,10 @@ marker_impls! {
273282
/// of the two derives (`#[derive(PartialEq)]` and `#[derive(Eq)]`) and check
274283
/// that both of them are present as part of structural-match checking.
275284
#[unstable(feature = "structural_match", issue = "31434")]
276-
#[diagnostic::on_unimplemented(message = "the type `{Self}` does not `#[derive(Eq)]`")]
285+
#[cfg_attr(
286+
not(bootstrap),
287+
diagnostic::on_unimplemented(message = "the type `{Self}` does not `#[derive(Eq)]`")
288+
)]
277289
#[lang = "structural_teq"]
278290
pub trait StructuralEq {
279291
// Empty.
@@ -964,9 +976,12 @@ marker_impls! {
964976
/// [section about `Unpin`]: crate::pin#unpin "pin module docs about unpin"
965977
/// [`unsafe`]: ../../std/keyword.unsafe.html "keyword unsafe"
966978
#[stable(feature = "pin", since = "1.33.0")]
967-
#[diagnostic::on_unimplemented(
968-
note = "consider using the `pin!` macro\nconsider using `Box::pin` if you need to access the pinned value outside of the current scope",
969-
message = "`{Self}` cannot be unpinned"
979+
#[cfg_attr(
980+
not(bootstrap),
981+
diagnostic::on_unimplemented(
982+
note = "consider using the `pin!` macro\nconsider using `Box::pin` if you need to access the pinned value outside of the current scope",
983+
message = "`{Self}` cannot be unpinned"
984+
)
970985
)]
971986
#[lang = "unpin"]
972987
pub auto trait Unpin {}
@@ -1012,7 +1027,7 @@ pub trait Destruct {}
10121027
/// for any user type.
10131028
#[unstable(feature = "tuple_trait", issue = "none")]
10141029
#[lang = "tuple_trait"]
1015-
#[diagnostic::on_unimplemented(message = "`{Self}` is not a tuple")]
1030+
#[cfg_attr(not(bootstrap), diagnostic::on_unimplemented(message = "`{Self}` is not a tuple"))]
10161031
#[rustc_deny_explicit_impl(implement_via_object = false)]
10171032
pub trait Tuple {}
10181033

@@ -1022,9 +1037,12 @@ pub trait Tuple {}
10221037
/// `*const ()` automatically implement this trait.
10231038
#[unstable(feature = "pointer_like_trait", issue = "none")]
10241039
#[lang = "pointer_like"]
1025-
#[diagnostic::on_unimplemented(
1026-
message = "`{Self}` needs to have the same ABI as a pointer",
1027-
label = "`{Self}` needs to be a pointer-like type"
1040+
#[cfg_attr(
1041+
not(bootstrap),
1042+
diagnostic::on_unimplemented(
1043+
message = "`{Self}` needs to have the same ABI as a pointer",
1044+
label = "`{Self}` needs to be a pointer-like type"
1045+
)
10281046
)]
10291047
pub trait PointerLike {}
10301048

@@ -1036,7 +1054,10 @@ pub trait PointerLike {}
10361054
/// are `StructuralPartialEq`.
10371055
#[lang = "const_param_ty"]
10381056
#[unstable(feature = "adt_const_params", issue = "95174")]
1039-
#[diagnostic::on_unimplemented(message = "`{Self}` can't be used as a const parameter type")]
1057+
#[cfg_attr(
1058+
not(bootstrap),
1059+
diagnostic::on_unimplemented(message = "`{Self}` can't be used as a const parameter type")
1060+
)]
10401061
#[allow(multiple_supertrait_upcastable)]
10411062
pub trait ConstParamTy: StructuralEq + StructuralPartialEq + Eq {}
10421063

‎library/core/src/ops/arith.rs

Lines changed: 48 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,12 @@ sub_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
307307
/// ```
308308
#[lang = "mul"]
309309
#[stable(feature = "rust1", since = "1.0.0")]
310-
#[diagnostic::on_unimplemented(
311-
message = "cannot multiply `{Self}` by `{Rhs}`",
312-
label = "no implementation for `{Self} * {Rhs}`"
310+
#[cfg_attr(
311+
not(bootstrap),
312+
diagnostic::on_unimplemented(
313+
message = "cannot multiply `{Self}` by `{Rhs}`",
314+
label = "no implementation for `{Self} * {Rhs}`"
315+
)
313316
)]
314317
#[doc(alias = "*")]
315318
pub trait Mul<Rhs = Self> {
@@ -441,9 +444,12 @@ mul_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
441444
/// ```
442445
#[lang = "div"]
443446
#[stable(feature = "rust1", since = "1.0.0")]
444-
#[diagnostic::on_unimplemented(
445-
message = "cannot divide `{Self}` by `{Rhs}`",
446-
label = "no implementation for `{Self} / {Rhs}`"
447+
#[cfg_attr(
448+
not(bootstrap),
449+
diagnostic::on_unimplemented(
450+
message = "cannot divide `{Self}` by `{Rhs}`",
451+
label = "no implementation for `{Self} / {Rhs}`"
452+
)
447453
)]
448454
#[doc(alias = "/")]
449455
pub trait Div<Rhs = Self> {
@@ -543,9 +549,12 @@ div_impl_float! { f32 f64 }
543549
/// ```
544550
#[lang = "rem"]
545551
#[stable(feature = "rust1", since = "1.0.0")]
546-
#[diagnostic::on_unimplemented(
547-
message = "cannot calculate the remainder of `{Self}` divided by `{Rhs}`",
548-
label = "no implementation for `{Self} % {Rhs}`"
552+
#[cfg_attr(
553+
not(bootstrap),
554+
diagnostic::on_unimplemented(
555+
message = "cannot calculate the remainder of `{Self}` divided by `{Rhs}`",
556+
label = "no implementation for `{Self} % {Rhs}`"
557+
)
549558
)]
550559
#[doc(alias = "%")]
551560
pub trait Rem<Rhs = Self> {
@@ -729,9 +738,12 @@ neg_impl! { isize i8 i16 i32 i64 i128 f32 f64 }
729738
/// ```
730739
#[lang = "add_assign"]
731740
#[stable(feature = "op_assign_traits", since = "1.8.0")]
732-
#[diagnostic::on_unimplemented(
733-
message = "cannot add-assign `{Rhs}` to `{Self}`",
734-
label = "no implementation for `{Self} += {Rhs}`"
741+
#[cfg_attr(
742+
not(bootstrap),
743+
diagnostic::on_unimplemented(
744+
message = "cannot add-assign `{Rhs}` to `{Self}`",
745+
label = "no implementation for `{Self} += {Rhs}`"
746+
)
735747
)]
736748
#[doc(alias = "+")]
737749
#[doc(alias = "+=")]
@@ -796,9 +808,12 @@ add_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
796808
/// ```
797809
#[lang = "sub_assign"]
798810
#[stable(feature = "op_assign_traits", since = "1.8.0")]
799-
#[diagnostic::on_unimplemented(
800-
message = "cannot subtract-assign `{Rhs}` from `{Self}`",
801-
label = "no implementation for `{Self} -= {Rhs}`"
811+
#[cfg_attr(
812+
not(bootstrap),
813+
diagnostic::on_unimplemented(
814+
message = "cannot subtract-assign `{Rhs}` from `{Self}`",
815+
label = "no implementation for `{Self} -= {Rhs}`"
816+
)
802817
)]
803818
#[doc(alias = "-")]
804819
#[doc(alias = "-=")]
@@ -854,9 +869,12 @@ sub_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
854869
/// ```
855870
#[lang = "mul_assign"]
856871
#[stable(feature = "op_assign_traits", since = "1.8.0")]
857-
#[diagnostic::on_unimplemented(
858-
message = "cannot multiply-assign `{Self}` by `{Rhs}`",
859-
label = "no implementation for `{Self} *= {Rhs}`"
872+
#[cfg_attr(
873+
not(bootstrap),
874+
diagnostic::on_unimplemented(
875+
message = "cannot multiply-assign `{Self}` by `{Rhs}`",
876+
label = "no implementation for `{Self} *= {Rhs}`"
877+
)
860878
)]
861879
#[doc(alias = "*")]
862880
#[doc(alias = "*=")]
@@ -912,9 +930,12 @@ mul_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
912930
/// ```
913931
#[lang = "div_assign"]
914932
#[stable(feature = "op_assign_traits", since = "1.8.0")]
915-
#[diagnostic::on_unimplemented(
916-
message = "cannot divide-assign `{Self}` by `{Rhs}`",
917-
label = "no implementation for `{Self} /= {Rhs}`"
933+
#[cfg_attr(
934+
not(bootstrap),
935+
diagnostic::on_unimplemented(
936+
message = "cannot divide-assign `{Self}` by `{Rhs}`",
937+
label = "no implementation for `{Self} /= {Rhs}`"
938+
)
918939
)]
919940
#[doc(alias = "/")]
920941
#[doc(alias = "/=")]
@@ -973,9 +994,12 @@ div_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
973994
/// ```
974995
#[lang = "rem_assign"]
975996
#[stable(feature = "op_assign_traits", since = "1.8.0")]
976-
#[diagnostic::on_unimplemented(
977-
message = "cannot calculate and assign the remainder of `{Self}` divided by `{Rhs}`",
978-
label = "no implementation for `{Self} %= {Rhs}`"
997+
#[cfg_attr(
998+
not(bootstrap),
999+
diagnostic::on_unimplemented(
1000+
message = "cannot calculate and assign the remainder of `{Self}` divided by `{Rhs}`",
1001+
label = "no implementation for `{Self} %= {Rhs}`"
1002+
)
9791003
)]
9801004
#[doc(alias = "%")]
9811005
#[doc(alias = "%=")]

‎library/core/src/ops/bit.rs

Lines changed: 60 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,12 @@ impl Not for ! {
137137
#[lang = "bitand"]
138138
#[doc(alias = "&")]
139139
#[stable(feature = "rust1", since = "1.0.0")]
140-
#[diagnostic::on_unimplemented(
141-
message = "no implementation for `{Self} & {Rhs}`",
142-
label = "no implementation for `{Self} & {Rhs}`"
140+
#[cfg_attr(
141+
not(bootstrap),
142+
diagnostic::on_unimplemented(
143+
message = "no implementation for `{Self} & {Rhs}`",
144+
label = "no implementation for `{Self} & {Rhs}`"
145+
)
143146
)]
144147
pub trait BitAnd<Rhs = Self> {
145148
/// The resulting type after applying the `&` operator.
@@ -237,9 +240,12 @@ bitand_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
237240
#[lang = "bitor"]
238241
#[doc(alias = "|")]
239242
#[stable(feature = "rust1", since = "1.0.0")]
240-
#[diagnostic::on_unimplemented(
241-
message = "no implementation for `{Self} | {Rhs}`",
242-
label = "no implementation for `{Self} | {Rhs}`"
243+
#[cfg_attr(
244+
not(bootstrap),
245+
diagnostic::on_unimplemented(
246+
message = "no implementation for `{Self} | {Rhs}`",
247+
label = "no implementation for `{Self} | {Rhs}`"
248+
)
243249
)]
244250
pub trait BitOr<Rhs = Self> {
245251
/// The resulting type after applying the `|` operator.
@@ -337,9 +343,12 @@ bitor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
337343
#[lang = "bitxor"]
338344
#[doc(alias = "^")]
339345
#[stable(feature = "rust1", since = "1.0.0")]
340-
#[diagnostic::on_unimplemented(
341-
message = "no implementation for `{Self} ^ {Rhs}`",
342-
label = "no implementation for `{Self} ^ {Rhs}`"
346+
#[cfg_attr(
347+
not(bootstrap),
348+
diagnostic::on_unimplemented(
349+
message = "no implementation for `{Self} ^ {Rhs}`",
350+
label = "no implementation for `{Self} ^ {Rhs}`"
351+
)
343352
)]
344353
pub trait BitXor<Rhs = Self> {
345354
/// The resulting type after applying the `^` operator.
@@ -436,9 +445,12 @@ bitxor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
436445
#[lang = "shl"]
437446
#[doc(alias = "<<")]
438447
#[stable(feature = "rust1", since = "1.0.0")]
439-
#[diagnostic::on_unimplemented(
440-
message = "no implementation for `{Self} << {Rhs}`",
441-
label = "no implementation for `{Self} << {Rhs}`"
448+
#[cfg_attr(
449+
not(bootstrap),
450+
diagnostic::on_unimplemented(
451+
message = "no implementation for `{Self} << {Rhs}`",
452+
label = "no implementation for `{Self} << {Rhs}`"
453+
)
442454
)]
443455
pub trait Shl<Rhs = Self> {
444456
/// The resulting type after applying the `<<` operator.
@@ -554,9 +566,12 @@ shl_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 isize i128 }
554566
#[lang = "shr"]
555567
#[doc(alias = ">>")]
556568
#[stable(feature = "rust1", since = "1.0.0")]
557-
#[diagnostic::on_unimplemented(
558-
message = "no implementation for `{Self} >> {Rhs}`",
559-
label = "no implementation for `{Self} >> {Rhs}`"
569+
#[cfg_attr(
570+
not(bootstrap),
571+
diagnostic::on_unimplemented(
572+
message = "no implementation for `{Self} >> {Rhs}`",
573+
label = "no implementation for `{Self} >> {Rhs}`"
574+
)
560575
)]
561576
pub trait Shr<Rhs = Self> {
562577
/// The resulting type after applying the `>>` operator.
@@ -681,9 +696,12 @@ shr_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }
681696
#[lang = "bitand_assign"]
682697
#[doc(alias = "&=")]
683698
#[stable(feature = "op_assign_traits", since = "1.8.0")]
684-
#[diagnostic::on_unimplemented(
685-
message = "no implementation for `{Self} &= {Rhs}`",
686-
label = "no implementation for `{Self} &= {Rhs}`"
699+
#[cfg_attr(
700+
not(bootstrap),
701+
diagnostic::on_unimplemented(
702+
message = "no implementation for `{Self} &= {Rhs}`",
703+
label = "no implementation for `{Self} &= {Rhs}`"
704+
)
687705
)]
688706
pub trait BitAndAssign<Rhs = Self> {
689707
/// Performs the `&=` operation.
@@ -752,9 +770,12 @@ bitand_assign_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
752770
#[lang = "bitor_assign"]
753771
#[doc(alias = "|=")]
754772
#[stable(feature = "op_assign_traits", since = "1.8.0")]
755-
#[diagnostic::on_unimplemented(
756-
message = "no implementation for `{Self} |= {Rhs}`",
757-
label = "no implementation for `{Self} |= {Rhs}`"
773+
#[cfg_attr(
774+
not(bootstrap),
775+
diagnostic::on_unimplemented(
776+
message = "no implementation for `{Self} |= {Rhs}`",
777+
label = "no implementation for `{Self} |= {Rhs}`"
778+
)
758779
)]
759780
pub trait BitOrAssign<Rhs = Self> {
760781
/// Performs the `|=` operation.
@@ -823,9 +844,12 @@ bitor_assign_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
823844
#[lang = "bitxor_assign"]
824845
#[doc(alias = "^=")]
825846
#[stable(feature = "op_assign_traits", since = "1.8.0")]
826-
#[diagnostic::on_unimplemented(
827-
message = "no implementation for `{Self} ^= {Rhs}`",
828-
label = "no implementation for `{Self} ^= {Rhs}`"
847+
#[cfg_attr(
848+
not(bootstrap),
849+
diagnostic::on_unimplemented(
850+
message = "no implementation for `{Self} ^= {Rhs}`",
851+
label = "no implementation for `{Self} ^= {Rhs}`"
852+
)
829853
)]
830854
pub trait BitXorAssign<Rhs = Self> {
831855
/// Performs the `^=` operation.
@@ -892,9 +916,12 @@ bitxor_assign_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
892916
#[lang = "shl_assign"]
893917
#[doc(alias = "<<=")]
894918
#[stable(feature = "op_assign_traits", since = "1.8.0")]
895-
#[diagnostic::on_unimplemented(
896-
message = "no implementation for `{Self} <<= {Rhs}`",
897-
label = "no implementation for `{Self} <<= {Rhs}`"
919+
#[cfg_attr(
920+
not(bootstrap),
921+
diagnostic::on_unimplemented(
922+
message = "no implementation for `{Self} <<= {Rhs}`",
923+
label = "no implementation for `{Self} <<= {Rhs}`"
924+
)
898925
)]
899926
pub trait ShlAssign<Rhs = Self> {
900927
/// Performs the `<<=` operation.
@@ -974,9 +1001,12 @@ shl_assign_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }
9741001
#[lang = "shr_assign"]
9751002
#[doc(alias = ">>=")]
9761003
#[stable(feature = "op_assign_traits", since = "1.8.0")]
977-
#[diagnostic::on_unimplemented(
978-
message = "no implementation for `{Self} >>= {Rhs}`",
979-
label = "no implementation for `{Self} >>= {Rhs}`"
1004+
#[cfg_attr(
1005+
not(bootstrap),
1006+
diagnostic::on_unimplemented(
1007+
message = "no implementation for `{Self} >>= {Rhs}`",
1008+
label = "no implementation for `{Self} >>= {Rhs}`"
1009+
)
9801010
)]
9811011
pub trait ShrAssign<Rhs = Self> {
9821012
/// Performs the `>>=` operation.

‎library/core/src/ops/index.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,12 @@
4747
/// assert_eq!(nucleotide_count[Nucleotide::T], 12);
4848
/// ```
4949
#[lang = "index"]
50-
#[diagnostic::on_unimplemented(
51-
message = "the type `{Self}` cannot be indexed by `{Idx}`",
52-
label = "`{Self}` cannot be indexed by `{Idx}`"
50+
#[cfg_attr(
51+
not(bootstrap),
52+
diagnostic::on_unimplemented(
53+
message = "the type `{Self}` cannot be indexed by `{Idx}`",
54+
label = "`{Self}` cannot be indexed by `{Idx}`"
55+
)
5356
)]
5457
#[stable(feature = "rust1", since = "1.0.0")]
5558
#[doc(alias = "]")]

‎library/core/src/panic/unwind_safe.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,12 @@ use crate::task::{Context, Poll};
8383
/// implemented for any closed over variables passed to `catch_unwind`.
8484
#[stable(feature = "catch_unwind", since = "1.9.0")]
8585
#[cfg_attr(not(test), rustc_diagnostic_item = "unwind_safe_trait")]
86-
#[diagnostic::on_unimplemented(
87-
message = "the type `{Self}` may not be safely transferred across an unwind boundary",
88-
label = "`{Self}` may not be safely transferred across an unwind boundary"
86+
#[cfg_attr(
87+
not(bootstrap),
88+
diagnostic::on_unimplemented(
89+
message = "the type `{Self}` may not be safely transferred across an unwind boundary",
90+
label = "`{Self}` may not be safely transferred across an unwind boundary"
91+
)
8992
)]
9093
pub auto trait UnwindSafe {}
9194

@@ -99,11 +102,14 @@ pub auto trait UnwindSafe {}
99102
/// [`UnwindSafe`] trait, for more information see that documentation.
100103
#[stable(feature = "catch_unwind", since = "1.9.0")]
101104
#[cfg_attr(not(test), rustc_diagnostic_item = "ref_unwind_safe_trait")]
102-
#[diagnostic::on_unimplemented(
103-
message = "the type `{Self}` may contain interior mutability and a reference may not be safely \
105+
#[cfg_attr(
106+
not(bootstrap),
107+
diagnostic::on_unimplemented(
108+
message = "the type `{Self}` may contain interior mutability and a reference may not be safely \
104109
transferrable across a catch_unwind boundary",
105-
label = "`{Self}` may contain interior mutability and a reference may not be safely \
110+
label = "`{Self}` may contain interior mutability and a reference may not be safely \
106111
transferrable across a catch_unwind boundary"
112+
)
107113
)]
108114
pub auto trait RefUnwindSafe {}
109115

‎src/doc/unstable-book/src/language-features/diagnostic-namespace.md

Lines changed: 0 additions & 84 deletions
This file was deleted.

‎tests/ui/diagnostic_namespace/existing_proc_macros.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(diagnostic_namespace)]
21
// check-pass
32
// aux-build:proc-macro-helper.rs
43

‎tests/ui/diagnostic_namespace/feature-gate-diagnostic_namespace.rs

Lines changed: 0 additions & 13 deletions
This file was deleted.

‎tests/ui/diagnostic_namespace/feature-gate-diagnostic_namespace.stderr

Lines changed: 0 additions & 37 deletions
This file was deleted.

‎tests/ui/diagnostic_namespace/non_existing_attributes_accepted.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(diagnostic_namespace)]
21
// check-pass
32
#[diagnostic::non_existing_attribute]
43
//~^WARN unknown diagnostic attribute

‎tests/ui/diagnostic_namespace/non_existing_attributes_accepted.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
warning: unknown diagnostic attribute
2-
--> $DIR/non_existing_attributes_accepted.rs:3:15
2+
--> $DIR/non_existing_attributes_accepted.rs:2:15
33
|
44
LL | #[diagnostic::non_existing_attribute]
55
| ^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `#[warn(unknown_or_malformed_diagnostic_attributes)]` on by default
88

99
warning: unknown diagnostic attribute
10-
--> $DIR/non_existing_attributes_accepted.rs:8:15
10+
--> $DIR/non_existing_attributes_accepted.rs:7:15
1111
|
1212
LL | #[diagnostic::non_existing_attribute(with_option = "foo")]
1313
| ^^^^^^^^^^^^^^^^^^^^^^

‎tests/ui/diagnostic_namespace/on_unimplemented/auxiliary/other.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(diagnostic_namespace)]
2-
31
#[diagnostic::on_unimplemented(
42
message = "Message",
53
note = "Note",

‎tests/ui/diagnostic_namespace/on_unimplemented/do_not_accept_options_of_the_internal_rustc_attribute.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(diagnostic_namespace)]
2-
31
#[diagnostic::on_unimplemented(
42
on(_Self = "&str"),
53
//~^WARN malformed `on_unimplemented` attribute

‎tests/ui/diagnostic_namespace/on_unimplemented/do_not_accept_options_of_the_internal_rustc_attribute.stderr

Lines changed: 37 additions & 37 deletions
Large diffs are not rendered by default.

‎tests/ui/diagnostic_namespace/on_unimplemented/do_not_fail_parsing_on_invalid_options_1.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(diagnostic_namespace)]
2-
31
#[diagnostic::on_unimplemented(unsupported = "foo")]
42
//~^WARN malformed `on_unimplemented` attribute
53
//~|WARN malformed `on_unimplemented` attribute

‎tests/ui/diagnostic_namespace/on_unimplemented/do_not_fail_parsing_on_invalid_options_1.stderr

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,61 @@
11
warning: `#[diagnostic::on_unimplemented]` can only be applied to trait definitions
2-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:8:1
2+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:6:1
33
|
44
LL | #[diagnostic::on_unimplemented(message = "Baz")]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `#[warn(unknown_or_malformed_diagnostic_attributes)]` on by default
88

99
warning: malformed `on_unimplemented` attribute
10-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:3:32
10+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:1:32
1111
|
1212
LL | #[diagnostic::on_unimplemented(unsupported = "foo")]
1313
| ^^^^^^^^^^^^^^^^^^^ invalid option found here
1414
|
1515
= help: only `message`, `note` and `label` are allowed as options
1616

1717
warning: malformed `on_unimplemented` attribute
18-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:12:50
18+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:10:50
1919
|
2020
LL | #[diagnostic::on_unimplemented(message = "Boom", unsupported = "Bar")]
2121
| ^^^^^^^^^^^^^^^^^^^ invalid option found here
2222
|
2323
= help: only `message`, `note` and `label` are allowed as options
2424

2525
warning: malformed `on_unimplemented` attribute
26-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:17:50
26+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:15:50
2727
|
2828
LL | #[diagnostic::on_unimplemented(message = "Boom", on(_Self = "i32", message = "whatever"))]
2929
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid option found here
3030
|
3131
= help: only `message`, `note` and `label` are allowed as options
3232

3333
warning: malformed `on_unimplemented` attribute
34-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:22:32
34+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:20:32
3535
|
3636
LL | #[diagnostic::on_unimplemented = "boom"]
3737
| ^^^^^^^^ invalid option found here
3838
|
3939
= help: only `message`, `note` and `label` are allowed as options
4040

4141
warning: missing options for `on_unimplemented` attribute
42-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:26:1
42+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:24:1
4343
|
4444
LL | #[diagnostic::on_unimplemented]
4545
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4646
|
4747
= help: at least one of the `message`, `note` and `label` options are expected
4848

4949
warning: there is no parameter `DoesNotExist` on trait `Test`
50-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:31:32
50+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:29:32
5151
|
5252
LL | #[diagnostic::on_unimplemented(message = "{DoesNotExist}")]
5353
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
5454
|
5555
= help: expect either a generic argument name or `{Self}` as format argument
5656

5757
warning: malformed `on_unimplemented` attribute
58-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:3:32
58+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:1:32
5959
|
6060
LL | #[diagnostic::on_unimplemented(unsupported = "foo")]
6161
| ^^^^^^^^^^^^^^^^^^^ invalid option found here
@@ -64,26 +64,26 @@ LL | #[diagnostic::on_unimplemented(unsupported = "foo")]
6464
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
6565

6666
error[E0277]: the trait bound `i32: Foo` is not satisfied
67-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:43:14
67+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:41:14
6868
|
6969
LL | take_foo(1_i32);
7070
| -------- ^^^^^ the trait `Foo` is not implemented for `i32`
7171
| |
7272
| required by a bound introduced by this call
7373
|
7474
help: this trait has no implementations, consider adding one
75-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:6:1
75+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:4:1
7676
|
7777
LL | trait Foo {}
7878
| ^^^^^^^^^
7979
note: required by a bound in `take_foo`
80-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:36:21
80+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:34:21
8181
|
8282
LL | fn take_foo(_: impl Foo) {}
8383
| ^^^ required by this bound in `take_foo`
8484

8585
warning: malformed `on_unimplemented` attribute
86-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:12:50
86+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:10:50
8787
|
8888
LL | #[diagnostic::on_unimplemented(message = "Boom", unsupported = "Bar")]
8989
| ^^^^^^^^^^^^^^^^^^^ invalid option found here
@@ -92,26 +92,26 @@ LL | #[diagnostic::on_unimplemented(message = "Boom", unsupported = "Bar")]
9292
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
9393

9494
error[E0277]: Boom
95-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:45:14
95+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:43:14
9696
|
9797
LL | take_baz(1_i32);
9898
| -------- ^^^^^ the trait `Baz` is not implemented for `i32`
9999
| |
100100
| required by a bound introduced by this call
101101
|
102102
help: this trait has no implementations, consider adding one
103-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:15:1
103+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:13:1
104104
|
105105
LL | trait Baz {}
106106
| ^^^^^^^^^
107107
note: required by a bound in `take_baz`
108-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:37:21
108+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:35:21
109109
|
110110
LL | fn take_baz(_: impl Baz) {}
111111
| ^^^ required by this bound in `take_baz`
112112

113113
warning: malformed `on_unimplemented` attribute
114-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:17:50
114+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:15:50
115115
|
116116
LL | #[diagnostic::on_unimplemented(message = "Boom", on(_Self = "i32", message = "whatever"))]
117117
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid option found here
@@ -120,26 +120,26 @@ LL | #[diagnostic::on_unimplemented(message = "Boom", on(_Self = "i32", message
120120
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
121121

122122
error[E0277]: Boom
123-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:47:15
123+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:45:15
124124
|
125125
LL | take_boom(1_i32);
126126
| --------- ^^^^^ the trait `Boom` is not implemented for `i32`
127127
| |
128128
| required by a bound introduced by this call
129129
|
130130
help: this trait has no implementations, consider adding one
131-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:20:1
131+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:18:1
132132
|
133133
LL | trait Boom {}
134134
| ^^^^^^^^^^
135135
note: required by a bound in `take_boom`
136-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:38:22
136+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:36:22
137137
|
138138
LL | fn take_boom(_: impl Boom) {}
139139
| ^^^^ required by this bound in `take_boom`
140140

141141
warning: missing options for `on_unimplemented` attribute
142-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:26:1
142+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:24:1
143143
|
144144
LL | #[diagnostic::on_unimplemented]
145145
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -148,26 +148,26 @@ LL | #[diagnostic::on_unimplemented]
148148
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
149149

150150
error[E0277]: the trait bound `i32: Whatever` is not satisfied
151-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:49:19
151+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:47:19
152152
|
153153
LL | take_whatever(1_i32);
154154
| ------------- ^^^^^ the trait `Whatever` is not implemented for `i32`
155155
| |
156156
| required by a bound introduced by this call
157157
|
158158
help: this trait has no implementations, consider adding one
159-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:29:1
159+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:27:1
160160
|
161161
LL | trait Whatever {}
162162
| ^^^^^^^^^^^^^^
163163
note: required by a bound in `take_whatever`
164-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:39:26
164+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:37:26
165165
|
166166
LL | fn take_whatever(_: impl Whatever) {}
167167
| ^^^^^^^^ required by this bound in `take_whatever`
168168

169169
warning: there is no parameter `DoesNotExist` on trait `Test`
170-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:31:32
170+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:29:32
171171
|
172172
LL | #[diagnostic::on_unimplemented(message = "{DoesNotExist}")]
173173
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -176,20 +176,20 @@ LL | #[diagnostic::on_unimplemented(message = "{DoesNotExist}")]
176176
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
177177

178178
error[E0277]: {DoesNotExist}
179-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:51:15
179+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:49:15
180180
|
181181
LL | take_test(());
182182
| --------- ^^ the trait `Test` is not implemented for `()`
183183
| |
184184
| required by a bound introduced by this call
185185
|
186186
help: this trait has no implementations, consider adding one
187-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:34:1
187+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:32:1
188188
|
189189
LL | trait Test {}
190190
| ^^^^^^^^^^
191191
note: required by a bound in `take_test`
192-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:40:22
192+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:38:22
193193
|
194194
LL | fn take_test(_: impl Test) {}
195195
| ^^^^ required by this bound in `take_test`

‎tests/ui/diagnostic_namespace/on_unimplemented/feature-gate-diagnostic_on_unimplemented.rs

Lines changed: 0 additions & 7 deletions
This file was deleted.

‎tests/ui/diagnostic_namespace/on_unimplemented/feature-gate-diagnostic_on_unimplemented.stderr

Lines changed: 0 additions & 13 deletions
This file was deleted.

‎tests/ui/diagnostic_namespace/on_unimplemented/ignore_unsupported_options_and_continue_to_use_fallback.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(diagnostic_namespace)]
2-
31
#[diagnostic::on_unimplemented(
42
if(Self = "()"),
53
//~^WARN malformed `on_unimplemented` attribute

‎tests/ui/diagnostic_namespace/on_unimplemented/ignore_unsupported_options_and_continue_to_use_fallback.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: malformed `on_unimplemented` attribute
2-
--> $DIR/ignore_unsupported_options_and_continue_to_use_fallback.rs:4:5
2+
--> $DIR/ignore_unsupported_options_and_continue_to_use_fallback.rs:2:5
33
|
44
LL | if(Self = "()"),
55
| ^^^^^^^^^^^^^^^ invalid option found here
@@ -8,7 +8,7 @@ LL | if(Self = "()"),
88
= note: `#[warn(unknown_or_malformed_diagnostic_attributes)]` on by default
99

1010
warning: `message` is ignored due to previous definition of `message`
11-
--> $DIR/ignore_unsupported_options_and_continue_to_use_fallback.rs:10:32
11+
--> $DIR/ignore_unsupported_options_and_continue_to_use_fallback.rs:8:32
1212
|
1313
LL | message = "custom message",
1414
| -------------------------- `message` is first declared here
@@ -17,7 +17,7 @@ LL | #[diagnostic::on_unimplemented(message = "fallback!!")]
1717
| ^^^^^^^^^^^^^^^^^^^^^^ `message` is already declared here
1818

1919
warning: malformed `on_unimplemented` attribute
20-
--> $DIR/ignore_unsupported_options_and_continue_to_use_fallback.rs:4:5
20+
--> $DIR/ignore_unsupported_options_and_continue_to_use_fallback.rs:2:5
2121
|
2222
LL | if(Self = "()"),
2323
| ^^^^^^^^^^^^^^^ invalid option found here
@@ -26,7 +26,7 @@ LL | if(Self = "()"),
2626
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2727

2828
warning: `message` is ignored due to previous definition of `message`
29-
--> $DIR/ignore_unsupported_options_and_continue_to_use_fallback.rs:10:32
29+
--> $DIR/ignore_unsupported_options_and_continue_to_use_fallback.rs:8:32
3030
|
3131
LL | message = "custom message",
3232
| -------------------------- `message` is first declared here
@@ -37,7 +37,7 @@ LL | #[diagnostic::on_unimplemented(message = "fallback!!")]
3737
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
3838

3939
error[E0277]: custom message
40-
--> $DIR/ignore_unsupported_options_and_continue_to_use_fallback.rs:20:15
40+
--> $DIR/ignore_unsupported_options_and_continue_to_use_fallback.rs:18:15
4141
|
4242
LL | takes_foo(());
4343
| --------- ^^ fallback label
@@ -48,12 +48,12 @@ LL | takes_foo(());
4848
= note: custom note
4949
= note: fallback note
5050
help: this trait has no implementations, consider adding one
51-
--> $DIR/ignore_unsupported_options_and_continue_to_use_fallback.rs:15:1
51+
--> $DIR/ignore_unsupported_options_and_continue_to_use_fallback.rs:13:1
5252
|
5353
LL | trait Foo {}
5454
| ^^^^^^^^^
5555
note: required by a bound in `takes_foo`
56-
--> $DIR/ignore_unsupported_options_and_continue_to_use_fallback.rs:17:22
56+
--> $DIR/ignore_unsupported_options_and_continue_to_use_fallback.rs:15:22
5757
|
5858
LL | fn takes_foo(_: impl Foo) {}
5959
| ^^^ required by this bound in `takes_foo`

‎tests/ui/diagnostic_namespace/on_unimplemented/multiple_notes.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(diagnostic_namespace)]
2-
31
#[diagnostic::on_unimplemented(message = "Foo", label = "Bar", note = "Baz", note = "Boom")]
42
trait Foo {}
53

‎tests/ui/diagnostic_namespace/on_unimplemented/multiple_notes.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0277]: Foo
2-
--> $DIR/multiple_notes.rs:14:15
2+
--> $DIR/multiple_notes.rs:12:15
33
|
44
LL | takes_foo(());
55
| --------- ^^ Bar
@@ -10,18 +10,18 @@ LL | takes_foo(());
1010
= note: Baz
1111
= note: Boom
1212
help: this trait has no implementations, consider adding one
13-
--> $DIR/multiple_notes.rs:4:1
13+
--> $DIR/multiple_notes.rs:2:1
1414
|
1515
LL | trait Foo {}
1616
| ^^^^^^^^^
1717
note: required by a bound in `takes_foo`
18-
--> $DIR/multiple_notes.rs:10:22
18+
--> $DIR/multiple_notes.rs:8:22
1919
|
2020
LL | fn takes_foo(_: impl Foo) {}
2121
| ^^^ required by this bound in `takes_foo`
2222

2323
error[E0277]: Bar
24-
--> $DIR/multiple_notes.rs:16:15
24+
--> $DIR/multiple_notes.rs:14:15
2525
|
2626
LL | takes_bar(());
2727
| --------- ^^ Foo
@@ -32,12 +32,12 @@ LL | takes_bar(());
3232
= note: Baz
3333
= note: Baz2
3434
help: this trait has no implementations, consider adding one
35-
--> $DIR/multiple_notes.rs:8:1
35+
--> $DIR/multiple_notes.rs:6:1
3636
|
3737
LL | trait Bar {}
3838
| ^^^^^^^^^
3939
note: required by a bound in `takes_bar`
40-
--> $DIR/multiple_notes.rs:11:22
40+
--> $DIR/multiple_notes.rs:9:22
4141
|
4242
LL | fn takes_bar(_: impl Bar) {}
4343
| ^^^ required by this bound in `takes_bar`

‎tests/ui/diagnostic_namespace/on_unimplemented/on_unimplemented_simple.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(diagnostic_namespace)]
2-
31
#[diagnostic::on_unimplemented(message = "Foo", label = "Bar", note = "Baz")]
42
trait Foo {}
53

‎tests/ui/diagnostic_namespace/on_unimplemented/on_unimplemented_simple.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0277]: Foo
2-
--> $DIR/on_unimplemented_simple.rs:9:15
2+
--> $DIR/on_unimplemented_simple.rs:7:15
33
|
44
LL | takes_foo(());
55
| --------- ^^ Bar
@@ -9,12 +9,12 @@ LL | takes_foo(());
99
= help: the trait `Foo` is not implemented for `()`
1010
= note: Baz
1111
help: this trait has no implementations, consider adding one
12-
--> $DIR/on_unimplemented_simple.rs:4:1
12+
--> $DIR/on_unimplemented_simple.rs:2:1
1313
|
1414
LL | trait Foo {}
1515
| ^^^^^^^^^
1616
note: required by a bound in `takes_foo`
17-
--> $DIR/on_unimplemented_simple.rs:6:22
17+
--> $DIR/on_unimplemented_simple.rs:4:22
1818
|
1919
LL | fn takes_foo(_: impl Foo) {}
2020
| ^^^ required by this bound in `takes_foo`

‎tests/ui/diagnostic_namespace/on_unimplemented/report_warning_on_duplicated_options.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(diagnostic_namespace)]
2-
31
#[diagnostic::on_unimplemented(
42
message = "first message",
53
label = "first label",

‎tests/ui/diagnostic_namespace/on_unimplemented/report_warning_on_duplicated_options.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: `message` is ignored due to previous definition of `message`
2-
--> $DIR/report_warning_on_duplicated_options.rs:9:5
2+
--> $DIR/report_warning_on_duplicated_options.rs:7:5
33
|
44
LL | message = "first message",
55
| ------------------------- `message` is first declared here
@@ -10,7 +10,7 @@ LL | message = "second message",
1010
= note: `#[warn(unknown_or_malformed_diagnostic_attributes)]` on by default
1111

1212
warning: `label` is ignored due to previous definition of `label`
13-
--> $DIR/report_warning_on_duplicated_options.rs:12:5
13+
--> $DIR/report_warning_on_duplicated_options.rs:10:5
1414
|
1515
LL | label = "first label",
1616
| --------------------- `label` is first declared here
@@ -19,7 +19,7 @@ LL | label = "second label",
1919
| ^^^^^^^^^^^^^^^^^^^^^^ `label` is already declared here
2020

2121
warning: `message` is ignored due to previous definition of `message`
22-
--> $DIR/report_warning_on_duplicated_options.rs:9:5
22+
--> $DIR/report_warning_on_duplicated_options.rs:7:5
2323
|
2424
LL | message = "first message",
2525
| ------------------------- `message` is first declared here
@@ -30,7 +30,7 @@ LL | message = "second message",
3030
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
3131

3232
warning: `label` is ignored due to previous definition of `label`
33-
--> $DIR/report_warning_on_duplicated_options.rs:12:5
33+
--> $DIR/report_warning_on_duplicated_options.rs:10:5
3434
|
3535
LL | label = "first label",
3636
| --------------------- `label` is first declared here
@@ -41,7 +41,7 @@ LL | label = "second label",
4141
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
4242

4343
error[E0277]: first message
44-
--> $DIR/report_warning_on_duplicated_options.rs:23:15
44+
--> $DIR/report_warning_on_duplicated_options.rs:21:15
4545
|
4646
LL | takes_foo(());
4747
| --------- ^^ first label
@@ -52,12 +52,12 @@ LL | takes_foo(());
5252
= note: custom note
5353
= note: second note
5454
help: this trait has no implementations, consider adding one
55-
--> $DIR/report_warning_on_duplicated_options.rs:17:1
55+
--> $DIR/report_warning_on_duplicated_options.rs:15:1
5656
|
5757
LL | trait Foo {}
5858
| ^^^^^^^^^
5959
note: required by a bound in `takes_foo`
60-
--> $DIR/report_warning_on_duplicated_options.rs:20:22
60+
--> $DIR/report_warning_on_duplicated_options.rs:18:22
6161
|
6262
LL | fn takes_foo(_: impl Foo) {}
6363
| ^^^ required by this bound in `takes_foo`

‎tests/ui/diagnostic_namespace/requires_path.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(diagnostic_namespace)]
2-
31
#[diagnostic]
42
//~^ERROR cannot find attribute `diagnostic` in this scope
53
pub struct Bar;

‎tests/ui/diagnostic_namespace/requires_path.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: cannot find attribute `diagnostic` in this scope
2-
--> $DIR/requires_path.rs:3:3
2+
--> $DIR/requires_path.rs:1:3
33
|
44
LL | #[diagnostic]
55
| ^^^^^^^^^^

0 commit comments

Comments
 (0)
Please sign in to comment.