diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs index 22178dd2123e5..0924e0b72c088 100644 --- a/compiler/rustc_feature/src/active.rs +++ b/compiler/rustc_feature/src/active.rs @@ -479,8 +479,6 @@ declare_features! ( (incomplete, raw_dylib, "1.40.0", Some(58713), None), /// Allows `&raw const $place_expr` and `&raw mut $place_expr` expressions. (active, raw_ref_op, "1.41.0", Some(64490), None), - /// Allows using the `#[register_attr]` attribute. - (active, register_attr, "1.41.0", Some(66080), None), /// Allows using the `#[register_tool]` attribute. (active, register_tool, "1.41.0", Some(66079), None), /// Allows the `#[repr(i128)]` attribute for enums. diff --git a/compiler/rustc_feature/src/builtin_attrs.rs b/compiler/rustc_feature/src/builtin_attrs.rs index d520efed9b8b8..0487270b52a9a 100644 --- a/compiler/rustc_feature/src/builtin_attrs.rs +++ b/compiler/rustc_feature/src/builtin_attrs.rs @@ -458,10 +458,6 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ ), gated!(ffi_pure, Normal, template!(Word), WarnFollowing, experimental!(ffi_pure)), gated!(ffi_const, Normal, template!(Word), WarnFollowing, experimental!(ffi_const)), - gated!( - register_attr, CrateLevel, template!(List: "attr1, attr2, ..."), DuplicatesOk, - experimental!(register_attr), - ), gated!( register_tool, CrateLevel, template!(List: "tool1, tool2, ..."), DuplicatesOk, experimental!(register_tool), diff --git a/compiler/rustc_feature/src/removed.rs b/compiler/rustc_feature/src/removed.rs index 2ddaf9201098e..13f275bb6a0c9 100644 --- a/compiler/rustc_feature/src/removed.rs +++ b/compiler/rustc_feature/src/removed.rs @@ -163,6 +163,9 @@ declare_features! ( (removed, quad_precision_float, "1.0.0", None, None, None), (removed, quote, "1.33.0", Some(29601), None, None), (removed, reflect, "1.0.0", Some(27749), None, None), + /// Allows using the `#[register_attr]` attribute. + (removed, register_attr, "CURRENT_RUSTC_VERSION", Some(66080), None, + Some("removed in favor of `#![register_tool]`")), /// Allows using the macros: /// + `__diagnostic_used` /// + `__register_diagnostic` diff --git a/compiler/rustc_hir/src/def.rs b/compiler/rustc_hir/src/def.rs index be5b7eccbafb2..2d2648a8f35af 100644 --- a/compiler/rustc_hir/src/def.rs +++ b/compiler/rustc_hir/src/def.rs @@ -45,8 +45,6 @@ pub enum NonMacroAttrKind { /// Single-segment custom attribute registered by a derive macro /// but used before that derive macro was expanded (deprecated). DeriveHelperCompat, - /// Single-segment custom attribute registered with `#[register_attr]`. - Registered, } /// What kind of definition something is; e.g., `mod` vs `struct`. @@ -564,15 +562,11 @@ impl NonMacroAttrKind { NonMacroAttrKind::DeriveHelper | NonMacroAttrKind::DeriveHelperCompat => { "derive helper attribute" } - NonMacroAttrKind::Registered => "explicitly registered attribute", } } pub fn article(self) -> &'static str { - match self { - NonMacroAttrKind::Registered => "an", - _ => "a", - } + "a" } /// Users of some attributes cannot mark them as used, so they are considered always used. @@ -581,7 +575,7 @@ impl NonMacroAttrKind { NonMacroAttrKind::Tool | NonMacroAttrKind::DeriveHelper | NonMacroAttrKind::DeriveHelperCompat => true, - NonMacroAttrKind::Builtin(..) | NonMacroAttrKind::Registered => false, + NonMacroAttrKind::Builtin(..) => false, } } } diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs index 25013036d8749..2d15b1b0a1b94 100644 --- a/compiler/rustc_resolve/src/diagnostics.rs +++ b/compiler/rustc_resolve/src/diagnostics.rs @@ -1172,16 +1172,6 @@ impl<'a> Resolver<'a> { Scope::Module(module, _) => { this.add_module_candidates(module, &mut suggestions, filter_fn); } - Scope::RegisteredAttrs => { - let res = Res::NonMacroAttr(NonMacroAttrKind::Registered); - if filter_fn(res) { - suggestions.extend( - this.registered_attrs - .iter() - .map(|ident| TypoSuggestion::typo_from_res(ident.name, res)), - ); - } - } Scope::MacroUsePrelude => { suggestions.extend(this.macro_use_prelude.iter().filter_map( |(name, binding)| { diff --git a/compiler/rustc_resolve/src/ident.rs b/compiler/rustc_resolve/src/ident.rs index 41a0c76d83a95..307fdb9701f05 100644 --- a/compiler/rustc_resolve/src/ident.rs +++ b/compiler/rustc_resolve/src/ident.rs @@ -127,7 +127,6 @@ impl<'a> Resolver<'a> { } Scope::CrateRoot => true, Scope::Module(..) => true, - Scope::RegisteredAttrs => use_prelude, Scope::MacroUsePrelude => use_prelude || rust_2015, Scope::BuiltinAttrs => true, Scope::ExternPrelude => use_prelude || is_absolute_path, @@ -187,12 +186,11 @@ impl<'a> Resolver<'a> { match ns { TypeNS => Scope::ExternPrelude, ValueNS => Scope::StdLibPrelude, - MacroNS => Scope::RegisteredAttrs, + MacroNS => Scope::MacroUsePrelude, } } } } - Scope::RegisteredAttrs => Scope::MacroUsePrelude, Scope::MacroUsePrelude => Scope::StdLibPrelude, Scope::BuiltinAttrs => break, // nowhere else to search Scope::ExternPrelude if is_absolute_path => break, @@ -556,14 +554,6 @@ impl<'a> Resolver<'a> { Err((Determinacy::Determined, _)) => Err(Determinacy::Determined), } } - Scope::RegisteredAttrs => match this.registered_attrs.get(&ident).cloned() { - Some(ident) => ok( - Res::NonMacroAttr(NonMacroAttrKind::Registered), - ident.span, - this.arenas, - ), - None => Err(Determinacy::Determined), - }, Scope::MacroUsePrelude => { match this.macro_use_prelude.get(&ident.name).cloned() { Some(binding) => Ok((binding, Flags::MISC_FROM_PRELUDE)), diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index eb727debc91bb..f7351184422db 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -107,7 +107,6 @@ enum Scope<'a> { // The node ID is for reporting the `PROC_MACRO_DERIVE_RESOLUTION_FALLBACK` // lint if it should be reported. Module(Module<'a>, Option), - RegisteredAttrs, MacroUsePrelude, BuiltinAttrs, ExternPrelude, @@ -975,7 +974,6 @@ pub struct Resolver<'a> { /// A small map keeping true kinds of built-in macros that appear to be fn-like on /// the surface (`macro` items in libcore), but are actually attributes or derives. builtin_macro_kinds: FxHashMap, - registered_attrs: FxHashSet, registered_tools: RegisteredTools, macro_use_prelude: FxHashMap>, macro_map: FxHashMap, @@ -1252,8 +1250,7 @@ impl<'a> Resolver<'a> { } } - let (registered_attrs, registered_tools) = - macros::registered_attrs_and_tools(session, &krate.attrs); + let registered_tools = macros::registered_tools(session, &krate.attrs); let features = session.features_untracked(); @@ -1318,7 +1315,6 @@ impl<'a> Resolver<'a> { macro_names: FxHashSet::default(), builtin_macros: Default::default(), builtin_macro_kinds: Default::default(), - registered_attrs, registered_tools, macro_use_prelude: FxHashMap::default(), macro_map: FxHashMap::default(), diff --git a/compiler/rustc_resolve/src/macros.rs b/compiler/rustc_resolve/src/macros.rs index 070fb9c721b40..0c428aa6cc05c 100644 --- a/compiler/rustc_resolve/src/macros.rs +++ b/compiler/rustc_resolve/src/macros.rs @@ -112,47 +112,32 @@ fn fast_print_path(path: &ast::Path) -> Symbol { } } -/// The code common between processing `#![register_tool]` and `#![register_attr]`. -fn registered_idents( - sess: &Session, - attrs: &[ast::Attribute], - attr_name: Symbol, - descr: &str, -) -> FxHashSet { - let mut registered = FxHashSet::default(); - for attr in sess.filter_by_name(attrs, attr_name) { +pub(crate) fn registered_tools(sess: &Session, attrs: &[ast::Attribute]) -> FxHashSet { + let mut registered_tools = FxHashSet::default(); + for attr in sess.filter_by_name(attrs, sym::register_tool) { for nested_meta in attr.meta_item_list().unwrap_or_default() { match nested_meta.ident() { Some(ident) => { - if let Some(old_ident) = registered.replace(ident) { - let msg = format!("{} `{}` was already registered", descr, ident); + if let Some(old_ident) = registered_tools.replace(ident) { + let msg = format!("{} `{}` was already registered", "tool", ident); sess.struct_span_err(ident.span, &msg) .span_label(old_ident.span, "already registered here") .emit(); } } None => { - let msg = format!("`{}` only accepts identifiers", attr_name); + let msg = format!("`{}` only accepts identifiers", sym::register_tool); let span = nested_meta.span(); sess.struct_span_err(span, &msg).span_label(span, "not an identifier").emit(); } } } } - registered -} - -pub(crate) fn registered_attrs_and_tools( - sess: &Session, - attrs: &[ast::Attribute], -) -> (FxHashSet, FxHashSet) { - let registered_attrs = registered_idents(sess, attrs, sym::register_attr, "attribute"); - let mut registered_tools = registered_idents(sess, attrs, sym::register_tool, "tool"); // We implicitly add `rustfmt` and `clippy` to known tools, // but it's not an error to register them explicitly. let predefined_tools = [sym::clippy, sym::rustfmt]; registered_tools.extend(predefined_tools.iter().cloned().map(Ident::with_dummy_span)); - (registered_attrs, registered_tools) + registered_tools } // Some feature gates for inner attributes are reported as lints for backward compatibility. diff --git a/src/test/ui-fulldeps/issue-15778-pass.rs b/src/test/ui-fulldeps/issue-15778-pass.rs deleted file mode 100644 index c031dbc7155db..0000000000000 --- a/src/test/ui-fulldeps/issue-15778-pass.rs +++ /dev/null @@ -1,23 +0,0 @@ -// check-pass -// aux-build:lint-for-crate-rpass.rs -// ignore-stage1 -// compile-flags: -D crate-not-okay - -#![feature(plugin, register_attr, custom_inner_attributes)] - -#![register_attr( - crate_okay, - crate_blue, - crate_red, - crate_grey, - crate_green, -)] - -#![plugin(lint_for_crate_rpass)] //~ WARNING compiler plugins are deprecated -#![crate_okay] -#![crate_blue] -#![crate_red] -#![crate_grey] -#![crate_green] - -fn main() {} diff --git a/src/test/ui-fulldeps/issue-15778-pass.stderr b/src/test/ui-fulldeps/issue-15778-pass.stderr deleted file mode 100644 index a9d9721ac7b89..0000000000000 --- a/src/test/ui-fulldeps/issue-15778-pass.stderr +++ /dev/null @@ -1,10 +0,0 @@ -warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/issue-15778-pass.rs:16:1 - | -LL | #![plugin(lint_for_crate_rpass)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - -warning: 1 warning emitted - diff --git a/src/test/ui/attributes/register-attr-tool-fail.rs b/src/test/ui/attributes/register-attr-tool-fail.rs deleted file mode 100644 index 84736be844ba6..0000000000000 --- a/src/test/ui/attributes/register-attr-tool-fail.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![feature(register_attr)] -#![feature(register_tool)] - -#![register_attr] //~ ERROR malformed `register_attr` attribute input -#![register_tool] //~ ERROR malformed `register_tool` attribute input - -#![register_attr(a::b)] //~ ERROR `register_attr` only accepts identifiers -#![register_tool(a::b)] //~ ERROR `register_tool` only accepts identifiers - -#![register_attr(attr, attr)] //~ ERROR attribute `attr` was already registered -#![register_tool(tool, tool)] //~ ERROR tool `tool` was already registered - -fn main() {} diff --git a/src/test/ui/attributes/register-attr-tool-fail.stderr b/src/test/ui/attributes/register-attr-tool-fail.stderr deleted file mode 100644 index 8f6977cb55f25..0000000000000 --- a/src/test/ui/attributes/register-attr-tool-fail.stderr +++ /dev/null @@ -1,42 +0,0 @@ -error: `register_attr` only accepts identifiers - --> $DIR/register-attr-tool-fail.rs:7:18 - | -LL | #![register_attr(a::b)] - | ^^^^ not an identifier - -error: attribute `attr` was already registered - --> $DIR/register-attr-tool-fail.rs:10:24 - | -LL | #![register_attr(attr, attr)] - | ---- ^^^^ - | | - | already registered here - -error: `register_tool` only accepts identifiers - --> $DIR/register-attr-tool-fail.rs:8:18 - | -LL | #![register_tool(a::b)] - | ^^^^ not an identifier - -error: tool `tool` was already registered - --> $DIR/register-attr-tool-fail.rs:11:24 - | -LL | #![register_tool(tool, tool)] - | ---- ^^^^ - | | - | already registered here - -error: malformed `register_attr` attribute input - --> $DIR/register-attr-tool-fail.rs:4:1 - | -LL | #![register_attr] - | ^^^^^^^^^^^^^^^^^ help: must be of the form: `#![register_attr(attr1, attr2, ...)]` - -error: malformed `register_tool` attribute input - --> $DIR/register-attr-tool-fail.rs:5:1 - | -LL | #![register_tool] - | ^^^^^^^^^^^^^^^^^ help: must be of the form: `#![register_tool(tool1, tool2, ...)]` - -error: aborting due to 6 previous errors - diff --git a/src/test/ui/attributes/register-attr-tool-import.rs b/src/test/ui/attributes/register-attr-tool-import.rs deleted file mode 100644 index d3502c71f2d88..0000000000000 --- a/src/test/ui/attributes/register-attr-tool-import.rs +++ /dev/null @@ -1,17 +0,0 @@ -// edition:2018 -// compile-flags: -Zsave-analysis -// ~^ Also regression test for #69588 - -#![feature(register_attr)] -#![feature(register_tool)] - -#![register_attr(attr)] -#![register_tool(tool)] - -use attr as renamed_attr; // OK -use tool as renamed_tool; // OK - -#[renamed_attr] //~ ERROR cannot use an explicitly registered attribute through an import -#[renamed_tool::attr] //~ ERROR cannot use a tool module through an import - //~| ERROR cannot use a tool module through an import -fn main() {} diff --git a/src/test/ui/attributes/register-attr-tool-import.stderr b/src/test/ui/attributes/register-attr-tool-import.stderr deleted file mode 100644 index 90b7e169a2fb7..0000000000000 --- a/src/test/ui/attributes/register-attr-tool-import.stderr +++ /dev/null @@ -1,38 +0,0 @@ -error: cannot use an explicitly registered attribute through an import - --> $DIR/register-attr-tool-import.rs:14:3 - | -LL | #[renamed_attr] - | ^^^^^^^^^^^^ - | -note: the explicitly registered attribute imported here - --> $DIR/register-attr-tool-import.rs:11:5 - | -LL | use attr as renamed_attr; // OK - | ^^^^^^^^^^^^^^^^^^^^ - -error: cannot use a tool module through an import - --> $DIR/register-attr-tool-import.rs:15:3 - | -LL | #[renamed_tool::attr] - | ^^^^^^^^^^^^ - | -note: the tool module imported here - --> $DIR/register-attr-tool-import.rs:12:5 - | -LL | use tool as renamed_tool; // OK - | ^^^^^^^^^^^^^^^^^^^^ - -error: cannot use a tool module through an import - --> $DIR/register-attr-tool-import.rs:15:3 - | -LL | #[renamed_tool::attr] - | ^^^^^^^^^^^^ - | -note: the tool module imported here - --> $DIR/register-attr-tool-import.rs:12:5 - | -LL | use tool as renamed_tool; // OK - | ^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 3 previous errors - diff --git a/src/test/ui/attributes/register-attr-tool-prelude.rs b/src/test/ui/attributes/register-attr-tool-prelude.rs deleted file mode 100644 index d217a8146d2ac..0000000000000 --- a/src/test/ui/attributes/register-attr-tool-prelude.rs +++ /dev/null @@ -1,14 +0,0 @@ -#![feature(register_attr)] -#![feature(register_tool)] - -#![register_attr(attr)] -#![register_tool(tool)] - -#[no_implicit_prelude] -mod m { - #[attr] //~ ERROR cannot find attribute `attr` in this scope - #[tool::attr] //~ ERROR failed to resolve: use of undeclared crate or module `tool` - fn check() {} -} - -fn main() {} diff --git a/src/test/ui/attributes/register-attr-tool-prelude.stderr b/src/test/ui/attributes/register-attr-tool-prelude.stderr deleted file mode 100644 index 905b661206a6b..0000000000000 --- a/src/test/ui/attributes/register-attr-tool-prelude.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `tool` - --> $DIR/register-attr-tool-prelude.rs:10:7 - | -LL | #[tool::attr] - | ^^^^ use of undeclared crate or module `tool` - -error: cannot find attribute `attr` in this scope - --> $DIR/register-attr-tool-prelude.rs:9:7 - | -LL | #[attr] - | ^^^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/ui/attributes/register-attr-tool-unused.rs b/src/test/ui/attributes/register-attr-tool-unused.rs deleted file mode 100644 index 680614656538a..0000000000000 --- a/src/test/ui/attributes/register-attr-tool-unused.rs +++ /dev/null @@ -1,8 +0,0 @@ -#![deny(unused)] - -#![feature(register_attr)] -#![feature(register_tool)] - -#[register_attr(attr)] //~ ERROR crate-level attribute should be an inner attribute -#[register_tool(tool)] //~ ERROR crate-level attribute should be an inner attribute -fn main() {} diff --git a/src/test/ui/attributes/register-attr-tool-unused.stderr b/src/test/ui/attributes/register-attr-tool-unused.stderr deleted file mode 100644 index 8d2e1b6bc2894..0000000000000 --- a/src/test/ui/attributes/register-attr-tool-unused.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/register-attr-tool-unused.rs:6:1 - | -LL | #[register_attr(attr)] - | ^^^^^^^^^^^^^^^^^^^^^^ - | -note: the lint level is defined here - --> $DIR/register-attr-tool-unused.rs:1:9 - | -LL | #![deny(unused)] - | ^^^^^^ - = note: `#[deny(unused_attributes)]` implied by `#[deny(unused)]` - -error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/register-attr-tool-unused.rs:7:1 - | -LL | #[register_tool(tool)] - | ^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/attributes/register-attr-tool.rs b/src/test/ui/attributes/register-attr-tool.rs deleted file mode 100644 index ee9da74d4fb1c..0000000000000 --- a/src/test/ui/attributes/register-attr-tool.rs +++ /dev/null @@ -1,19 +0,0 @@ -// check-pass -// compile-flags: --cfg foo - -#![feature(register_attr)] -#![feature(register_tool)] - -#![register_attr(attr)] -#![register_tool(tool)] -#![register_tool(rustfmt, clippy)] // OK -#![cfg_attr(foo, register_attr(conditional_attr))] -#![cfg_attr(foo, register_tool(conditional_tool))] - -#[attr] -#[tool::attr] -#[rustfmt::attr] -#[clippy::attr] -#[conditional_attr] -#[conditional_tool::attr] -fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-register_attr.rs b/src/test/ui/feature-gates/feature-gate-register_attr.rs deleted file mode 100644 index 36dce2aa7b9e0..0000000000000 --- a/src/test/ui/feature-gates/feature-gate-register_attr.rs +++ /dev/null @@ -1,3 +0,0 @@ -#![register_attr(attr)] //~ ERROR the `#[register_attr]` attribute is an experimental feature - -fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-register_attr.stderr b/src/test/ui/feature-gates/feature-gate-register_attr.stderr deleted file mode 100644 index 8ca3845d28aa7..0000000000000 --- a/src/test/ui/feature-gates/feature-gate-register_attr.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0658]: the `#[register_attr]` attribute is an experimental feature - --> $DIR/feature-gate-register_attr.rs:1:1 - | -LL | #![register_attr(attr)] - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #66080 for more information - = help: add `#![feature(register_attr)]` to the crate attributes to enable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/proc-macro/expand-to-unstable-2.rs b/src/test/ui/proc-macro/expand-to-unstable-2.rs deleted file mode 100644 index 4160e5418b78a..0000000000000 --- a/src/test/ui/proc-macro/expand-to-unstable-2.rs +++ /dev/null @@ -1,17 +0,0 @@ -// aux-build:derive-unstable-2.rs - -#![feature(register_attr)] - -#![register_attr(rustc_foo)] - -#[macro_use] -extern crate derive_unstable_2; - -#[derive(Unstable)] -//~^ ERROR attributes starting with `rustc` are reserved for use by the `rustc` compiler - -struct A; - -fn main() { - foo(); -} diff --git a/src/test/ui/proc-macro/expand-to-unstable-2.stderr b/src/test/ui/proc-macro/expand-to-unstable-2.stderr deleted file mode 100644 index 8b16ffb76f26f..0000000000000 --- a/src/test/ui/proc-macro/expand-to-unstable-2.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: attributes starting with `rustc` are reserved for use by the `rustc` compiler - --> $DIR/expand-to-unstable-2.rs:10:10 - | -LL | #[derive(Unstable)] - | ^^^^^^^^ - | - = note: this error originates in the derive macro `Unstable` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to previous error - diff --git a/src/test/ui/proc-macro/inner-attrs.rs b/src/test/ui/proc-macro/inner-attrs.rs index 2e3c704da4392..1000c9c755ffc 100644 --- a/src/test/ui/proc-macro/inner-attrs.rs +++ b/src/test/ui/proc-macro/inner-attrs.rs @@ -1,3 +1,4 @@ +// gate-test-custom_inner_attributes // compile-flags: -Z span-debug --error-format human // aux-build:test-macros.rs // edition:2018 diff --git a/src/test/ui/proc-macro/inner-attrs.stderr b/src/test/ui/proc-macro/inner-attrs.stderr index 4da8751ef7fe9..a332e143a79f1 100644 --- a/src/test/ui/proc-macro/inner-attrs.stderr +++ b/src/test/ui/proc-macro/inner-attrs.stderr @@ -1,23 +1,23 @@ error: expected non-macro inner attribute, found attribute macro `print_attr` - --> $DIR/inner-attrs.rs:63:12 + --> $DIR/inner-attrs.rs:64:12 | LL | #![print_attr] | ^^^^^^^^^^ not a non-macro inner attribute error: expected non-macro inner attribute, found attribute macro `print_attr` - --> $DIR/inner-attrs.rs:67:12 + --> $DIR/inner-attrs.rs:68:12 | LL | #![print_attr] | ^^^^^^^^^^ not a non-macro inner attribute error: expected non-macro inner attribute, found attribute macro `print_attr` - --> $DIR/inner-attrs.rs:71:12 + --> $DIR/inner-attrs.rs:72:12 | LL | #![print_attr] | ^^^^^^^^^^ not a non-macro inner attribute error: expected non-macro inner attribute, found attribute macro `print_attr` - --> $DIR/inner-attrs.rs:75:12 + --> $DIR/inner-attrs.rs:76:12 | LL | #![print_attr] | ^^^^^^^^^^ not a non-macro inner attribute diff --git a/src/test/ui/proc-macro/inner-attrs.stdout b/src/test/ui/proc-macro/inner-attrs.stdout index eaa8882d6a6cb..490fc02f51037 100644 --- a/src/test/ui/proc-macro/inner-attrs.stdout +++ b/src/test/ui/proc-macro/inner-attrs.stdout @@ -2,7 +2,7 @@ PRINT-ATTR_ARGS INPUT (DISPLAY): first PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "first", - span: $DIR/inner-attrs.rs:16:25: 16:30 (#0), + span: $DIR/inner-attrs.rs:17:25: 17:30 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): #[print_target_and_args(second)] fn foo() @@ -11,40 +11,40 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Alone, - span: $DIR/inner-attrs.rs:17:1: 17:2 (#0), + span: $DIR/inner-attrs.rs:18:1: 18:2 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:17:3: 17:24 (#0), + span: $DIR/inner-attrs.rs:18:3: 18:24 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "second", - span: $DIR/inner-attrs.rs:17:25: 17:31 (#0), + span: $DIR/inner-attrs.rs:18:25: 18:31 (#0), }, ], - span: $DIR/inner-attrs.rs:17:24: 17:32 (#0), + span: $DIR/inner-attrs.rs:18:24: 18:32 (#0), }, ], - span: $DIR/inner-attrs.rs:17:2: 17:33 (#0), + span: $DIR/inner-attrs.rs:18:2: 18:33 (#0), }, Ident { ident: "fn", - span: $DIR/inner-attrs.rs:18:1: 18:3 (#0), + span: $DIR/inner-attrs.rs:19:1: 19:3 (#0), }, Ident { ident: "foo", - span: $DIR/inner-attrs.rs:18:4: 18:7 (#0), + span: $DIR/inner-attrs.rs:19:4: 19:7 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [], - span: $DIR/inner-attrs.rs:18:7: 18:9 (#0), + span: $DIR/inner-attrs.rs:19:7: 19:9 (#0), }, Group { delimiter: Brace, @@ -52,72 +52,72 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:19:5: 19:6 (#0), + span: $DIR/inner-attrs.rs:20:5: 20:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:19:6: 19:7 (#0), + span: $DIR/inner-attrs.rs:20:6: 20:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:19:8: 19:29 (#0), + span: $DIR/inner-attrs.rs:20:8: 20:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "third", - span: $DIR/inner-attrs.rs:19:30: 19:35 (#0), + span: $DIR/inner-attrs.rs:20:30: 20:35 (#0), }, ], - span: $DIR/inner-attrs.rs:19:29: 19:36 (#0), + span: $DIR/inner-attrs.rs:20:29: 20:36 (#0), }, ], - span: $DIR/inner-attrs.rs:19:7: 19:37 (#0), + span: $DIR/inner-attrs.rs:20:7: 20:37 (#0), }, Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:20:5: 20:6 (#0), + span: $DIR/inner-attrs.rs:21:5: 21:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:20:6: 20:7 (#0), + span: $DIR/inner-attrs.rs:21:6: 21:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:20:8: 20:29 (#0), + span: $DIR/inner-attrs.rs:21:8: 21:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "fourth", - span: $DIR/inner-attrs.rs:20:30: 20:36 (#0), + span: $DIR/inner-attrs.rs:21:30: 21:36 (#0), }, ], - span: $DIR/inner-attrs.rs:20:29: 20:37 (#0), + span: $DIR/inner-attrs.rs:21:29: 21:37 (#0), }, ], - span: $DIR/inner-attrs.rs:20:7: 20:38 (#0), + span: $DIR/inner-attrs.rs:21:7: 21:38 (#0), }, ], - span: $DIR/inner-attrs.rs:18:10: 21:2 (#0), + span: $DIR/inner-attrs.rs:19:10: 22:2 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): second PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "second", - span: $DIR/inner-attrs.rs:17:25: 17:31 (#0), + span: $DIR/inner-attrs.rs:18:25: 18:31 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): fn foo() @@ -125,16 +125,16 @@ PRINT-ATTR INPUT (DISPLAY): fn foo() PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "fn", - span: $DIR/inner-attrs.rs:18:1: 18:3 (#0), + span: $DIR/inner-attrs.rs:19:1: 19:3 (#0), }, Ident { ident: "foo", - span: $DIR/inner-attrs.rs:18:4: 18:7 (#0), + span: $DIR/inner-attrs.rs:19:4: 19:7 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [], - span: $DIR/inner-attrs.rs:18:7: 18:9 (#0), + span: $DIR/inner-attrs.rs:19:7: 19:9 (#0), }, Group { delimiter: Brace, @@ -142,88 +142,88 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:19:5: 19:6 (#0), + span: $DIR/inner-attrs.rs:20:5: 20:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:19:6: 19:7 (#0), + span: $DIR/inner-attrs.rs:20:6: 20:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:19:8: 19:29 (#0), + span: $DIR/inner-attrs.rs:20:8: 20:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "third", - span: $DIR/inner-attrs.rs:19:30: 19:35 (#0), + span: $DIR/inner-attrs.rs:20:30: 20:35 (#0), }, ], - span: $DIR/inner-attrs.rs:19:29: 19:36 (#0), + span: $DIR/inner-attrs.rs:20:29: 20:36 (#0), }, ], - span: $DIR/inner-attrs.rs:19:7: 19:37 (#0), + span: $DIR/inner-attrs.rs:20:7: 20:37 (#0), }, Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:20:5: 20:6 (#0), + span: $DIR/inner-attrs.rs:21:5: 21:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:20:6: 20:7 (#0), + span: $DIR/inner-attrs.rs:21:6: 21:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:20:8: 20:29 (#0), + span: $DIR/inner-attrs.rs:21:8: 21:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "fourth", - span: $DIR/inner-attrs.rs:20:30: 20:36 (#0), + span: $DIR/inner-attrs.rs:21:30: 21:36 (#0), }, ], - span: $DIR/inner-attrs.rs:20:29: 20:37 (#0), + span: $DIR/inner-attrs.rs:21:29: 21:37 (#0), }, ], - span: $DIR/inner-attrs.rs:20:7: 20:38 (#0), + span: $DIR/inner-attrs.rs:21:7: 21:38 (#0), }, ], - span: $DIR/inner-attrs.rs:18:10: 21:2 (#0), + span: $DIR/inner-attrs.rs:19:10: 22:2 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): third PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "third", - span: $DIR/inner-attrs.rs:19:30: 19:35 (#0), + span: $DIR/inner-attrs.rs:20:30: 20:35 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): fn foo() { #! [print_target_and_args(fourth)] } PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "fn", - span: $DIR/inner-attrs.rs:18:1: 18:3 (#0), + span: $DIR/inner-attrs.rs:19:1: 19:3 (#0), }, Ident { ident: "foo", - span: $DIR/inner-attrs.rs:18:4: 18:7 (#0), + span: $DIR/inner-attrs.rs:19:4: 19:7 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [], - span: $DIR/inner-attrs.rs:18:7: 18:9 (#0), + span: $DIR/inner-attrs.rs:19:7: 19:9 (#0), }, Group { delimiter: Brace, @@ -231,70 +231,70 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:20:5: 20:6 (#0), + span: $DIR/inner-attrs.rs:21:5: 21:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:20:6: 20:7 (#0), + span: $DIR/inner-attrs.rs:21:6: 21:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:20:8: 20:29 (#0), + span: $DIR/inner-attrs.rs:21:8: 21:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "fourth", - span: $DIR/inner-attrs.rs:20:30: 20:36 (#0), + span: $DIR/inner-attrs.rs:21:30: 21:36 (#0), }, ], - span: $DIR/inner-attrs.rs:20:29: 20:37 (#0), + span: $DIR/inner-attrs.rs:21:29: 21:37 (#0), }, ], - span: $DIR/inner-attrs.rs:20:7: 20:38 (#0), + span: $DIR/inner-attrs.rs:21:7: 21:38 (#0), }, ], - span: $DIR/inner-attrs.rs:18:10: 21:2 (#0), + span: $DIR/inner-attrs.rs:19:10: 22:2 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): fourth PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "fourth", - span: $DIR/inner-attrs.rs:20:30: 20:36 (#0), + span: $DIR/inner-attrs.rs:21:30: 21:36 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): fn foo() {} PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "fn", - span: $DIR/inner-attrs.rs:18:1: 18:3 (#0), + span: $DIR/inner-attrs.rs:19:1: 19:3 (#0), }, Ident { ident: "foo", - span: $DIR/inner-attrs.rs:18:4: 18:7 (#0), + span: $DIR/inner-attrs.rs:19:4: 19:7 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [], - span: $DIR/inner-attrs.rs:18:7: 18:9 (#0), + span: $DIR/inner-attrs.rs:19:7: 19:9 (#0), }, Group { delimiter: Brace, stream: TokenStream [], - span: $DIR/inner-attrs.rs:18:10: 21:2 (#0), + span: $DIR/inner-attrs.rs:19:10: 22:2 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): mod_first PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "mod_first", - span: $DIR/inner-attrs.rs:23:25: 23:34 (#0), + span: $DIR/inner-attrs.rs:24:25: 24:34 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): #[print_target_and_args(mod_second)] mod inline_mod @@ -306,35 +306,35 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Alone, - span: $DIR/inner-attrs.rs:24:1: 24:2 (#0), + span: $DIR/inner-attrs.rs:25:1: 25:2 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:24:3: 24:24 (#0), + span: $DIR/inner-attrs.rs:25:3: 25:24 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "mod_second", - span: $DIR/inner-attrs.rs:24:25: 24:35 (#0), + span: $DIR/inner-attrs.rs:25:25: 25:35 (#0), }, ], - span: $DIR/inner-attrs.rs:24:24: 24:36 (#0), + span: $DIR/inner-attrs.rs:25:24: 25:36 (#0), }, ], - span: $DIR/inner-attrs.rs:24:2: 24:37 (#0), + span: $DIR/inner-attrs.rs:25:2: 25:37 (#0), }, Ident { ident: "mod", - span: $DIR/inner-attrs.rs:25:1: 25:4 (#0), + span: $DIR/inner-attrs.rs:26:1: 26:4 (#0), }, Ident { ident: "inline_mod", - span: $DIR/inner-attrs.rs:25:5: 25:15 (#0), + span: $DIR/inner-attrs.rs:26:5: 26:15 (#0), }, Group { delimiter: Brace, @@ -342,72 +342,72 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:26:5: 26:6 (#0), + span: $DIR/inner-attrs.rs:27:5: 27:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:26:6: 26:7 (#0), + span: $DIR/inner-attrs.rs:27:6: 27:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:26:8: 26:29 (#0), + span: $DIR/inner-attrs.rs:27:8: 27:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "mod_third", - span: $DIR/inner-attrs.rs:26:30: 26:39 (#0), + span: $DIR/inner-attrs.rs:27:30: 27:39 (#0), }, ], - span: $DIR/inner-attrs.rs:26:29: 26:40 (#0), + span: $DIR/inner-attrs.rs:27:29: 27:40 (#0), }, ], - span: $DIR/inner-attrs.rs:26:7: 26:41 (#0), + span: $DIR/inner-attrs.rs:27:7: 27:41 (#0), }, Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:27:5: 27:6 (#0), + span: $DIR/inner-attrs.rs:28:5: 28:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:27:6: 27:7 (#0), + span: $DIR/inner-attrs.rs:28:6: 28:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:27:8: 27:29 (#0), + span: $DIR/inner-attrs.rs:28:8: 28:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "mod_fourth", - span: $DIR/inner-attrs.rs:27:30: 27:40 (#0), + span: $DIR/inner-attrs.rs:28:30: 28:40 (#0), }, ], - span: $DIR/inner-attrs.rs:27:29: 27:41 (#0), + span: $DIR/inner-attrs.rs:28:29: 28:41 (#0), }, ], - span: $DIR/inner-attrs.rs:27:7: 27:42 (#0), + span: $DIR/inner-attrs.rs:28:7: 28:42 (#0), }, ], - span: $DIR/inner-attrs.rs:25:16: 28:2 (#0), + span: $DIR/inner-attrs.rs:26:16: 29:2 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): mod_second PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "mod_second", - span: $DIR/inner-attrs.rs:24:25: 24:35 (#0), + span: $DIR/inner-attrs.rs:25:25: 25:35 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): mod inline_mod @@ -418,11 +418,11 @@ PRINT-ATTR INPUT (DISPLAY): mod inline_mod PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "mod", - span: $DIR/inner-attrs.rs:25:1: 25:4 (#0), + span: $DIR/inner-attrs.rs:26:1: 26:4 (#0), }, Ident { ident: "inline_mod", - span: $DIR/inner-attrs.rs:25:5: 25:15 (#0), + span: $DIR/inner-attrs.rs:26:5: 26:15 (#0), }, Group { delimiter: Brace, @@ -430,83 +430,83 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:26:5: 26:6 (#0), + span: $DIR/inner-attrs.rs:27:5: 27:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:26:6: 26:7 (#0), + span: $DIR/inner-attrs.rs:27:6: 27:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:26:8: 26:29 (#0), + span: $DIR/inner-attrs.rs:27:8: 27:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "mod_third", - span: $DIR/inner-attrs.rs:26:30: 26:39 (#0), + span: $DIR/inner-attrs.rs:27:30: 27:39 (#0), }, ], - span: $DIR/inner-attrs.rs:26:29: 26:40 (#0), + span: $DIR/inner-attrs.rs:27:29: 27:40 (#0), }, ], - span: $DIR/inner-attrs.rs:26:7: 26:41 (#0), + span: $DIR/inner-attrs.rs:27:7: 27:41 (#0), }, Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:27:5: 27:6 (#0), + span: $DIR/inner-attrs.rs:28:5: 28:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:27:6: 27:7 (#0), + span: $DIR/inner-attrs.rs:28:6: 28:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:27:8: 27:29 (#0), + span: $DIR/inner-attrs.rs:28:8: 28:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "mod_fourth", - span: $DIR/inner-attrs.rs:27:30: 27:40 (#0), + span: $DIR/inner-attrs.rs:28:30: 28:40 (#0), }, ], - span: $DIR/inner-attrs.rs:27:29: 27:41 (#0), + span: $DIR/inner-attrs.rs:28:29: 28:41 (#0), }, ], - span: $DIR/inner-attrs.rs:27:7: 27:42 (#0), + span: $DIR/inner-attrs.rs:28:7: 28:42 (#0), }, ], - span: $DIR/inner-attrs.rs:25:16: 28:2 (#0), + span: $DIR/inner-attrs.rs:26:16: 29:2 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): mod_third PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "mod_third", - span: $DIR/inner-attrs.rs:26:30: 26:39 (#0), + span: $DIR/inner-attrs.rs:27:30: 27:39 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): mod inline_mod { #! [print_target_and_args(mod_fourth)] } PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "mod", - span: $DIR/inner-attrs.rs:25:1: 25:4 (#0), + span: $DIR/inner-attrs.rs:26:1: 26:4 (#0), }, Ident { ident: "inline_mod", - span: $DIR/inner-attrs.rs:25:5: 25:15 (#0), + span: $DIR/inner-attrs.rs:26:5: 26:15 (#0), }, Group { delimiter: Brace, @@ -514,58 +514,58 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:27:5: 27:6 (#0), + span: $DIR/inner-attrs.rs:28:5: 28:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:27:6: 27:7 (#0), + span: $DIR/inner-attrs.rs:28:6: 28:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:27:8: 27:29 (#0), + span: $DIR/inner-attrs.rs:28:8: 28:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "mod_fourth", - span: $DIR/inner-attrs.rs:27:30: 27:40 (#0), + span: $DIR/inner-attrs.rs:28:30: 28:40 (#0), }, ], - span: $DIR/inner-attrs.rs:27:29: 27:41 (#0), + span: $DIR/inner-attrs.rs:28:29: 28:41 (#0), }, ], - span: $DIR/inner-attrs.rs:27:7: 27:42 (#0), + span: $DIR/inner-attrs.rs:28:7: 28:42 (#0), }, ], - span: $DIR/inner-attrs.rs:25:16: 28:2 (#0), + span: $DIR/inner-attrs.rs:26:16: 29:2 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): mod_fourth PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "mod_fourth", - span: $DIR/inner-attrs.rs:27:30: 27:40 (#0), + span: $DIR/inner-attrs.rs:28:30: 28:40 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): mod inline_mod {} PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "mod", - span: $DIR/inner-attrs.rs:25:1: 25:4 (#0), + span: $DIR/inner-attrs.rs:26:1: 26:4 (#0), }, Ident { ident: "inline_mod", - span: $DIR/inner-attrs.rs:25:5: 25:15 (#0), + span: $DIR/inner-attrs.rs:26:5: 26:15 (#0), }, Group { delimiter: Brace, stream: TokenStream [], - span: $DIR/inner-attrs.rs:25:16: 28:2 (#0), + span: $DIR/inner-attrs.rs:26:16: 29:2 (#0), }, ] PRINT-DERIVE INPUT (DISPLAY): struct MyDerivePrint @@ -576,63 +576,63 @@ PRINT-DERIVE INPUT (DISPLAY): struct MyDerivePrint PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { ident: "struct", - span: $DIR/inner-attrs.rs:35:1: 35:7 (#0), + span: $DIR/inner-attrs.rs:36:1: 36:7 (#0), }, Ident { ident: "MyDerivePrint", - span: $DIR/inner-attrs.rs:35:8: 35:21 (#0), + span: $DIR/inner-attrs.rs:36:8: 36:21 (#0), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "field", - span: $DIR/inner-attrs.rs:36:5: 36:10 (#0), + span: $DIR/inner-attrs.rs:37:5: 37:10 (#0), }, Punct { ch: ':', spacing: Alone, - span: $DIR/inner-attrs.rs:36:10: 36:11 (#0), + span: $DIR/inner-attrs.rs:37:10: 37:11 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "u8", - span: $DIR/inner-attrs.rs:36:13: 36:15 (#0), + span: $DIR/inner-attrs.rs:37:13: 37:15 (#0), }, Punct { ch: ';', spacing: Alone, - span: $DIR/inner-attrs.rs:36:15: 36:16 (#0), + span: $DIR/inner-attrs.rs:37:15: 37:16 (#0), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "match", - span: $DIR/inner-attrs.rs:37:9: 37:14 (#0), + span: $DIR/inner-attrs.rs:38:9: 38:14 (#0), }, Ident { ident: "true", - span: $DIR/inner-attrs.rs:37:15: 37:19 (#0), + span: $DIR/inner-attrs.rs:38:15: 38:19 (#0), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "_", - span: $DIR/inner-attrs.rs:38:13: 38:14 (#0), + span: $DIR/inner-attrs.rs:39:13: 39:14 (#0), }, Punct { ch: '=', spacing: Joint, - span: $DIR/inner-attrs.rs:38:15: 38:17 (#0), + span: $DIR/inner-attrs.rs:39:15: 39:17 (#0), }, Punct { ch: '>', spacing: Alone, - span: $DIR/inner-attrs.rs:38:15: 38:17 (#0), + span: $DIR/inner-attrs.rs:39:15: 39:17 (#0), }, Group { delimiter: Brace, @@ -640,69 +640,69 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Alone, - span: $DIR/inner-attrs.rs:39:17: 39:18 (#0), + span: $DIR/inner-attrs.rs:40:17: 40:18 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:39:18: 39:19 (#0), + span: $DIR/inner-attrs.rs:40:18: 40:19 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "rustc_dummy", - span: $DIR/inner-attrs.rs:39:41: 39:52 (#0), + span: $DIR/inner-attrs.rs:40:41: 40:52 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "third", - span: $DIR/inner-attrs.rs:39:53: 39:58 (#0), + span: $DIR/inner-attrs.rs:40:53: 40:58 (#0), }, ], - span: $DIR/inner-attrs.rs:39:52: 39:59 (#0), + span: $DIR/inner-attrs.rs:40:52: 40:59 (#0), }, ], - span: $DIR/inner-attrs.rs:39:17: 39:18 (#0), + span: $DIR/inner-attrs.rs:40:17: 40:18 (#0), }, Ident { ident: "true", - span: $DIR/inner-attrs.rs:40:17: 40:21 (#0), + span: $DIR/inner-attrs.rs:41:17: 41:21 (#0), }, ], - span: $DIR/inner-attrs.rs:38:18: 41:14 (#0), + span: $DIR/inner-attrs.rs:39:18: 42:14 (#0), }, ], - span: $DIR/inner-attrs.rs:37:20: 42:10 (#0), + span: $DIR/inner-attrs.rs:38:20: 43:10 (#0), }, Punct { ch: ';', spacing: Alone, - span: $DIR/inner-attrs.rs:42:10: 42:11 (#0), + span: $DIR/inner-attrs.rs:43:10: 43:11 (#0), }, Literal { kind: Integer, symbol: "0", suffix: None, - span: $DIR/inner-attrs.rs:43:9: 43:10 (#0), + span: $DIR/inner-attrs.rs:44:9: 44:10 (#0), }, ], - span: $DIR/inner-attrs.rs:36:17: 44:6 (#0), + span: $DIR/inner-attrs.rs:37:17: 45:6 (#0), }, ], - span: $DIR/inner-attrs.rs:36:12: 44:7 (#0), + span: $DIR/inner-attrs.rs:37:12: 45:7 (#0), }, ], - span: $DIR/inner-attrs.rs:35:22: 45:2 (#0), + span: $DIR/inner-attrs.rs:36:22: 46:2 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): tuple_attrs PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "tuple_attrs", - span: $DIR/inner-attrs.rs:48:29: 48:40 (#0), + span: $DIR/inner-attrs.rs:49:29: 49:40 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): (3, 4, { #! [cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 }) ; @@ -714,23 +714,23 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ kind: Integer, symbol: "3", suffix: None, - span: $DIR/inner-attrs.rs:49:9: 49:10 (#0), + span: $DIR/inner-attrs.rs:50:9: 50:10 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/inner-attrs.rs:49:10: 49:11 (#0), + span: $DIR/inner-attrs.rs:50:10: 50:11 (#0), }, Literal { kind: Integer, symbol: "4", suffix: None, - span: $DIR/inner-attrs.rs:49:12: 49:13 (#0), + span: $DIR/inner-attrs.rs:50:12: 50:13 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/inner-attrs.rs:49:13: 49:14 (#0), + span: $DIR/inner-attrs.rs:50:13: 50:14 (#0), }, Group { delimiter: Brace, @@ -738,85 +738,85 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:50:13: 50:14 (#0), + span: $DIR/inner-attrs.rs:51:13: 51:14 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:50:14: 50:15 (#0), + span: $DIR/inner-attrs.rs:51:14: 51:15 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg_attr", - span: $DIR/inner-attrs.rs:50:16: 50:24 (#0), + span: $DIR/inner-attrs.rs:51:16: 51:24 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "not", - span: $DIR/inner-attrs.rs:50:25: 50:28 (#0), + span: $DIR/inner-attrs.rs:51:25: 51:28 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/inner-attrs.rs:50:29: 50:34 (#0), + span: $DIR/inner-attrs.rs:51:29: 51:34 (#0), }, ], - span: $DIR/inner-attrs.rs:50:28: 50:35 (#0), + span: $DIR/inner-attrs.rs:51:28: 51:35 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/inner-attrs.rs:50:35: 50:36 (#0), + span: $DIR/inner-attrs.rs:51:35: 51:36 (#0), }, Ident { ident: "rustc_dummy", - span: $DIR/inner-attrs.rs:50:37: 50:48 (#0), + span: $DIR/inner-attrs.rs:51:37: 51:48 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "innermost", - span: $DIR/inner-attrs.rs:50:49: 50:58 (#0), + span: $DIR/inner-attrs.rs:51:49: 51:58 (#0), }, ], - span: $DIR/inner-attrs.rs:50:48: 50:59 (#0), + span: $DIR/inner-attrs.rs:51:48: 51:59 (#0), }, ], - span: $DIR/inner-attrs.rs:50:24: 50:60 (#0), + span: $DIR/inner-attrs.rs:51:24: 51:60 (#0), }, ], - span: $DIR/inner-attrs.rs:50:15: 50:61 (#0), + span: $DIR/inner-attrs.rs:51:15: 51:61 (#0), }, Literal { kind: Integer, symbol: "5", suffix: None, - span: $DIR/inner-attrs.rs:51:13: 51:14 (#0), + span: $DIR/inner-attrs.rs:52:13: 52:14 (#0), }, ], - span: $DIR/inner-attrs.rs:49:15: 52:10 (#0), + span: $DIR/inner-attrs.rs:50:15: 53:10 (#0), }, ], - span: $DIR/inner-attrs.rs:48:43: 53:6 (#0), + span: $DIR/inner-attrs.rs:49:43: 54:6 (#0), }, Punct { ch: ';', spacing: Alone, - span: $DIR/inner-attrs.rs:53:6: 53:7 (#0), + span: $DIR/inner-attrs.rs:54:6: 54:7 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): tuple_attrs PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "tuple_attrs", - span: $DIR/inner-attrs.rs:55:29: 55:40 (#0), + span: $DIR/inner-attrs.rs:56:29: 56:40 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): (3, 4, { #! [cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 }) ; @@ -828,23 +828,23 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ kind: Integer, symbol: "3", suffix: None, - span: $DIR/inner-attrs.rs:56:9: 56:10 (#0), + span: $DIR/inner-attrs.rs:57:9: 57:10 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/inner-attrs.rs:56:10: 56:11 (#0), + span: $DIR/inner-attrs.rs:57:10: 57:11 (#0), }, Literal { kind: Integer, symbol: "4", suffix: None, - span: $DIR/inner-attrs.rs:56:12: 56:13 (#0), + span: $DIR/inner-attrs.rs:57:12: 57:13 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/inner-attrs.rs:56:13: 56:14 (#0), + span: $DIR/inner-attrs.rs:57:13: 57:14 (#0), }, Group { delimiter: Brace, @@ -852,105 +852,105 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:57:13: 57:14 (#0), + span: $DIR/inner-attrs.rs:58:13: 58:14 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:57:14: 57:15 (#0), + span: $DIR/inner-attrs.rs:58:14: 58:15 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg_attr", - span: $DIR/inner-attrs.rs:57:16: 57:24 (#0), + span: $DIR/inner-attrs.rs:58:16: 58:24 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "not", - span: $DIR/inner-attrs.rs:57:25: 57:28 (#0), + span: $DIR/inner-attrs.rs:58:25: 58:28 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/inner-attrs.rs:57:29: 57:34 (#0), + span: $DIR/inner-attrs.rs:58:29: 58:34 (#0), }, ], - span: $DIR/inner-attrs.rs:57:28: 57:35 (#0), + span: $DIR/inner-attrs.rs:58:28: 58:35 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/inner-attrs.rs:57:35: 57:36 (#0), + span: $DIR/inner-attrs.rs:58:35: 58:36 (#0), }, Ident { ident: "rustc_dummy", - span: $DIR/inner-attrs.rs:57:37: 57:48 (#0), + span: $DIR/inner-attrs.rs:58:37: 58:48 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "innermost", - span: $DIR/inner-attrs.rs:57:49: 57:58 (#0), + span: $DIR/inner-attrs.rs:58:49: 58:58 (#0), }, ], - span: $DIR/inner-attrs.rs:57:48: 57:59 (#0), + span: $DIR/inner-attrs.rs:58:48: 58:59 (#0), }, ], - span: $DIR/inner-attrs.rs:57:24: 57:60 (#0), + span: $DIR/inner-attrs.rs:58:24: 58:60 (#0), }, ], - span: $DIR/inner-attrs.rs:57:15: 57:61 (#0), + span: $DIR/inner-attrs.rs:58:15: 58:61 (#0), }, Literal { kind: Integer, symbol: "5", suffix: None, - span: $DIR/inner-attrs.rs:58:13: 58:14 (#0), + span: $DIR/inner-attrs.rs:59:13: 59:14 (#0), }, ], - span: $DIR/inner-attrs.rs:56:15: 59:10 (#0), + span: $DIR/inner-attrs.rs:57:15: 60:10 (#0), }, ], - span: $DIR/inner-attrs.rs:55:43: 60:6 (#0), + span: $DIR/inner-attrs.rs:56:43: 61:6 (#0), }, Punct { ch: ';', spacing: Alone, - span: $DIR/inner-attrs.rs:60:6: 60:7 (#0), + span: $DIR/inner-attrs.rs:61:6: 61:7 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): tenth PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "tenth", - span: $DIR/inner-attrs.rs:82:42: 82:47 (#0), + span: $DIR/inner-attrs.rs:83:42: 83:47 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): fn weird_extern() {} PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "fn", - span: $DIR/inner-attrs.rs:81:5: 81:7 (#0), + span: $DIR/inner-attrs.rs:82:5: 82:7 (#0), }, Ident { ident: "weird_extern", - span: $DIR/inner-attrs.rs:81:8: 81:20 (#0), + span: $DIR/inner-attrs.rs:82:8: 82:20 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [], - span: $DIR/inner-attrs.rs:81:20: 81:22 (#0), + span: $DIR/inner-attrs.rs:82:20: 82:22 (#0), }, Group { delimiter: Brace, stream: TokenStream [], - span: $DIR/inner-attrs.rs:81:23: 83:6 (#0), + span: $DIR/inner-attrs.rs:82:23: 84:6 (#0), }, ] diff --git a/src/test/ui/proc-macro/issue-41211.rs b/src/test/ui/proc-macro/issue-41211.rs deleted file mode 100644 index 072a63baf3a47..0000000000000 --- a/src/test/ui/proc-macro/issue-41211.rs +++ /dev/null @@ -1,16 +0,0 @@ -// aux-build:test-macros.rs - -// FIXME: https://github.com/rust-lang/rust/issues/41430 -// This is a temporary regression test for the ICE reported in #41211 - -#![feature(custom_inner_attributes)] -#![feature(register_attr)] - -#![register_attr(identity_attr)] - -#![identity_attr] -//~^ ERROR `identity_attr` is ambiguous -extern crate test_macros; -use test_macros::identity_attr; - -fn main() {} diff --git a/src/test/ui/proc-macro/issue-41211.stderr b/src/test/ui/proc-macro/issue-41211.stderr deleted file mode 100644 index 60cd36a9cceb9..0000000000000 --- a/src/test/ui/proc-macro/issue-41211.stderr +++ /dev/null @@ -1,22 +0,0 @@ -error[E0659]: `identity_attr` is ambiguous - --> $DIR/issue-41211.rs:11:4 - | -LL | #![identity_attr] - | ^^^^^^^^^^^^^ ambiguous name - | - = note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution -note: `identity_attr` could refer to the attribute macro imported here - --> $DIR/issue-41211.rs:14:5 - | -LL | use test_macros::identity_attr; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - = help: use `crate::identity_attr` to refer to this attribute macro unambiguously -note: `identity_attr` could also refer to the explicitly registered attribute defined here - --> $DIR/issue-41211.rs:9:18 - | -LL | #![register_attr(identity_attr)] - | ^^^^^^^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0659`. diff --git a/src/test/ui/span/issue-36530.rs b/src/test/ui/span/issue-36530.rs deleted file mode 100644 index 70e04bf7ee6e8..0000000000000 --- a/src/test/ui/span/issue-36530.rs +++ /dev/null @@ -1,12 +0,0 @@ -// gate-test-custom_inner_attributes - -#![feature(register_attr)] - -#![register_attr(foo)] - -#[foo] -mod foo { - #![foo] //~ ERROR custom inner attributes are unstable -} - -fn main() {} diff --git a/src/test/ui/span/issue-36530.stderr b/src/test/ui/span/issue-36530.stderr deleted file mode 100644 index a998d7217a13f..0000000000000 --- a/src/test/ui/span/issue-36530.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0658]: custom inner attributes are unstable - --> $DIR/issue-36530.rs:9:8 - | -LL | #![foo] - | ^^^ - | - = note: see issue #54726 for more information - = help: add `#![feature(custom_inner_attributes)]` to the crate attributes to enable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0658`.