diff --git a/compiler/rustc_attr_data_structures/src/attributes.rs b/compiler/rustc_attr_data_structures/src/attributes.rs index b656db3252823..0a687f6242e76 100644 --- a/compiler/rustc_attr_data_structures/src/attributes.rs +++ b/compiler/rustc_attr_data_structures/src/attributes.rs @@ -232,7 +232,7 @@ pub enum AttributeKind { }, /// Represents `#[rustc_const_stable_indirect]`. - ConstStabilityIndirect, + ConstStabilityIndirect(Span), /// Represents [`#[deprecated]`](https://doc.rust-lang.org/stable/reference/attributes/diagnostics.html#the-deprecated-attribute). Deprecation { deprecation: Deprecation, span: Span }, @@ -241,7 +241,7 @@ pub enum AttributeKind { DocComment { style: AttrStyle, kind: CommentKind, span: Span, comment: Symbol }, /// Represents `#[rustc_dummy]`. - Dummy, + Dummy(Span), /// Represents [`#[export_name]`](https://doc.rust-lang.org/reference/abi.html#the-export_name-attribute). ExportName { @@ -252,7 +252,7 @@ pub enum AttributeKind { }, /// Represents `#[export_stable]`. - ExportStable, + ExportStable(Span), /// Represents `#[ffi_const]`. FfiConst(Span), @@ -280,7 +280,7 @@ pub enum AttributeKind { LoopMatch(Span), /// Represents `#[rustc_macro_transparency]`. - MacroTransparency(Transparency), + MacroTransparency(Transparency, Span), /// Represents [`#[may_dangle]`](https://std-dev-guide.rust-lang.org/tricky/may-dangle.html). MayDangle(Span), @@ -326,7 +326,7 @@ pub enum AttributeKind { RustcLayoutScalarValidRangeStart(Box, Span), /// Represents `#[rustc_object_lifetime_default]`. - RustcObjectLifetimeDefault, + RustcObjectLifetimeDefault(Span), /// Represents `#[rustc_skip_during_method_dispatch]`. SkipDuringMethodDispatch { array: bool, boxed_slice: bool, span: Span }, diff --git a/compiler/rustc_attr_data_structures/src/encode_cross_crate.rs b/compiler/rustc_attr_data_structures/src/encode_cross_crate.rs index 5414c7b103bcb..eb5316021587b 100644 --- a/compiler/rustc_attr_data_structures/src/encode_cross_crate.rs +++ b/compiler/rustc_attr_data_structures/src/encode_cross_crate.rs @@ -22,12 +22,12 @@ impl AttributeKind { Confusables { .. } => Yes, ConstContinue(..) => No, ConstStability { .. } => Yes, - ConstStabilityIndirect => No, + ConstStabilityIndirect(..) => No, Deprecation { .. } => Yes, DocComment { .. } => Yes, - Dummy => No, + Dummy(..) => No, ExportName { .. } => Yes, - ExportStable => No, + ExportStable(..) => No, FfiConst(..) => No, FfiPure(..) => No, Ignore { .. } => No, @@ -49,7 +49,7 @@ impl AttributeKind { Repr { .. } => No, RustcLayoutScalarValidRangeEnd(..) => Yes, RustcLayoutScalarValidRangeStart(..) => Yes, - RustcObjectLifetimeDefault => No, + RustcObjectLifetimeDefault(..) => No, SkipDuringMethodDispatch { .. } => No, Stability { .. } => Yes, StdInternalSymbol(..) => No, diff --git a/compiler/rustc_attr_parsing/src/attributes/dummy.rs b/compiler/rustc_attr_parsing/src/attributes/dummy.rs index e5e1c3bb6b6a9..388d30dc67c57 100644 --- a/compiler/rustc_attr_parsing/src/attributes/dummy.rs +++ b/compiler/rustc_attr_parsing/src/attributes/dummy.rs @@ -13,7 +13,7 @@ impl SingleAttributeParser for DummyParser { const ON_DUPLICATE: OnDuplicate = OnDuplicate::Ignore; const TEMPLATE: AttributeTemplate = template!(Word); // Anything, really - fn convert(_: &mut AcceptContext<'_, '_, S>, _: &ArgParser<'_>) -> Option { - Some(AttributeKind::Dummy) + fn convert(cx: &mut AcceptContext<'_, '_, S>, _: &ArgParser<'_>) -> Option { + Some(AttributeKind::Dummy(cx.attr_span)) } } diff --git a/compiler/rustc_attr_parsing/src/attributes/link_attrs.rs b/compiler/rustc_attr_parsing/src/attributes/link_attrs.rs index 23a8e96482de8..7907902a3eb5a 100644 --- a/compiler/rustc_attr_parsing/src/attributes/link_attrs.rs +++ b/compiler/rustc_attr_parsing/src/attributes/link_attrs.rs @@ -64,7 +64,7 @@ pub(crate) struct ExportStableParser; impl NoArgsAttributeParser for ExportStableParser { const PATH: &[Symbol] = &[sym::export_stable]; const ON_DUPLICATE: OnDuplicate = OnDuplicate::Warn; - const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::ExportStable; + const CREATE: fn(Span) -> AttributeKind = AttributeKind::ExportStable; } pub(crate) struct FfiConstParser; diff --git a/compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs b/compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs index ec821cb11ce9f..9dbe7b6900044 100644 --- a/compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs +++ b/compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs @@ -72,6 +72,6 @@ impl SingleAttributeParser for RustcObjectLifetimeDefaultParser { return None; } - Some(AttributeKind::RustcObjectLifetimeDefault) + Some(AttributeKind::RustcObjectLifetimeDefault(cx.attr_span)) } } diff --git a/compiler/rustc_attr_parsing/src/attributes/stability.rs b/compiler/rustc_attr_parsing/src/attributes/stability.rs index 6bccd0042a80d..b452f58762637 100644 --- a/compiler/rustc_attr_parsing/src/attributes/stability.rs +++ b/compiler/rustc_attr_parsing/src/attributes/stability.rs @@ -136,7 +136,7 @@ pub(crate) struct ConstStabilityIndirectParser; impl NoArgsAttributeParser for ConstStabilityIndirectParser { const PATH: &[Symbol] = &[sym::rustc_const_stable_indirect]; const ON_DUPLICATE: OnDuplicate = OnDuplicate::Ignore; - const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::ConstStabilityIndirect; + const CREATE: fn(Span) -> AttributeKind = AttributeKind::ConstStabilityIndirect; } #[derive(Default)] diff --git a/compiler/rustc_attr_parsing/src/attributes/transparency.rs b/compiler/rustc_attr_parsing/src/attributes/transparency.rs index c9fdc57cc06eb..6f69f3333b3db 100644 --- a/compiler/rustc_attr_parsing/src/attributes/transparency.rs +++ b/compiler/rustc_attr_parsing/src/attributes/transparency.rs @@ -39,6 +39,6 @@ impl SingleAttributeParser for TransparencyParser { } None => None, } - .map(AttributeKind::MacroTransparency) + .map(|t| AttributeKind::MacroTransparency(t, cx.attr_span)) } } diff --git a/compiler/rustc_expand/src/mbe/macro_rules.rs b/compiler/rustc_expand/src/mbe/macro_rules.rs index 89547088f501f..ade32915af315 100644 --- a/compiler/rustc_expand/src/mbe/macro_rules.rs +++ b/compiler/rustc_expand/src/mbe/macro_rules.rs @@ -429,7 +429,7 @@ pub fn compile_declarative_macro( return dummy_syn_ext(guar); } - let transparency = find_attr!(attrs, AttributeKind::MacroTransparency(x) => *x) + let transparency = find_attr!(attrs, AttributeKind::MacroTransparency(x, _) => *x) .unwrap_or(Transparency::fallback(macro_rules)); if let Some(guar) = guar { diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index 0f6f81d7964c4..50f7828183b3f 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -1299,12 +1299,51 @@ impl AttributeExt for Attribute { fn span(&self) -> Span { match &self { Attribute::Unparsed(u) => u.span, - // FIXME: should not be needed anymore when all attrs are parsed - Attribute::Parsed(AttributeKind::Deprecation { span, .. }) => *span, - Attribute::Parsed(AttributeKind::DocComment { span, .. }) => *span, - Attribute::Parsed(AttributeKind::MayDangle(span)) => *span, - Attribute::Parsed(AttributeKind::Ignore { span, .. }) => *span, - a => panic!("can't get the span of an arbitrary parsed attribute: {a:?}"), + Attribute::Parsed(kind) => match kind { + AttributeKind::Align { span, .. } + | AttributeKind::AllowConstFnUnstable(_, span) + | AttributeKind::AllowInternalUnstable(_, span) + | AttributeKind::AsPtr(span) + | AttributeKind::BodyStability { span, .. } + | AttributeKind::Cold(span) + | AttributeKind::Confusables { first_span: span, .. } + | AttributeKind::ConstContinue(span) + | AttributeKind::ConstStability { span, .. } + | AttributeKind::ConstStabilityIndirect(span) + | AttributeKind::Deprecation { span, .. } + | AttributeKind::DocComment { span, .. } + | AttributeKind::Dummy(span) + | AttributeKind::ExportName { span, .. } + | AttributeKind::ExportStable(span) + | AttributeKind::FfiConst(span) + | AttributeKind::FfiPure(span) + | AttributeKind::Ignore { span, .. } + | AttributeKind::Inline(_, span) + | AttributeKind::LinkName { span, .. } + | AttributeKind::LinkSection { span, .. } + | AttributeKind::LoopMatch(span) + | AttributeKind::MacroTransparency(.., span) + | AttributeKind::MayDangle(span) + | AttributeKind::MustUse { span, .. } + | AttributeKind::Naked(span) + | AttributeKind::NoImplicitPrelude(span) + | AttributeKind::NoMangle(span) + | AttributeKind::NonExhaustive(span) + | AttributeKind::Optimize(_, span) + | AttributeKind::PassByValue(span) + | AttributeKind::Path(_, span) + | AttributeKind::PubTransparent(span) + | AttributeKind::Repr { first_span: span, .. } + | AttributeKind::RustcLayoutScalarValidRangeEnd(_, span) + | AttributeKind::RustcLayoutScalarValidRangeStart(_, span) + | AttributeKind::RustcObjectLifetimeDefault(span) + | AttributeKind::SkipDuringMethodDispatch { span, .. } + | AttributeKind::Stability { span, .. } + | AttributeKind::StdInternalSymbol(span) + | AttributeKind::TargetFeature(_, span) + | AttributeKind::TrackCaller(span) + | AttributeKind::Used { span, .. } => *span, + }, } } diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index 0aa6a2b41cfb6..81320acf775a3 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -162,7 +162,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> { } Attribute::Parsed(AttributeKind::Repr { .. }) => { /* handled below this loop and elsewhere */ } - Attribute::Parsed(AttributeKind::RustcObjectLifetimeDefault) => { + Attribute::Parsed(AttributeKind::RustcObjectLifetimeDefault(..)) => { self.check_object_lifetime_default(hir_id); } &Attribute::Parsed(AttributeKind::PubTransparent(attr_span)) => { @@ -204,7 +204,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> { AttributeKind::RustcLayoutScalarValidRangeStart(_num, attr_span) | AttributeKind::RustcLayoutScalarValidRangeEnd(_num, attr_span), ) => self.check_rustc_layout_scalar_valid_range(*attr_span, span, target), - Attribute::Parsed(AttributeKind::ExportStable) => { + Attribute::Parsed(AttributeKind::ExportStable(..)) => { // handled in `check_export` } &Attribute::Parsed(AttributeKind::FfiConst(attr_span)) => { @@ -215,9 +215,9 @@ impl<'tcx> CheckAttrVisitor<'tcx> { } Attribute::Parsed( AttributeKind::BodyStability { .. } - | AttributeKind::ConstStabilityIndirect - | AttributeKind::MacroTransparency(_) - | AttributeKind::Dummy, + | AttributeKind::ConstStabilityIndirect(..) + | AttributeKind::MacroTransparency(..) + | AttributeKind::Dummy(..), ) => { /* do nothing */ } Attribute::Parsed(AttributeKind::AsPtr(attr_span)) => { self.check_applied_to_fn_or_method(hir_id, *attr_span, span, target) diff --git a/compiler/rustc_passes/src/check_export.rs b/compiler/rustc_passes/src/check_export.rs index b1f4584c2a88a..06cdcd0dc2a28 100644 --- a/compiler/rustc_passes/src/check_export.rs +++ b/compiler/rustc_passes/src/check_export.rs @@ -45,7 +45,7 @@ impl<'tcx> ExportableItemCollector<'tcx> { } fn item_is_exportable(&self, def_id: LocalDefId) -> bool { - let has_attr = find_attr!(self.tcx.get_all_attrs(def_id), AttributeKind::ExportStable); + let has_attr = find_attr!(self.tcx.get_all_attrs(def_id), AttributeKind::ExportStable(..)); if !self.in_exportable_mod && !has_attr { return false; } @@ -81,7 +81,7 @@ impl<'tcx> ExportableItemCollector<'tcx> { fn walk_item_with_mod(&mut self, item: &'tcx hir::Item<'tcx>) { let def_id = item.hir_id().owner.def_id; let old_exportable_mod = self.in_exportable_mod; - if find_attr!(self.tcx.get_all_attrs(def_id), AttributeKind::ExportStable) { + if find_attr!(self.tcx.get_all_attrs(def_id), AttributeKind::ExportStable(..)) { self.in_exportable_mod = true; } let old_seen_exportable_in_mod = std::mem::replace(&mut self.seen_exportable_in_mod, false); diff --git a/compiler/rustc_passes/src/stability.rs b/compiler/rustc_passes/src/stability.rs index a30655d32a7e5..68dfd76fe047e 100644 --- a/compiler/rustc_passes/src/stability.rs +++ b/compiler/rustc_passes/src/stability.rs @@ -122,7 +122,7 @@ impl<'a, 'tcx> Annotator<'a, 'tcx> { debug!("annotate(id = {:?}, attrs = {:?})", def_id, attrs); let depr = attrs::find_attr!(attrs, AttributeKind::Deprecation{deprecation, span} => (*deprecation, *span)); - let const_stability_indirect = find_attr!(attrs, AttributeKind::ConstStabilityIndirect); + let const_stability_indirect = find_attr!(attrs, AttributeKind::ConstStabilityIndirect(..)); let mut is_deprecated = false; if let Some((depr, span)) = &depr { diff --git a/compiler/rustc_privacy/src/lib.rs b/compiler/rustc_privacy/src/lib.rs index 963f4c77d809d..16ef7fca6daa0 100644 --- a/compiler/rustc_privacy/src/lib.rs +++ b/compiler/rustc_privacy/src/lib.rs @@ -496,7 +496,7 @@ impl<'tcx> EmbargoVisitor<'tcx> { let hir_id = self.tcx.local_def_id_to_hir_id(local_def_id); let attrs = self.tcx.hir_attrs(hir_id); - if attrs::find_attr!(attrs, attrs::AttributeKind::MacroTransparency(x) => *x) + if attrs::find_attr!(attrs, attrs::AttributeKind::MacroTransparency(x, _) => *x) .unwrap_or(Transparency::fallback(md.macro_rules)) != Transparency::Opaque { diff --git a/tests/crashes/138510.rs b/tests/crashes/138510.rs deleted file mode 100644 index f429e8bb33b56..0000000000000 --- a/tests/crashes/138510.rs +++ /dev/null @@ -1,7 +0,0 @@ -//@ known-bug: #138510 -fn main() -where - #[repr()] - _: Sized, -{ -} diff --git a/tests/ui/where-clauses/unsupported_attribute.rs b/tests/ui/where-clauses/unsupported_attribute.rs index 33128b383b991..f4a5adf1305cf 100644 --- a/tests/ui/where-clauses/unsupported_attribute.rs +++ b/tests/ui/where-clauses/unsupported_attribute.rs @@ -5,6 +5,7 @@ #![feature(custom_test_frameworks)] #![feature(derive_const)] #![feature(where_clause_attrs)] +#![feature(stmt_expr_attributes)] #![allow(soft_unstable)] trait Trait {} @@ -33,4 +34,15 @@ where //~| ERROR expected non-macro attribute, found attribute macro `derive` #[rustfmt::skip] T: Trait, //~ ERROR most attributes are not supported in `where` clauses #[rustfmt::skip] 'a: 'static, //~ ERROR most attributes are not supported in `where` clauses + #[must_use] T: Trait, //~ ERROR most attributes are not supported in `where` clauses + #[must_use] 'a: 'static, //~ ERROR most attributes are not supported in `where` clauses + #[cold] T: Trait, //~ ERROR most attributes are not supported in `where` clauses + #[cold] 'a: 'static, //~ ERROR most attributes are not supported in `where` clauses + #[repr()] T: Trait, //~ ERROR most attributes are not supported in `where` clauses + #[repr()] 'a: 'static, //~ ERROR most attributes are not supported in `where` clauses {} + +fn another_one() { + // Regression test for https://github.com/rust-lang/rust/issues/143787 + let _: String = #[repr()] std::string::String::new(); +} diff --git a/tests/ui/where-clauses/unsupported_attribute.stderr b/tests/ui/where-clauses/unsupported_attribute.stderr index ecb28039f8851..107da34ff7926 100644 --- a/tests/ui/where-clauses/unsupported_attribute.stderr +++ b/tests/ui/where-clauses/unsupported_attribute.stderr @@ -1,17 +1,17 @@ error: expected non-macro attribute, found attribute macro `derive` - --> $DIR/unsupported_attribute.rs:28:7 + --> $DIR/unsupported_attribute.rs:29:7 | LL | #[derive(Clone)] T: Trait, | ^^^^^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `derive` - --> $DIR/unsupported_attribute.rs:31:7 + --> $DIR/unsupported_attribute.rs:32:7 | LL | #[derive(Clone)] 'a: 'static, | ^^^^^^ not a non-macro attribute error: most attributes are not supported in `where` clauses - --> $DIR/unsupported_attribute.rs:14:5 + --> $DIR/unsupported_attribute.rs:15:5 | LL | #[doc = "doc"] T: Trait, | ^^^^^^^^^^^^^^ @@ -19,7 +19,7 @@ LL | #[doc = "doc"] T: Trait, = help: only `#[cfg]` and `#[cfg_attr]` are supported error: most attributes are not supported in `where` clauses - --> $DIR/unsupported_attribute.rs:15:5 + --> $DIR/unsupported_attribute.rs:16:5 | LL | #[doc = "doc"] 'a: 'static, | ^^^^^^^^^^^^^^ @@ -27,7 +27,7 @@ LL | #[doc = "doc"] 'a: 'static, = help: only `#[cfg]` and `#[cfg_attr]` are supported error: most attributes are not supported in `where` clauses - --> $DIR/unsupported_attribute.rs:16:5 + --> $DIR/unsupported_attribute.rs:17:5 | LL | #[ignore] T: Trait, | ^^^^^^^^^ @@ -35,7 +35,7 @@ LL | #[ignore] T: Trait, = help: only `#[cfg]` and `#[cfg_attr]` are supported error: most attributes are not supported in `where` clauses - --> $DIR/unsupported_attribute.rs:17:5 + --> $DIR/unsupported_attribute.rs:18:5 | LL | #[ignore] 'a: 'static, | ^^^^^^^^^ @@ -43,7 +43,7 @@ LL | #[ignore] 'a: 'static, = help: only `#[cfg]` and `#[cfg_attr]` are supported error: most attributes are not supported in `where` clauses - --> $DIR/unsupported_attribute.rs:18:5 + --> $DIR/unsupported_attribute.rs:19:5 | LL | #[should_panic] T: Trait, | ^^^^^^^^^^^^^^^ @@ -51,7 +51,7 @@ LL | #[should_panic] T: Trait, = help: only `#[cfg]` and `#[cfg_attr]` are supported error: most attributes are not supported in `where` clauses - --> $DIR/unsupported_attribute.rs:19:5 + --> $DIR/unsupported_attribute.rs:20:5 | LL | #[should_panic] 'a: 'static, | ^^^^^^^^^^^^^^^ @@ -59,7 +59,7 @@ LL | #[should_panic] 'a: 'static, = help: only `#[cfg]` and `#[cfg_attr]` are supported error: most attributes are not supported in `where` clauses - --> $DIR/unsupported_attribute.rs:20:5 + --> $DIR/unsupported_attribute.rs:21:5 | LL | #[macro_use] T: Trait, | ^^^^^^^^^^^^ @@ -67,7 +67,7 @@ LL | #[macro_use] T: Trait, = help: only `#[cfg]` and `#[cfg_attr]` are supported error: most attributes are not supported in `where` clauses - --> $DIR/unsupported_attribute.rs:21:5 + --> $DIR/unsupported_attribute.rs:22:5 | LL | #[macro_use] 'a: 'static, | ^^^^^^^^^^^^ @@ -75,7 +75,7 @@ LL | #[macro_use] 'a: 'static, = help: only `#[cfg]` and `#[cfg_attr]` are supported error: most attributes are not supported in `where` clauses - --> $DIR/unsupported_attribute.rs:22:5 + --> $DIR/unsupported_attribute.rs:23:5 | LL | #[allow(unused)] T: Trait, | ^^^^^^^^^^^^^^^^ @@ -83,7 +83,7 @@ LL | #[allow(unused)] T: Trait, = help: only `#[cfg]` and `#[cfg_attr]` are supported error: most attributes are not supported in `where` clauses - --> $DIR/unsupported_attribute.rs:23:5 + --> $DIR/unsupported_attribute.rs:24:5 | LL | #[allow(unused)] 'a: 'static, | ^^^^^^^^^^^^^^^^ @@ -91,7 +91,7 @@ LL | #[allow(unused)] 'a: 'static, = help: only `#[cfg]` and `#[cfg_attr]` are supported error: most attributes are not supported in `where` clauses - --> $DIR/unsupported_attribute.rs:24:5 + --> $DIR/unsupported_attribute.rs:25:5 | LL | #[deprecated] T: Trait, | ^^^^^^^^^^^^^ @@ -99,7 +99,7 @@ LL | #[deprecated] T: Trait, = help: only `#[cfg]` and `#[cfg_attr]` are supported error: most attributes are not supported in `where` clauses - --> $DIR/unsupported_attribute.rs:25:5 + --> $DIR/unsupported_attribute.rs:26:5 | LL | #[deprecated] 'a: 'static, | ^^^^^^^^^^^^^ @@ -107,7 +107,7 @@ LL | #[deprecated] 'a: 'static, = help: only `#[cfg]` and `#[cfg_attr]` are supported error: most attributes are not supported in `where` clauses - --> $DIR/unsupported_attribute.rs:26:5 + --> $DIR/unsupported_attribute.rs:27:5 | LL | #[automatically_derived] T: Trait, | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -115,7 +115,7 @@ LL | #[automatically_derived] T: Trait, = help: only `#[cfg]` and `#[cfg_attr]` are supported error: most attributes are not supported in `where` clauses - --> $DIR/unsupported_attribute.rs:27:5 + --> $DIR/unsupported_attribute.rs:28:5 | LL | #[automatically_derived] 'a: 'static, | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -123,7 +123,7 @@ LL | #[automatically_derived] 'a: 'static, = help: only `#[cfg]` and `#[cfg_attr]` are supported error: most attributes are not supported in `where` clauses - --> $DIR/unsupported_attribute.rs:28:5 + --> $DIR/unsupported_attribute.rs:29:5 | LL | #[derive(Clone)] T: Trait, | ^^^^^^^^^^^^^^^^ @@ -131,7 +131,7 @@ LL | #[derive(Clone)] T: Trait, = help: only `#[cfg]` and `#[cfg_attr]` are supported error: most attributes are not supported in `where` clauses - --> $DIR/unsupported_attribute.rs:31:5 + --> $DIR/unsupported_attribute.rs:32:5 | LL | #[derive(Clone)] 'a: 'static, | ^^^^^^^^^^^^^^^^ @@ -139,7 +139,7 @@ LL | #[derive(Clone)] 'a: 'static, = help: only `#[cfg]` and `#[cfg_attr]` are supported error: most attributes are not supported in `where` clauses - --> $DIR/unsupported_attribute.rs:34:5 + --> $DIR/unsupported_attribute.rs:35:5 | LL | #[rustfmt::skip] T: Trait, | ^^^^^^^^^^^^^^^^ @@ -147,12 +147,60 @@ LL | #[rustfmt::skip] T: Trait, = help: only `#[cfg]` and `#[cfg_attr]` are supported error: most attributes are not supported in `where` clauses - --> $DIR/unsupported_attribute.rs:35:5 + --> $DIR/unsupported_attribute.rs:36:5 | LL | #[rustfmt::skip] 'a: 'static, | ^^^^^^^^^^^^^^^^ | = help: only `#[cfg]` and `#[cfg_attr]` are supported -error: aborting due to 20 previous errors +error: most attributes are not supported in `where` clauses + --> $DIR/unsupported_attribute.rs:37:5 + | +LL | #[must_use] T: Trait, + | ^^^^^^^^^^^ + | + = help: only `#[cfg]` and `#[cfg_attr]` are supported + +error: most attributes are not supported in `where` clauses + --> $DIR/unsupported_attribute.rs:38:5 + | +LL | #[must_use] 'a: 'static, + | ^^^^^^^^^^^ + | + = help: only `#[cfg]` and `#[cfg_attr]` are supported + +error: most attributes are not supported in `where` clauses + --> $DIR/unsupported_attribute.rs:39:5 + | +LL | #[cold] T: Trait, + | ^^^^^^^ + | + = help: only `#[cfg]` and `#[cfg_attr]` are supported + +error: most attributes are not supported in `where` clauses + --> $DIR/unsupported_attribute.rs:40:5 + | +LL | #[cold] 'a: 'static, + | ^^^^^^^ + | + = help: only `#[cfg]` and `#[cfg_attr]` are supported + +error: most attributes are not supported in `where` clauses + --> $DIR/unsupported_attribute.rs:41:5 + | +LL | #[repr()] T: Trait, + | ^^^^^^^^^ + | + = help: only `#[cfg]` and `#[cfg_attr]` are supported + +error: most attributes are not supported in `where` clauses + --> $DIR/unsupported_attribute.rs:42:5 + | +LL | #[repr()] 'a: 'static, + | ^^^^^^^^^ + | + = help: only `#[cfg]` and `#[cfg_attr]` are supported + +error: aborting due to 26 previous errors