diff --git a/compiler/rustc_attr_parsing/src/attributes/path.rs b/compiler/rustc_attr_parsing/src/attributes/path.rs index 57114d850dba8..f8f08cd75b0c9 100644 --- a/compiler/rustc_attr_parsing/src/attributes/path.rs +++ b/compiler/rustc_attr_parsing/src/attributes/path.rs @@ -19,6 +19,6 @@ impl SingleAttributeParser for PathParser { let nv = cx.expect_name_value(args, cx.attr_span, None)?; let path = cx.expect_string_literal(nv)?; - Some(AttributeKind::Path(path)) + Some(AttributeKind::Path(path, cx.attr_style)) } } diff --git a/compiler/rustc_hir/src/attrs/data_structures.rs b/compiler/rustc_hir/src/attrs/data_structures.rs index bf9f0709bbdc4..ce6a927fce228 100644 --- a/compiler/rustc_hir/src/attrs/data_structures.rs +++ b/compiler/rustc_hir/src/attrs/data_structures.rs @@ -1210,7 +1210,7 @@ pub enum AttributeKind { }, /// Represents `#[path]` - Path(Symbol), + Path(Symbol, AttrStyle), /// Represents `#[pattern_complexity_limit]` PatternComplexityLimit { diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index cb2e1494b9cc0..b37f184ded4f3 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -305,7 +305,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> { AttributeKind::Optimize(..) => (), AttributeKind::PanicRuntime => (), AttributeKind::PatchableFunctionEntry { .. } => (), - AttributeKind::Path(..) => (), + AttributeKind::Path(_, style) => self.check_path_attribute(*style, hir_id, span), AttributeKind::PatternComplexityLimit { .. } => (), AttributeKind::PinV2(..) => (), AttributeKind::PreludeImport => (), @@ -942,7 +942,45 @@ impl<'tcx> CheckAttrVisitor<'tcx> { } } } + fn check_path_attribute(&self, style: AttrStyle, hir_id: HirId, span: Span) { + let mod_span = self.tcx.hir_span(hir_id); + if mod_span.from_expansion() { + return; + } + + let hir::Node::Item(item) = self.tcx.hir_node(hir_id) else { + return; + }; + + let ItemKind::Mod(_, module) = &item.kind else { + return; + }; + let is_outer_attr = matches!(style, ast::AttrStyle::Outer); + let is_inner_attr = matches!(style, ast::AttrStyle::Inner); + + let is_inline = |item_span: Span, inner_span: Span| -> bool { + self.tcx.sess.source_map().lookup_char_pos(item_span.lo()).file.name + == self.tcx.sess.source_map().lookup_char_pos(inner_span.lo()).file.name + }; + + let is_inline_module = is_inline(span, module.spans.inner_span); + + let has_nested_external_modules = module.item_ids.iter().any(|item_id| { + let nested_item = self.tcx.hir_item(*item_id); + if let ItemKind::Mod(_, nested_mod) = &nested_item.kind { + let nested_item_span = self.tcx.hir_span(nested_item.hir_id()); + return !is_inline(nested_item_span, nested_mod.spans.inner_span); + } + false + }); + + if is_outer_attr && is_inline_module && !has_nested_external_modules { + self.dcx().emit_err(errors::UselessPathAttribute { span }); + } else if is_inner_attr && !has_nested_external_modules { + self.dcx().emit_err(errors::UselessInnerPathAttribute { span }); + } + } /// Checks `#[doc(inline)]`/`#[doc(no_inline)]` attributes. /// /// A doc inlining attribute is invalid if it is applied to a non-`use` item, or diff --git a/compiler/rustc_passes/src/diagnostics.rs b/compiler/rustc_passes/src/diagnostics.rs index 7c00d9d2e1bcb..500ac98d37d89 100644 --- a/compiler/rustc_passes/src/diagnostics.rs +++ b/compiler/rustc_passes/src/diagnostics.rs @@ -13,6 +13,19 @@ use rustc_span::{DUMMY_SP, Ident, Span, Symbol}; use crate::check_attr::ProcMacroKind; use crate::lang_items::Duplicate; +#[derive(Diagnostic)] +#[diag("attribute `#[path]` is useless on inline modules")] +pub(crate) struct UselessPathAttribute { + #[primary_span] + pub span: Span, +} +#[derive(Diagnostic)] +#[diag("attribute `#[path]` is useless here as there are no nested external modules")] +pub(crate) struct UselessInnerPathAttribute { + #[primary_span] + pub span: Span, +} + #[derive(Diagnostic)] #[diag("`#[loop_match]` should be applied to a loop")] pub(crate) struct LoopMatchAttr { diff --git a/tests/ui/attributes/path-inline-module.rs b/tests/ui/attributes/path-inline-module.rs new file mode 100644 index 0000000000000..555821f8ae7c6 --- /dev/null +++ b/tests/ui/attributes/path-inline-module.rs @@ -0,0 +1,24 @@ +// ERROR: #[path] on inline module with NO external submodules +#[path = "foo.rs"] +mod inline_module {} //~ ERROR attribute `#[path]` is useless on inline modules + +// ERROR: #[path] on inline module with only inline submodules +#[path = "foo.rs"] +mod inline_with_inline_sub { //~ ERROR attribute `#[path]` is useless on inline modules + mod inner {} // inline, not external +} + +// ERROR: #![path] inside module with no external submodules +mod useless_inner { //~ ERROR attribute `#[path]` is useless here as there are no nested external modules + #![path = "some_dir"] + // no external submodules +} + +// ERROR: #![path] inside module where submodule is inline (has body) +mod thread_inline_sub { //~ ERROR attribute `#[path]` is useless here as there are no nested external modules + #![path = "thread_files"] + #[path = "tls.rs"] + mod local_data {} //~ ERROR attribute `#[path]` is useless on inline modules +} + +fn main() {} diff --git a/tests/ui/attributes/path-inline-module.stderr b/tests/ui/attributes/path-inline-module.stderr new file mode 100644 index 0000000000000..00daee1ab7284 --- /dev/null +++ b/tests/ui/attributes/path-inline-module.stderr @@ -0,0 +1,41 @@ +error: attribute `#[path]` is useless on inline modules + --> $DIR/path-inline-module.rs:3:1 + | +LL | mod inline_module {} + | ^^^^^^^^^^^^^^^^^^^^ + +error: attribute `#[path]` is useless on inline modules + --> $DIR/path-inline-module.rs:7:1 + | +LL | / mod inline_with_inline_sub { +LL | | mod inner {} // inline, not external +LL | | } + | |_^ + +error: attribute `#[path]` is useless here as there are no nested external modules + --> $DIR/path-inline-module.rs:12:1 + | +LL | / mod useless_inner { +LL | | #![path = "some_dir"] +LL | | // no external submodules +LL | | } + | |_^ + +error: attribute `#[path]` is useless here as there are no nested external modules + --> $DIR/path-inline-module.rs:18:1 + | +LL | / mod thread_inline_sub { +LL | | #![path = "thread_files"] +LL | | #[path = "tls.rs"] +LL | | mod local_data {} +LL | | } + | |_^ + +error: attribute `#[path]` is useless on inline modules + --> $DIR/path-inline-module.rs:21:5 + | +LL | mod local_data {} + | ^^^^^^^^^^^^^^^^^ + +error: aborting due to 5 previous errors + diff --git a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs index 180e44d365add..91ffd6e8c8e06 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs +++ b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs @@ -252,34 +252,6 @@ mod macro_export { //~| HELP remove the attribute } -#[path = "3800"] -mod path { - mod inner { #![path="3800"] } - - #[path = "3800"] fn f() { } - //~^ WARN attribute cannot be used on -//~| WARN previously accepted - //~| HELP can only be applied to - //~| HELP remove the attribute - - #[path = "3800"] struct S; - //~^ WARN attribute cannot be used on -//~| WARN previously accepted - //~| HELP can only be applied to - //~| HELP remove the attribute - - #[path = "3800"] type T = S; - //~^ WARN attribute cannot be used on -//~| WARN previously accepted - //~| HELP can only be applied to - //~| HELP remove the attribute - - #[path = "3800"] impl S { } - //~^ WARN attribute cannot be used on -//~| WARN previously accepted - //~| HELP can only be applied to - //~| HELP remove the attribute -} #[automatically_derived] //~^ WARN attribute cannot be used on diff --git a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr index cce32865cd22f..870c60326e173 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr +++ b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr @@ -1,5 +1,5 @@ warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:475:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:447:17 | LL | mod inner { #![macro_escape] } | ^^^^^^^^^^^^^^^^ @@ -7,7 +7,7 @@ LL | mod inner { #![macro_escape] } = help: try an outer attribute: `#[macro_use]` warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:472:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:444:1 | LL | #[macro_escape] | ^^^^^^^^^^^^^^^ @@ -195,7 +195,7 @@ LL | #![feature(rust1)] = note: `#[warn(stable_features)]` on by default warning: attribute should be applied to an `extern` block with non-Rust ABI - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:725:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:697:5 | LL | #[link(name = "x")] extern "Rust" {} | ^^^^^^^^^^^^^^^^^^^ @@ -297,44 +297,8 @@ LL | #[macro_export] impl S { } = help: `#[macro_export]` can only be applied to macro defs = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[path]` attribute cannot be used on functions - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:259:5 - | -LL | #[path = "3800"] fn f() { } - | ^^^^^^^^^^^^^^^^ - | - = help: `#[path]` can only be applied to modules - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - -warning: `#[path]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:265:5 - | -LL | #[path = "3800"] struct S; - | ^^^^^^^^^^^^^^^^ - | - = help: `#[path]` can only be applied to modules - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - -warning: `#[path]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:271:5 - | -LL | #[path = "3800"] type T = S; - | ^^^^^^^^^^^^^^^^ - | - = help: `#[path]` can only be applied to modules - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - -warning: `#[path]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:277:5 - | -LL | #[path = "3800"] impl S { } - | ^^^^^^^^^^^^^^^^ - | - = help: `#[path]` can only be applied to modules - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - warning: `#[automatically_derived]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:284:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:256:1 | LL | #[automatically_derived] | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -343,7 +307,7 @@ LL | #[automatically_derived] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[automatically_derived]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:290:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:262:17 | LL | mod inner { #![automatically_derived] } | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -352,7 +316,7 @@ LL | mod inner { #![automatically_derived] } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[automatically_derived]` attribute cannot be used on functions - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:296:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:268:5 | LL | #[automatically_derived] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -361,7 +325,7 @@ LL | #[automatically_derived] fn f() { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[automatically_derived]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:302:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:274:5 | LL | #[automatically_derived] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -370,7 +334,7 @@ LL | #[automatically_derived] struct S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[automatically_derived]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:308:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:280:5 | LL | #[automatically_derived] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -379,7 +343,7 @@ LL | #[automatically_derived] type T = S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[automatically_derived]` attribute cannot be used on traits - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:314:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:286:5 | LL | #[automatically_derived] trait W { } | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -388,7 +352,7 @@ LL | #[automatically_derived] trait W { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[automatically_derived]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:320:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:292:5 | LL | #[automatically_derived] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -397,7 +361,7 @@ LL | #[automatically_derived] impl S { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[no_mangle]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:329:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:301:1 | LL | #[no_mangle] | ^^^^^^^^^^^^ @@ -406,7 +370,7 @@ LL | #[no_mangle] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[no_mangle]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:335:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:307:17 | LL | mod inner { #![no_mangle] } | ^^^^^^^^^^^^^ @@ -415,7 +379,7 @@ LL | mod inner { #![no_mangle] } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[no_mangle]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:343:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:315:5 | LL | #[no_mangle] struct S; | ^^^^^^^^^^^^ @@ -424,7 +388,7 @@ LL | #[no_mangle] struct S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[no_mangle]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:349:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:321:5 | LL | #[no_mangle] type T = S; | ^^^^^^^^^^^^ @@ -433,7 +397,7 @@ LL | #[no_mangle] type T = S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[no_mangle]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:355:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:327:5 | LL | #[no_mangle] impl S { } | ^^^^^^^^^^^^ @@ -442,7 +406,7 @@ LL | #[no_mangle] impl S { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[no_mangle]` attribute cannot be used on required trait methods - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:362:9 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:334:9 | LL | #[no_mangle] fn foo(); | ^^^^^^^^^^^^ @@ -451,7 +415,7 @@ LL | #[no_mangle] fn foo(); = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[no_mangle]` attribute cannot be used on provided trait methods - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:368:9 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:340:9 | LL | #[no_mangle] fn bar() {} | ^^^^^^^^^^^^ @@ -460,7 +424,7 @@ LL | #[no_mangle] fn bar() {} = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[should_panic]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:376:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:348:1 | LL | #[should_panic] | ^^^^^^^^^^^^^^^ @@ -469,7 +433,7 @@ LL | #[should_panic] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[should_panic]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:382:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:354:17 | LL | mod inner { #![should_panic] } | ^^^^^^^^^^^^^^^^ @@ -478,7 +442,7 @@ LL | mod inner { #![should_panic] } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[should_panic]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:390:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:362:5 | LL | #[should_panic] struct S; | ^^^^^^^^^^^^^^^ @@ -487,7 +451,7 @@ LL | #[should_panic] struct S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[should_panic]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:396:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:368:5 | LL | #[should_panic] type T = S; | ^^^^^^^^^^^^^^^ @@ -496,7 +460,7 @@ LL | #[should_panic] type T = S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[should_panic]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:402:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:374:5 | LL | #[should_panic] impl S { } | ^^^^^^^^^^^^^^^ @@ -505,7 +469,7 @@ LL | #[should_panic] impl S { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[ignore]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:409:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:381:1 | LL | #[ignore] | ^^^^^^^^^ @@ -514,7 +478,7 @@ LL | #[ignore] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[ignore]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:415:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:387:17 | LL | mod inner { #![ignore] } | ^^^^^^^^^^ @@ -523,7 +487,7 @@ LL | mod inner { #![ignore] } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[ignore]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:423:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:395:5 | LL | #[ignore] struct S; | ^^^^^^^^^ @@ -532,7 +496,7 @@ LL | #[ignore] struct S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[ignore]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:429:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:401:5 | LL | #[ignore] type T = S; | ^^^^^^^^^ @@ -541,7 +505,7 @@ LL | #[ignore] type T = S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[ignore]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:435:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:407:5 | LL | #[ignore] impl S { } | ^^^^^^^^^ @@ -550,7 +514,7 @@ LL | #[ignore] impl S { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[no_implicit_prelude]` attribute cannot be used on functions - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:446:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:418:5 | LL | #[no_implicit_prelude] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ @@ -559,7 +523,7 @@ LL | #[no_implicit_prelude] fn f() { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[no_implicit_prelude]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:452:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:424:5 | LL | #[no_implicit_prelude] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ @@ -568,7 +532,7 @@ LL | #[no_implicit_prelude] struct S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[no_implicit_prelude]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:458:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:430:5 | LL | #[no_implicit_prelude] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ @@ -577,7 +541,7 @@ LL | #[no_implicit_prelude] type T = S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[no_implicit_prelude]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:464:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:436:5 | LL | #[no_implicit_prelude] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ @@ -586,7 +550,7 @@ LL | #[no_implicit_prelude] impl S { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[macro_escape]` attribute cannot be used on functions - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:479:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:451:5 | LL | #[macro_escape] fn f() { } | ^^^^^^^^^^^^^^^ @@ -595,7 +559,7 @@ LL | #[macro_escape] fn f() { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[macro_escape]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:485:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:457:5 | LL | #[macro_escape] struct S; | ^^^^^^^^^^^^^^^ @@ -604,7 +568,7 @@ LL | #[macro_escape] struct S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[macro_escape]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:491:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:463:5 | LL | #[macro_escape] type T = S; | ^^^^^^^^^^^^^^^ @@ -613,7 +577,7 @@ LL | #[macro_escape] type T = S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[macro_escape]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:497:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:469:5 | LL | #[macro_escape] impl S { } | ^^^^^^^^^^^^^^^ @@ -622,13 +586,13 @@ LL | #[macro_escape] impl S { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_std]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:504:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:476:1 | LL | #[no_std] | ^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:506:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:478:1 | LL | / mod no_std { LL | | @@ -638,61 +602,61 @@ LL | | } | |_^ warning: the `#![no_std]` attribute can only be used at the crate root - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:508:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:480:17 | LL | mod inner { #![no_std] } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_std]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:511:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:483:5 | LL | #[no_std] fn f() { } | ^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:511:15 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:483:15 | LL | #[no_std] fn f() { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_std]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:515:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:487:5 | LL | #[no_std] struct S; | ^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this struct - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:515:15 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:487:15 | LL | #[no_std] struct S; | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_std]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:519:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:491:5 | LL | #[no_std] type T = S; | ^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this type alias - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:519:15 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:491:15 | LL | #[no_std] type T = S; | ^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_std]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:523:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:495:5 | LL | #[no_std] impl S { } | ^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this implementation block - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:523:15 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:495:15 | LL | #[no_std] impl S { } | ^^^^^^^^^^ warning: `#[cold]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:545:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:517:1 | LL | #[cold] | ^^^^^^^ @@ -701,7 +665,7 @@ LL | #[cold] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[cold]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:552:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:524:17 | LL | mod inner { #![cold] } | ^^^^^^^^ @@ -710,7 +674,7 @@ LL | mod inner { #![cold] } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[cold]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:560:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:532:5 | LL | #[cold] struct S; | ^^^^^^^ @@ -719,7 +683,7 @@ LL | #[cold] struct S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[cold]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:566:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:538:5 | LL | #[cold] type T = S; | ^^^^^^^ @@ -728,7 +692,7 @@ LL | #[cold] type T = S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[cold]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:572:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:544:5 | LL | #[cold] impl S { } | ^^^^^^^ @@ -737,7 +701,7 @@ LL | #[cold] impl S { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[link_name]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:579:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:551:1 | LL | #[link_name = "1900"] | ^^^^^^^^^^^^^^^^^^^^^ @@ -746,7 +710,7 @@ LL | #[link_name = "1900"] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[link_name]` attribute cannot be used on foreign modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:585:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:557:5 | LL | #[link_name = "1900"] | ^^^^^^^^^^^^^^^^^^^^^ @@ -755,7 +719,7 @@ LL | #[link_name = "1900"] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[link_name]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:592:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:564:17 | LL | mod inner { #![link_name="1900"] } | ^^^^^^^^^^^^^^^^^^^^ @@ -764,7 +728,7 @@ LL | mod inner { #![link_name="1900"] } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[link_name]` attribute cannot be used on functions - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:598:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:570:5 | LL | #[link_name = "1900"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^ @@ -773,7 +737,7 @@ LL | #[link_name = "1900"] fn f() { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[link_name]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:604:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:576:5 | LL | #[link_name = "1900"] struct S; | ^^^^^^^^^^^^^^^^^^^^^ @@ -782,7 +746,7 @@ LL | #[link_name = "1900"] struct S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[link_name]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:610:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:582:5 | LL | #[link_name = "1900"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^ @@ -791,7 +755,7 @@ LL | #[link_name = "1900"] type T = S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[link_name]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:616:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:588:5 | LL | #[link_name = "1900"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^ @@ -800,7 +764,7 @@ LL | #[link_name = "1900"] impl S { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[link_section]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:623:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:595:1 | LL | #[link_section = ",1800"] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -809,7 +773,7 @@ LL | #[link_section = ",1800"] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[link_section]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:629:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:601:17 | LL | mod inner { #![link_section=",1800"] } | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -818,7 +782,7 @@ LL | mod inner { #![link_section=",1800"] } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[link_section]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:637:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:609:5 | LL | #[link_section = ",1800"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -827,7 +791,7 @@ LL | #[link_section = ",1800"] struct S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[link_section]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:643:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:615:5 | LL | #[link_section = ",1800"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -836,7 +800,7 @@ LL | #[link_section = ",1800"] type T = S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[link_section]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:649:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:621:5 | LL | #[link_section = ",1800"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -845,7 +809,7 @@ LL | #[link_section = ",1800"] impl S { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[link_section]` attribute cannot be used on traits - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:655:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:627:5 | LL | #[link_section = ",1800"] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -854,7 +818,7 @@ LL | #[link_section = ",1800"] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[link_section]` attribute cannot be used on required trait methods - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:661:9 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:633:9 | LL | #[link_section = ",1800"] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -863,7 +827,7 @@ LL | #[link_section = ",1800"] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[link]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:689:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:661:1 | LL | #[link(name = "x")] | ^^^^^^^^^^^^^^^^^^^ @@ -872,7 +836,7 @@ LL | #[link(name = "x")] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[link]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:695:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:667:17 | LL | mod inner { #![link(name = "x")] } | ^^^^^^^^^^^^^^^^^^^^ @@ -881,7 +845,7 @@ LL | mod inner { #![link(name = "x")] } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[link]` attribute cannot be used on functions - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:701:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:673:5 | LL | #[link(name = "x")] fn f() { } | ^^^^^^^^^^^^^^^^^^^ @@ -890,7 +854,7 @@ LL | #[link(name = "x")] fn f() { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[link]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:707:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:679:5 | LL | #[link(name = "x")] struct S; | ^^^^^^^^^^^^^^^^^^^ @@ -899,7 +863,7 @@ LL | #[link(name = "x")] struct S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[link]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:713:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:685:5 | LL | #[link(name = "x")] type T = S; | ^^^^^^^^^^^^^^^^^^^ @@ -908,7 +872,7 @@ LL | #[link(name = "x")] type T = S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[link]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:719:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:691:5 | LL | #[link(name = "x")] impl S { } | ^^^^^^^^^^^^^^^^^^^ @@ -917,7 +881,7 @@ LL | #[link(name = "x")] impl S { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[must_use]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:745:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:717:1 | LL | #[must_use] | ^^^^^^^^^^^ @@ -926,7 +890,7 @@ LL | #[must_use] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[must_use]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:750:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:722:17 | LL | mod inner { #![must_use] } | ^^^^^^^^^^^^ @@ -935,7 +899,7 @@ LL | mod inner { #![must_use] } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[must_use]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:759:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:731:5 | LL | #[must_use] type T = S; | ^^^^^^^^^^^ @@ -944,7 +908,7 @@ LL | #[must_use] type T = S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: `#[must_use]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:764:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:736:5 | LL | #[must_use] impl S { } | ^^^^^^^^^^^ @@ -953,13 +917,13 @@ LL | #[must_use] impl S { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![windows_subsystem]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:770:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:742:1 | LL | #[windows_subsystem = "windows"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:772:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:744:1 | LL | / mod windows_subsystem { LL | | @@ -969,67 +933,67 @@ LL | | } | |_^ warning: the `#![windows_subsystem]` attribute can only be used at the crate root - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:774:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:746:17 | LL | mod inner { #![windows_subsystem="windows"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![windows_subsystem]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:777:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:749:5 | LL | #[windows_subsystem = "windows"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:777:38 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:749:38 | LL | #[windows_subsystem = "windows"] fn f() { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![windows_subsystem]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:781:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:753:5 | LL | #[windows_subsystem = "windows"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this struct - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:781:38 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:753:38 | LL | #[windows_subsystem = "windows"] struct S; | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![windows_subsystem]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:785:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:757:5 | LL | #[windows_subsystem = "windows"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this type alias - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:785:38 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:757:38 | LL | #[windows_subsystem = "windows"] type T = S; | ^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![windows_subsystem]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:789:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:761:5 | LL | #[windows_subsystem = "windows"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this implementation block - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:789:38 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:761:38 | LL | #[windows_subsystem = "windows"] impl S { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_name]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:796:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:768:1 | LL | #[crate_name = "0900"] | ^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:798:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:770:1 | LL | / mod crate_name { LL | | @@ -1039,67 +1003,67 @@ LL | | } | |_^ warning: the `#![crate_name]` attribute can only be used at the crate root - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:800:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:772:17 | LL | mod inner { #![crate_name="0900"] } | ^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_name]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:803:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:775:5 | LL | #[crate_name = "0900"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:803:28 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:775:28 | LL | #[crate_name = "0900"] fn f() { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_name]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:807:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:779:5 | LL | #[crate_name = "0900"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this struct - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:807:28 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:779:28 | LL | #[crate_name = "0900"] struct S; | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_name]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:811:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:783:5 | LL | #[crate_name = "0900"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this type alias - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:811:28 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:783:28 | LL | #[crate_name = "0900"] type T = S; | ^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_name]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:815:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:787:5 | LL | #[crate_name = "0900"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this implementation block - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:815:28 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:787:28 | LL | #[crate_name = "0900"] impl S { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_type]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:820:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:792:1 | LL | #[crate_type = "0800"] | ^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:822:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:794:1 | LL | / mod crate_type { LL | | @@ -1109,67 +1073,67 @@ LL | | } | |_^ warning: the `#![crate_type]` attribute can only be used at the crate root - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:824:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:796:17 | LL | mod inner { #![crate_type="0800"] } | ^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_type]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:827:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:799:5 | LL | #[crate_type = "0800"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:827:28 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:799:28 | LL | #[crate_type = "0800"] fn f() { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_type]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:831:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:803:5 | LL | #[crate_type = "0800"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this struct - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:831:28 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:803:28 | LL | #[crate_type = "0800"] struct S; | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_type]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:835:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:807:5 | LL | #[crate_type = "0800"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this type alias - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:835:28 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:807:28 | LL | #[crate_type = "0800"] type T = S; | ^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_type]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:839:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:811:5 | LL | #[crate_type = "0800"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this implementation block - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:839:28 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:811:28 | LL | #[crate_type = "0800"] impl S { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![feature]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:844:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:816:1 | LL | #[feature(x0600)] | ^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:846:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:818:1 | LL | / mod feature { LL | | @@ -1179,67 +1143,67 @@ LL | | } | |_^ warning: the `#![feature]` attribute can only be used at the crate root - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:848:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:820:17 | LL | mod inner { #![feature(x0600)] } | ^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![feature]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:851:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:823:5 | LL | #[feature(x0600)] fn f() { } | ^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:851:23 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:823:23 | LL | #[feature(x0600)] fn f() { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![feature]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:855:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:827:5 | LL | #[feature(x0600)] struct S; | ^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this struct - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:855:23 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:827:23 | LL | #[feature(x0600)] struct S; | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![feature]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:859:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:831:5 | LL | #[feature(x0600)] type T = S; | ^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this type alias - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:859:23 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:831:23 | LL | #[feature(x0600)] type T = S; | ^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![feature]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:863:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:835:5 | LL | #[feature(x0600)] impl S { } | ^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this implementation block - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:863:23 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:835:23 | LL | #[feature(x0600)] impl S { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_main]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:869:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:841:1 | LL | #[no_main] | ^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:871:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:843:1 | LL | / mod no_main_1 { LL | | @@ -1249,67 +1213,67 @@ LL | | } | |_^ warning: the `#![no_main]` attribute can only be used at the crate root - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:873:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:845:17 | LL | mod inner { #![no_main] } | ^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_main]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:876:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:848:5 | LL | #[no_main] fn f() { } | ^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:876:16 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:848:16 | LL | #[no_main] fn f() { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_main]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:880:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:852:5 | LL | #[no_main] struct S; | ^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this struct - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:880:16 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:852:16 | LL | #[no_main] struct S; | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_main]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:884:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:856:5 | LL | #[no_main] type T = S; | ^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this type alias - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:884:16 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:856:16 | LL | #[no_main] type T = S; | ^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_main]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:888:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:860:5 | LL | #[no_main] impl S { } | ^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this implementation block - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:888:16 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:860:16 | LL | #[no_main] impl S { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_builtins]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:893:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:865:1 | LL | #[no_builtins] | ^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:895:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:867:1 | LL | / mod no_builtins { LL | | @@ -1319,67 +1283,67 @@ LL | | } | |_^ warning: the `#![no_builtins]` attribute can only be used at the crate root - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:897:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:869:17 | LL | mod inner { #![no_builtins] } | ^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_builtins]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:900:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:872:5 | LL | #[no_builtins] fn f() { } | ^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:900:20 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:872:20 | LL | #[no_builtins] fn f() { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_builtins]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:904:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:876:5 | LL | #[no_builtins] struct S; | ^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this struct - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:904:20 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:876:20 | LL | #[no_builtins] struct S; | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_builtins]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:908:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:880:5 | LL | #[no_builtins] type T = S; | ^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this type alias - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:908:20 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:880:20 | LL | #[no_builtins] type T = S; | ^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_builtins]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:912:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:884:5 | LL | #[no_builtins] impl S { } | ^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this implementation block - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:912:20 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:884:20 | LL | #[no_builtins] impl S { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![recursion_limit]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:917:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:889:1 | LL | #[recursion_limit="0200"] | ^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:919:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:891:1 | LL | / mod recursion_limit { LL | | @@ -1389,67 +1353,67 @@ LL | | } | |_^ warning: the `#![recursion_limit]` attribute can only be used at the crate root - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:921:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:893:17 | LL | mod inner { #![recursion_limit="0200"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![recursion_limit]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:924:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:896:5 | LL | #[recursion_limit="0200"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:924:31 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:896:31 | LL | #[recursion_limit="0200"] fn f() { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![recursion_limit]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:928:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:900:5 | LL | #[recursion_limit="0200"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this struct - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:928:31 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:900:31 | LL | #[recursion_limit="0200"] struct S; | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![recursion_limit]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:932:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:904:5 | LL | #[recursion_limit="0200"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this type alias - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:932:31 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:904:31 | LL | #[recursion_limit="0200"] type T = S; | ^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![recursion_limit]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:936:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:908:5 | LL | #[recursion_limit="0200"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this implementation block - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:936:31 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:908:31 | LL | #[recursion_limit="0200"] impl S { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![type_length_limit]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:941:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:913:1 | LL | #[type_length_limit="0100"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:943:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:915:1 | LL | / mod type_length_limit { LL | | @@ -1459,55 +1423,55 @@ LL | | } | |_^ warning: the `#![type_length_limit]` attribute can only be used at the crate root - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:945:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:917:17 | LL | mod inner { #![type_length_limit="0100"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![type_length_limit]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:948:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:920:5 | LL | #[type_length_limit="0100"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:948:33 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:920:33 | LL | #[type_length_limit="0100"] fn f() { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![type_length_limit]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:952:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:924:5 | LL | #[type_length_limit="0100"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this struct - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:952:33 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:924:33 | LL | #[type_length_limit="0100"] struct S; | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![type_length_limit]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:956:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:928:5 | LL | #[type_length_limit="0100"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this type alias - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:956:33 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:928:33 | LL | #[type_length_limit="0100"] type T = S; | ^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![type_length_limit]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:960:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:932:5 | LL | #[type_length_limit="0100"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this implementation block - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:960:33 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:932:33 | LL | #[type_length_limit="0100"] impl S { } | ^^^^^^^^^^ @@ -1593,5 +1557,5 @@ LL | #![must_use] = help: `#[must_use]` can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: 170 warnings emitted +warning: 166 warnings emitted