From 9fe01aeee7874fa4e75afe6d622ad98895073d9f Mon Sep 17 00:00:00 2001 From: Wim Looman Date: Wed, 2 Mar 2016 12:08:11 +0100 Subject: [PATCH 01/12] Add no_prelude attribute --- compiler/rustc_feature/src/active.rs | 3 +++ .../rustc_resolve/src/build_reduced_graph.rs | 17 +++++++++++++---- compiler/rustc_resolve/src/late/diagnostics.rs | 2 +- compiler/rustc_resolve/src/lib.rs | 18 ++++++++++++++---- compiler/rustc_span/src/symbol.rs | 1 + 5 files changed, 32 insertions(+), 9 deletions(-) diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs index 3b54ffbc3f08d..8a8676bd9c2d5 100644 --- a/compiler/rustc_feature/src/active.rs +++ b/compiler/rustc_feature/src/active.rs @@ -619,6 +619,9 @@ declare_features! ( /// Allows arbitrary expressions in key-value attributes at parse time. (active, extended_key_value_attributes, "1.50.0", Some(78835), None), + + /// Allow #![no_prelude] to disable prelude for current module + (active, no_prelude, "1.51.0", Some(20561), None) /// `:pat2018` and `:pat2021` macro matchers. (active, edition_macro_pats, "1.51.0", Some(54883), None), diff --git a/compiler/rustc_resolve/src/build_reduced_graph.rs b/compiler/rustc_resolve/src/build_reduced_graph.rs index 4ab14c158d337..d21041f4b6d33 100644 --- a/compiler/rustc_resolve/src/build_reduced_graph.rs +++ b/compiler/rustc_resolve/src/build_reduced_graph.rs @@ -761,11 +761,20 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> { ItemKind::Mod(..) => { let module_kind = ModuleKind::Def(DefKind::Mod, def_id, ident.name); + let inheritable_no_prelude = + self.r.session.contains_name(&item.attrs, sym::no_implicit_prelude); + let local_no_prelude = + self.r.session.contains_name(&item.attrs, sym::no_prelude); let module = self.r.arenas.alloc_module(ModuleData { - no_implicit_prelude: parent.no_implicit_prelude || { - self.r.session.contains_name(&item.attrs, sym::no_implicit_prelude) - }, - ..ModuleData::new(Some(parent), module_kind, def_id, expansion, item.span) + no_implicit_prelude: parent.no_implicit_prelude || inheritable_no_prelude, + no_prelude: inheritable_no_prelude || local_no_prelude, + ..ModuleData::new( + Some(parent), + module_kind, + def_id, + expansion, + item.span, + ), }); self.r.define(parent, ident, TypeNS, (module, vis, sp, expansion)); self.r.module_map.insert(local_def_id, module); diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs index 3945afb4724a8..25c4ef628516a 100644 --- a/compiler/rustc_resolve/src/late/diagnostics.rs +++ b/compiler/rustc_resolve/src/late/diagnostics.rs @@ -1174,7 +1174,7 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> { // We can see through blocks } else { // Items from the prelude - if !module.no_implicit_prelude { + if !module.no_prelude { let extern_prelude = self.r.extern_prelude.clone(); names.extend(extern_prelude.iter().flat_map(|(ident, _)| { self.r.crate_loader.maybe_process_path_extern(ident.name).and_then( diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index af5341623758a..e5a0d0ac8546f 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -493,8 +493,13 @@ pub struct ModuleData<'a> { unexpanded_invocations: RefCell>, /// Whether `#[no_implicit_prelude]` is active. + /// And therefore the current modul and all decendents should use no prelude no_implicit_prelude: bool, + // wheter the current module should use the prelude + // no_implicit_prelude => no_prelude + no_prelude: bool, + glob_importers: RefCell>>, globs: RefCell>>, @@ -525,6 +530,7 @@ impl<'a> ModuleData<'a> { populate_on_access: Cell::new(!nearest_parent_mod.is_local()), unexpanded_invocations: Default::default(), no_implicit_prelude: false, + no_prelude: false, glob_importers: RefCell::new(Vec::new()), globs: RefCell::new(Vec::new()), traits: RefCell::new(None), @@ -1207,13 +1213,17 @@ impl<'a> Resolver<'a> { let root_local_def_id = LocalDefId { local_def_index: CRATE_DEF_INDEX }; let root_def_id = root_local_def_id.to_def_id(); let root_module_kind = ModuleKind::Def(DefKind::Mod, root_def_id, kw::Empty); + let inheritable_no_prelude = session.contains_name(&krate.attrs, sym::no_implicit_prelude); + let local_no_prelude = session.contains_name(&krate.attrs, sym::no_prelude); let graph_root = arenas.alloc_module(ModuleData { - no_implicit_prelude: session.contains_name(&krate.attrs, sym::no_implicit_prelude), + no_implicit_prelude: inheritable_no_prelude, + no_prelude: local_no_prelude || inheritable_no_prelude, ..ModuleData::new(None, root_module_kind, root_def_id, ExpnId::root(), krate.span) }); let empty_module_kind = ModuleKind::Def(DefKind::Mod, root_def_id, kw::Empty); let empty_module = arenas.alloc_module(ModuleData { no_implicit_prelude: true, + no_prelude: true, ..ModuleData::new( Some(graph_root), empty_module_kind, @@ -1724,7 +1734,7 @@ impl<'a> Resolver<'a> { MacroNS => Scope::DeriveHelpers(parent_scope.expansion), }; let mut ctxt = ctxt.normalize_to_macros_2_0(); - let mut use_prelude = !module.no_implicit_prelude; + let mut use_prelude = !module.no_prelude; loop { let visit = match scope { @@ -1795,7 +1805,7 @@ impl<'a> Resolver<'a> { ValueNS | MacroNS => break, }, Scope::Module(module) => { - use_prelude = !module.no_implicit_prelude; + use_prelude = !module.no_prelude; match self.hygienic_lexical_parent(module, &mut ctxt) { Some(parent_module) => Scope::Module(parent_module), None => { @@ -1967,7 +1977,7 @@ impl<'a> Resolver<'a> { } } - if !module.no_implicit_prelude { + if !module.no_prelude { ident.span.adjust(ExpnId::root()); if ns == TypeNS { if let Some(binding) = self.extern_prelude_get(ident, !record_used) { diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 63f95a3908434..34be82198fbf2 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -753,6 +753,7 @@ symbols! { no_main, no_mangle, no_niche, + no_prelude, no_sanitize, no_stack_check, no_start, From 520cad5d3e77f36c76971169f63c5c8fb52b3b26 Mon Sep 17 00:00:00 2001 From: Wim Looman Date: Wed, 2 Mar 2016 18:37:12 +0100 Subject: [PATCH 02/12] Add compile-fail tests for no_prelude --- src/test/compile-fail/no-prelude-nested.rs | 67 ++++++++++++++++++++++ src/test/compile-fail/no-prelude.rs | 29 ++++++++++ 2 files changed, 96 insertions(+) create mode 100644 src/test/compile-fail/no-prelude-nested.rs create mode 100644 src/test/compile-fail/no-prelude.rs diff --git a/src/test/compile-fail/no-prelude-nested.rs b/src/test/compile-fail/no-prelude-nested.rs new file mode 100644 index 0000000000000..1f1e7917b8fbe --- /dev/null +++ b/src/test/compile-fail/no-prelude-nested.rs @@ -0,0 +1,67 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(no_prelude)] + +// Test that things from the prelude aren't in scope. Use many of them +// so that renaming some things won't magically make this test fail +// for the wrong reason (e.g. if `Add` changes to `Addition`, and +// `no_prelude` stops working, then the `impl Add` will still +// fail with the same error message). +// +// Unlike `no_implicit_prelude`, `no_prelude` doesn't cascade into nested +// modules, this makes the impl in foo::baz work. + +#[no_prelude] +mod foo { + mod baz { + struct Test; + impl From for Test { fn from(t: Test) { Test }} + impl Clone for Test { fn clone(&self) { Test } } + impl Eq for Test {} + + fn foo() { + drop(2) + } + } + + struct Test; + impl From for Test {} //~ ERROR: not in scope + impl Clone for Test {} //~ ERROR: not in scope + impl Iterator for Test {} //~ ERROR: not in scope + impl ToString for Test {} //~ ERROR: not in scope + impl Eq for Test {} //~ ERROR: not in scope + + fn foo() { + drop(2) //~ ERROR: unresolved name + } +} + +fn qux() { + #[no_prelude] + mod qux_inner { + struct Test; + impl From for Test {} //~ ERROR: not in scope + impl Clone for Test {} //~ ERROR: not in scope + impl Iterator for Test {} //~ ERROR: not in scope + impl ToString for Test {} //~ ERROR: not in scope + impl Eq for Test {} //~ ERROR: not in scope + + fn foo() { + drop(2) //~ ERROR: unresolved name + } + } +} + + +fn main() { + // these should work fine + drop(2) +} diff --git a/src/test/compile-fail/no-prelude.rs b/src/test/compile-fail/no-prelude.rs new file mode 100644 index 0000000000000..285f7185af817 --- /dev/null +++ b/src/test/compile-fail/no-prelude.rs @@ -0,0 +1,29 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(no_prelude)] +#![no_prelude] + +// Test that things from the prelude aren't in scope. Use many of them +// so that renaming some things won't magically make this test fail +// for the wrong reason (e.g. if `Add` changes to `Addition`, and +// `no_prelude` stops working, then the `impl Add` will still +// fail with the same error message). + +struct Test; +impl Add for Test {} //~ ERROR: not in scope +impl Clone for Test {} //~ ERROR: not in scope +impl Iterator for Test {} //~ ERROR: not in scope +impl ToString for Test {} //~ ERROR: not in scope +impl Writer for Test {} //~ ERROR: not in scope + +fn main() { + drop(2) //~ ERROR: unresolved name +} From 00278228170cf20e644c557ca185ad689795c988 Mon Sep 17 00:00:00 2001 From: Wim Looman Date: Sat, 5 Mar 2016 10:35:08 +0100 Subject: [PATCH 03/12] Add in compile-fail test that no_prelude is feature gated --- src/test/compile-fail/no-prelude-feature-gate.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/test/compile-fail/no-prelude-feature-gate.rs diff --git a/src/test/compile-fail/no-prelude-feature-gate.rs b/src/test/compile-fail/no-prelude-feature-gate.rs new file mode 100644 index 0000000000000..f9b142bd1bb9a --- /dev/null +++ b/src/test/compile-fail/no-prelude-feature-gate.rs @@ -0,0 +1,12 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![no_prelude] //~ ERROR: experimental feature +//~^ HELP: feature(no_prelude) From 2eb8049b5fc16b149d501efdde53005ea12981b3 Mon Sep 17 00:00:00 2001 From: Wim Looman Date: Thu, 3 Mar 2016 16:27:47 +0100 Subject: [PATCH 04/12] Update tests to use no_prelude --- .../ui/associated-types/associated-types-impl-redirect.rs | 4 ++-- src/test/ui/associated-types/associated-types-issue-20346.rs | 3 ++- .../associated-types-where-clause-impl-ambiguity.rs | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/test/ui/associated-types/associated-types-impl-redirect.rs b/src/test/ui/associated-types/associated-types-impl-redirect.rs index 8fa20cdf4b7a1..892347175ec38 100644 --- a/src/test/ui/associated-types/associated-types-impl-redirect.rs +++ b/src/test/ui/associated-types/associated-types-impl-redirect.rs @@ -8,8 +8,8 @@ // for `ByRef`. The right answer was to consider the result ambiguous // until more type information was available. -#![feature(lang_items)] -#![no_implicit_prelude] +#![feature(no_prelude, lang_items)] +#![no_prelude] use std::marker::Sized; use std::option::Option::{None, Some, self}; diff --git a/src/test/ui/associated-types/associated-types-issue-20346.rs b/src/test/ui/associated-types/associated-types-issue-20346.rs index 0cce847e1be54..fc7ad509816bb 100644 --- a/src/test/ui/associated-types/associated-types-issue-20346.rs +++ b/src/test/ui/associated-types/associated-types-issue-20346.rs @@ -1,7 +1,8 @@ // Test that we reliably check the value of the associated type. #![crate_type = "lib"] -#![no_implicit_prelude] +#![feature(no_prelude)] +#![no_prelude] use std::option::Option::{self, None, Some}; use std::vec::Vec; diff --git a/src/test/ui/associated-types/associated-types-where-clause-impl-ambiguity.rs b/src/test/ui/associated-types/associated-types-where-clause-impl-ambiguity.rs index f2a4c6e42a93f..e5f234ad93961 100644 --- a/src/test/ui/associated-types/associated-types-where-clause-impl-ambiguity.rs +++ b/src/test/ui/associated-types/associated-types-where-clause-impl-ambiguity.rs @@ -7,8 +7,8 @@ // for `ByRef`. The right answer was to consider the result ambiguous // until more type information was available. -#![feature(lang_items)] -#![no_implicit_prelude] +#![feature(no_prelude, lang_items)] +#![no_prelude] use std::marker::Sized; use std::option::Option::{None, Some, self}; From a8f73a59a634a2b42e52a47a05355d4129eb700b Mon Sep 17 00:00:00 2001 From: Wim Looman Date: Thu, 3 Mar 2016 15:57:00 +0100 Subject: [PATCH 05/12] Update documentation to specify no_prelude --- compiler/rustc_expand/src/base.rs | 2 +- compiler/rustc_feature/src/builtin_attrs.rs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_expand/src/base.rs b/compiler/rustc_expand/src/base.rs index 2f43940a9dcbb..5a27aaa888256 100644 --- a/compiler/rustc_expand/src/base.rs +++ b/compiler/rustc_expand/src/base.rs @@ -727,7 +727,7 @@ pub struct SyntaxExtension { /// Edition of the crate in which this macro is defined. pub edition: Edition, /// Built-in macros have a couple of special properties like availability - /// in `#[no_implicit_prelude]` modules, so we have to keep this flag. + /// in `#[no_prelude]` modules, so we have to keep this flag. pub builtin_name: Option, } diff --git a/compiler/rustc_feature/src/builtin_attrs.rs b/compiler/rustc_feature/src/builtin_attrs.rs index 3ed5320da73b3..f585cd75ba57a 100644 --- a/compiler/rustc_feature/src/builtin_attrs.rs +++ b/compiler/rustc_feature/src/builtin_attrs.rs @@ -591,6 +591,10 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ omit_gdb_pretty_printer_section, AssumedUsed, template!(Word), "the `#[omit_gdb_pretty_printer_section]` attribute is just used for the Rust test suite", ), + gated!( + no_prelude, Normal, template!(Word), + "replacement for #![no_implicit_prelude] that is not inherited by descendants" + ), ]; pub fn deprecated_attributes() -> Vec<&'static BuiltinAttribute> { From 613da6fc37a86e1deac46c179139fa3282fc53ff Mon Sep 17 00:00:00 2001 From: Wim Looman Date: Wed, 2 Mar 2016 17:27:05 +0100 Subject: [PATCH 06/12] Add deprecation notice for no_implicit_prelude --- compiler/rustc_feature/src/builtin_attrs.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_feature/src/builtin_attrs.rs b/compiler/rustc_feature/src/builtin_attrs.rs index f585cd75ba57a..c8da59e42cd21 100644 --- a/compiler/rustc_feature/src/builtin_attrs.rs +++ b/compiler/rustc_feature/src/builtin_attrs.rs @@ -252,7 +252,15 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ // Modules, prelude, and resolution: ungated!(path, Normal, template!(NameValueStr: "file")), ungated!(no_std, CrateLevel, template!(Word)), - ungated!(no_implicit_prelude, Normal, template!(Word)), + (sym:no_implicit_prelude, Normal, template!(Word), Gated( + Stability::Deprecated( + "https://github.com/rust-lang/rust/issues/20561", + Some("may be removed in a future compiler version"), + ), + sym::no_prelude, + "to be replaced by no_prelude", + |_|true + )), ungated!(non_exhaustive, AssumedUsed, template!(Word)), // Runtime From d4e9dcdbc7e5130937d5cf68042ee81c56e01d88 Mon Sep 17 00:00:00 2001 From: Wim Looman Date: Wed, 2 Mar 2016 17:27:38 +0100 Subject: [PATCH 07/12] Add expectations for deprecation to compile-fail tests --- .../no-implicit-prelude-nested.rs | 68 +++++++++++++++++++ src/test/compile-fail/no-implicit-prelude.rs | 30 ++++++++ 2 files changed, 98 insertions(+) create mode 100644 src/test/compile-fail/no-implicit-prelude-nested.rs create mode 100644 src/test/compile-fail/no-implicit-prelude.rs diff --git a/src/test/compile-fail/no-implicit-prelude-nested.rs b/src/test/compile-fail/no-implicit-prelude-nested.rs new file mode 100644 index 0000000000000..62e91b9b93d01 --- /dev/null +++ b/src/test/compile-fail/no-implicit-prelude-nested.rs @@ -0,0 +1,68 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Test that things from the prelude aren't in scope. Use many of them +// so that renaming some things won't magically make this test fail +// for the wrong reason (e.g. if `Add` changes to `Addition`, and +// `no_implicit_prelude` stops working, then the `impl Add` will still +// fail with the same error message). + +#[no_implicit_prelude] +//~^ WARNING: deprecated +//~^^ WARNING: deprecated +mod foo { + mod baz { + struct Test; + impl Add for Test {} //~ ERROR: not in scope + impl Clone for Test {} //~ ERROR: not in scope + impl Iterator for Test {} //~ ERROR: not in scope + impl ToString for Test {} //~ ERROR: not in scope + impl Writer for Test {} //~ ERROR: not in scope + + fn foo() { + drop(2) //~ ERROR: unresolved name + } + } + + struct Test; + impl Add for Test {} //~ ERROR: not in scope + impl Clone for Test {} //~ ERROR: not in scope + impl Iterator for Test {} //~ ERROR: not in scope + impl ToString for Test {} //~ ERROR: not in scope + impl Writer for Test {} //~ ERROR: not in scope + + fn foo() { + drop(2) //~ ERROR: unresolved name + } +} + +fn qux() { + #[no_implicit_prelude] + //~^ WARNING: deprecated + //~^^ WARNING: deprecated + mod qux_inner { + struct Test; + impl Add for Test {} //~ ERROR: not in scope + impl Clone for Test {} //~ ERROR: not in scope + impl Iterator for Test {} //~ ERROR: not in scope + impl ToString for Test {} //~ ERROR: not in scope + impl Writer for Test {} //~ ERROR: not in scope + + fn foo() { + drop(2) //~ ERROR: unresolved name + } + } +} + + +fn main() { + // these should work fine + drop(2) +} diff --git a/src/test/compile-fail/no-implicit-prelude.rs b/src/test/compile-fail/no-implicit-prelude.rs new file mode 100644 index 0000000000000..7ecfad231af10 --- /dev/null +++ b/src/test/compile-fail/no-implicit-prelude.rs @@ -0,0 +1,30 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![no_implicit_prelude] +//~^ WARN deprecated +//~^^ WARN deprecated + +// Test that things from the prelude aren't in scope. Use many of them +// so that renaming some things won't magically make this test fail +// for the wrong reason (e.g. if `Add` changes to `Addition`, and +// `no_implicit_prelude` stops working, then the `impl Add` will still +// fail with the same error message). + +struct Test; +impl Add for Test {} //~ ERROR: not in scope +impl Clone for Test {} //~ ERROR: not in scope +impl Iterator for Test {} //~ ERROR: not in scope +impl ToString for Test {} //~ ERROR: not in scope +impl Writer for Test {} //~ ERROR: not in scope + +fn main() { + drop(2) //~ ERROR: unresolved name +} From 7390b00aa849db325eed0e93617e8c7fa8dba858 Mon Sep 17 00:00:00 2001 From: Skgland Date: Mon, 28 Dec 2020 02:09:51 +0100 Subject: [PATCH 08/12] fix errors introduced in rebase/due to passed time --- compiler/rustc_feature/src/active.rs | 4 ++-- compiler/rustc_feature/src/builtin_attrs.rs | 14 +++++------ .../rustc_resolve/src/build_reduced_graph.rs | 17 ++++---------- compiler/rustc_resolve/src/lib.rs | 14 +++++------ .../compile-fail/feature-gate-no_prelude.rs | 2 ++ .../no-implicit-prelude-nested.rs | 11 --------- src/test/compile-fail/no-implicit-prelude.rs | 10 -------- .../compile-fail/no-prelude-feature-gate.rs | 12 ---------- src/test/compile-fail/no-prelude-nested.rs | 23 ++++++++----------- src/test/compile-fail/no-prelude.rs | 10 -------- src/test/ui/issues/issue-21363.rs | 3 ++- src/test/ui/macros/issue-78333.rs | 3 ++- 12 files changed, 37 insertions(+), 86 deletions(-) create mode 100644 src/test/compile-fail/feature-gate-no_prelude.rs delete mode 100644 src/test/compile-fail/no-prelude-feature-gate.rs diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs index 8a8676bd9c2d5..9c7d5712612aa 100644 --- a/compiler/rustc_feature/src/active.rs +++ b/compiler/rustc_feature/src/active.rs @@ -619,9 +619,9 @@ declare_features! ( /// Allows arbitrary expressions in key-value attributes at parse time. (active, extended_key_value_attributes, "1.50.0", Some(78835), None), - + /// Allow #![no_prelude] to disable prelude for current module - (active, no_prelude, "1.51.0", Some(20561), None) + (active, no_prelude, "1.51.0", Some(20561), None), /// `:pat2018` and `:pat2021` macro matchers. (active, edition_macro_pats, "1.51.0", Some(54883), None), diff --git a/compiler/rustc_feature/src/builtin_attrs.rs b/compiler/rustc_feature/src/builtin_attrs.rs index c8da59e42cd21..52a4af7de6f5f 100644 --- a/compiler/rustc_feature/src/builtin_attrs.rs +++ b/compiler/rustc_feature/src/builtin_attrs.rs @@ -252,15 +252,19 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ // Modules, prelude, and resolution: ungated!(path, Normal, template!(NameValueStr: "file")), ungated!(no_std, CrateLevel, template!(Word)), - (sym:no_implicit_prelude, Normal, template!(Word), Gated( + (sym::no_implicit_prelude, Normal, template!(Word), Gated( Stability::Deprecated( "https://github.com/rust-lang/rust/issues/20561", Some("may be removed in a future compiler version"), ), - sym::no_prelude, - "to be replaced by no_prelude", + sym::no_implicit_prelude, + "deprecated in favor of no_prelude", |_|true )), + gated!( + no_prelude, Normal, template!(Word), + "replacement for #![no_implicit_prelude] that is not inherited by descendants" + ), ungated!(non_exhaustive, AssumedUsed, template!(Word)), // Runtime @@ -599,10 +603,6 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ omit_gdb_pretty_printer_section, AssumedUsed, template!(Word), "the `#[omit_gdb_pretty_printer_section]` attribute is just used for the Rust test suite", ), - gated!( - no_prelude, Normal, template!(Word), - "replacement for #![no_implicit_prelude] that is not inherited by descendants" - ), ]; pub fn deprecated_attributes() -> Vec<&'static BuiltinAttribute> { diff --git a/compiler/rustc_resolve/src/build_reduced_graph.rs b/compiler/rustc_resolve/src/build_reduced_graph.rs index d21041f4b6d33..74b665d133b2b 100644 --- a/compiler/rustc_resolve/src/build_reduced_graph.rs +++ b/compiler/rustc_resolve/src/build_reduced_graph.rs @@ -761,20 +761,13 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> { ItemKind::Mod(..) => { let module_kind = ModuleKind::Def(DefKind::Mod, def_id, ident.name); - let inheritable_no_prelude = - self.r.session.contains_name(&item.attrs, sym::no_implicit_prelude); - let local_no_prelude = - self.r.session.contains_name(&item.attrs, sym::no_prelude); + let inheritable_no_prelude = parent.pass_on_no_prelude + || self.r.session.contains_name(&item.attrs, sym::no_implicit_prelude); + let local_no_prelude = self.r.session.contains_name(&item.attrs, sym::no_prelude); let module = self.r.arenas.alloc_module(ModuleData { - no_implicit_prelude: parent.no_implicit_prelude || inheritable_no_prelude, + pass_on_no_prelude: inheritable_no_prelude, no_prelude: inheritable_no_prelude || local_no_prelude, - ..ModuleData::new( - Some(parent), - module_kind, - def_id, - expansion, - item.span, - ), + ..ModuleData::new(Some(parent), module_kind, def_id, expansion, item.span) }); self.r.define(parent, ident, TypeNS, (module, vis, sp, expansion)); self.r.module_map.insert(local_def_id, module); diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index e5a0d0ac8546f..6652d8541a4c0 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -493,11 +493,11 @@ pub struct ModuleData<'a> { unexpanded_invocations: RefCell>, /// Whether `#[no_implicit_prelude]` is active. - /// And therefore the current modul and all decendents should use no prelude - no_implicit_prelude: bool, + /// And should therefore be active in decendant modules + pass_on_no_prelude: bool, - // wheter the current module should use the prelude - // no_implicit_prelude => no_prelude + /// Whether `#[no_prelude]` or `#[no_implicit_prelude]` is active. + /// And therefore the current modul should use no prelude no_prelude: bool, glob_importers: RefCell>>, @@ -529,7 +529,7 @@ impl<'a> ModuleData<'a> { lazy_resolutions: Default::default(), populate_on_access: Cell::new(!nearest_parent_mod.is_local()), unexpanded_invocations: Default::default(), - no_implicit_prelude: false, + pass_on_no_prelude: false, no_prelude: false, glob_importers: RefCell::new(Vec::new()), globs: RefCell::new(Vec::new()), @@ -1216,13 +1216,13 @@ impl<'a> Resolver<'a> { let inheritable_no_prelude = session.contains_name(&krate.attrs, sym::no_implicit_prelude); let local_no_prelude = session.contains_name(&krate.attrs, sym::no_prelude); let graph_root = arenas.alloc_module(ModuleData { - no_implicit_prelude: inheritable_no_prelude, + pass_on_no_prelude: inheritable_no_prelude, no_prelude: local_no_prelude || inheritable_no_prelude, ..ModuleData::new(None, root_module_kind, root_def_id, ExpnId::root(), krate.span) }); let empty_module_kind = ModuleKind::Def(DefKind::Mod, root_def_id, kw::Empty); let empty_module = arenas.alloc_module(ModuleData { - no_implicit_prelude: true, + pass_on_no_prelude: true, no_prelude: true, ..ModuleData::new( Some(graph_root), diff --git a/src/test/compile-fail/feature-gate-no_prelude.rs b/src/test/compile-fail/feature-gate-no_prelude.rs new file mode 100644 index 0000000000000..e1a415945074d --- /dev/null +++ b/src/test/compile-fail/feature-gate-no_prelude.rs @@ -0,0 +1,2 @@ +#![no_prelude] //~ ERROR: experimental feature + //~^ HELP: feature(no_prelude) diff --git a/src/test/compile-fail/no-implicit-prelude-nested.rs b/src/test/compile-fail/no-implicit-prelude-nested.rs index 62e91b9b93d01..2f0d48aa88cda 100644 --- a/src/test/compile-fail/no-implicit-prelude-nested.rs +++ b/src/test/compile-fail/no-implicit-prelude-nested.rs @@ -1,13 +1,3 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - // Test that things from the prelude aren't in scope. Use many of them // so that renaming some things won't magically make this test fail // for the wrong reason (e.g. if `Add` changes to `Addition`, and @@ -61,7 +51,6 @@ fn qux() { } } - fn main() { // these should work fine drop(2) diff --git a/src/test/compile-fail/no-implicit-prelude.rs b/src/test/compile-fail/no-implicit-prelude.rs index 7ecfad231af10..b8afba4380dfe 100644 --- a/src/test/compile-fail/no-implicit-prelude.rs +++ b/src/test/compile-fail/no-implicit-prelude.rs @@ -1,13 +1,3 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - #![no_implicit_prelude] //~^ WARN deprecated //~^^ WARN deprecated diff --git a/src/test/compile-fail/no-prelude-feature-gate.rs b/src/test/compile-fail/no-prelude-feature-gate.rs deleted file mode 100644 index f9b142bd1bb9a..0000000000000 --- a/src/test/compile-fail/no-prelude-feature-gate.rs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![no_prelude] //~ ERROR: experimental feature -//~^ HELP: feature(no_prelude) diff --git a/src/test/compile-fail/no-prelude-nested.rs b/src/test/compile-fail/no-prelude-nested.rs index 1f1e7917b8fbe..df3df116cc30c 100644 --- a/src/test/compile-fail/no-prelude-nested.rs +++ b/src/test/compile-fail/no-prelude-nested.rs @@ -1,13 +1,3 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - #![feature(no_prelude)] // Test that things from the prelude aren't in scope. Use many of them @@ -23,8 +13,16 @@ mod foo { mod baz { struct Test; - impl From for Test { fn from(t: Test) { Test }} - impl Clone for Test { fn clone(&self) { Test } } + impl From for Test { + fn from(t: Test) { + Test + } + } + impl Clone for Test { + fn clone(&self) { + Test + } + } impl Eq for Test {} fn foo() { @@ -60,7 +58,6 @@ fn qux() { } } - fn main() { // these should work fine drop(2) diff --git a/src/test/compile-fail/no-prelude.rs b/src/test/compile-fail/no-prelude.rs index 285f7185af817..bbce17de512a9 100644 --- a/src/test/compile-fail/no-prelude.rs +++ b/src/test/compile-fail/no-prelude.rs @@ -1,13 +1,3 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - #![feature(no_prelude)] #![no_prelude] diff --git a/src/test/ui/issues/issue-21363.rs b/src/test/ui/issues/issue-21363.rs index acc28cb430b27..21f69ae9db9bd 100644 --- a/src/test/ui/issues/issue-21363.rs +++ b/src/test/ui/issues/issue-21363.rs @@ -1,7 +1,8 @@ // check-pass // pretty-expanded FIXME #23616 -#![no_implicit_prelude] +#![feature(no_prelude)] +#![no_prelude] trait Iterator { type Item; diff --git a/src/test/ui/macros/issue-78333.rs b/src/test/ui/macros/issue-78333.rs index c376f2067045b..1f18483fd04be 100644 --- a/src/test/ui/macros/issue-78333.rs +++ b/src/test/ui/macros/issue-78333.rs @@ -1,6 +1,7 @@ // build-pass -#![no_implicit_prelude] +#![feature(no_prelude)] +#![no_prelude] fn main() { ::std::panic!(); From ee255bffd1c89961b94851aec921bd79ce871813 Mon Sep 17 00:00:00 2001 From: Skgland Date: Mon, 28 Dec 2020 03:18:57 +0100 Subject: [PATCH 09/12] fix and bless tests move no-prelude tests to tests/ui remove duplicate no-implicit-prelude tests --- compiler/rustc_feature/src/builtin_attrs.rs | 2 +- .../compile-fail/feature-gate-no_prelude.rs | 4 +- .../no-implicit-prelude-nested.rs | 57 --- src/test/compile-fail/no-implicit-prelude.rs | 20 - .../associated-types-issue-20346.stderr | 2 +- .../attributes}/no-prelude-nested.rs | 25 +- .../ui/attributes/no-prelude-nested.stderr | 136 ++++++ .../attributes}/no-prelude.rs | 12 +- src/test/ui/attributes/no-prelude.stderr | 65 +++ .../attributes/register-attr-tool-prelude.rs | 3 +- .../register-attr-tool-prelude.stderr | 4 +- .../issue-43106-gating-of-builtin-attrs.rs | 14 + ...issue-43106-gating-of-builtin-attrs.stderr | 440 ++++++++++-------- .../ui/hygiene/no_implicit_prelude-2018.rs | 1 + .../hygiene/no_implicit_prelude-2018.stderr | 12 +- src/test/ui/hygiene/no_implicit_prelude.rs | 1 + .../ui/hygiene/no_implicit_prelude.stderr | 14 +- src/test/ui/no-implicit-prelude-nested.rs | 2 + src/test/ui/no-implicit-prelude-nested.stderr | 52 ++- src/test/ui/no-implicit-prelude.rs | 1 + src/test/ui/no-implicit-prelude.stderr | 22 +- 21 files changed, 557 insertions(+), 332 deletions(-) delete mode 100644 src/test/compile-fail/no-implicit-prelude-nested.rs delete mode 100644 src/test/compile-fail/no-implicit-prelude.rs rename src/test/{compile-fail => ui/attributes}/no-prelude-nested.rs (57%) create mode 100644 src/test/ui/attributes/no-prelude-nested.stderr rename src/test/{compile-fail => ui/attributes}/no-prelude.rs (52%) create mode 100644 src/test/ui/attributes/no-prelude.stderr diff --git a/compiler/rustc_feature/src/builtin_attrs.rs b/compiler/rustc_feature/src/builtin_attrs.rs index 52a4af7de6f5f..2995eb6d02cf5 100644 --- a/compiler/rustc_feature/src/builtin_attrs.rs +++ b/compiler/rustc_feature/src/builtin_attrs.rs @@ -263,7 +263,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ )), gated!( no_prelude, Normal, template!(Word), - "replacement for #![no_implicit_prelude] that is not inherited by descendants" + "experimental feature: replacement for #![no_implicit_prelude] that is not inherited by descendants" ), ungated!(non_exhaustive, AssumedUsed, template!(Word)), diff --git a/src/test/compile-fail/feature-gate-no_prelude.rs b/src/test/compile-fail/feature-gate-no_prelude.rs index e1a415945074d..fcee4b9458a94 100644 --- a/src/test/compile-fail/feature-gate-no_prelude.rs +++ b/src/test/compile-fail/feature-gate-no_prelude.rs @@ -1,2 +1,4 @@ -#![no_prelude] //~ ERROR: experimental feature +#![no_prelude] //~ ERROR: experimental feature: replacement for #![no_implicit_prelude] //~^ HELP: feature(no_prelude) + +fn main(){} diff --git a/src/test/compile-fail/no-implicit-prelude-nested.rs b/src/test/compile-fail/no-implicit-prelude-nested.rs deleted file mode 100644 index 2f0d48aa88cda..0000000000000 --- a/src/test/compile-fail/no-implicit-prelude-nested.rs +++ /dev/null @@ -1,57 +0,0 @@ -// Test that things from the prelude aren't in scope. Use many of them -// so that renaming some things won't magically make this test fail -// for the wrong reason (e.g. if `Add` changes to `Addition`, and -// `no_implicit_prelude` stops working, then the `impl Add` will still -// fail with the same error message). - -#[no_implicit_prelude] -//~^ WARNING: deprecated -//~^^ WARNING: deprecated -mod foo { - mod baz { - struct Test; - impl Add for Test {} //~ ERROR: not in scope - impl Clone for Test {} //~ ERROR: not in scope - impl Iterator for Test {} //~ ERROR: not in scope - impl ToString for Test {} //~ ERROR: not in scope - impl Writer for Test {} //~ ERROR: not in scope - - fn foo() { - drop(2) //~ ERROR: unresolved name - } - } - - struct Test; - impl Add for Test {} //~ ERROR: not in scope - impl Clone for Test {} //~ ERROR: not in scope - impl Iterator for Test {} //~ ERROR: not in scope - impl ToString for Test {} //~ ERROR: not in scope - impl Writer for Test {} //~ ERROR: not in scope - - fn foo() { - drop(2) //~ ERROR: unresolved name - } -} - -fn qux() { - #[no_implicit_prelude] - //~^ WARNING: deprecated - //~^^ WARNING: deprecated - mod qux_inner { - struct Test; - impl Add for Test {} //~ ERROR: not in scope - impl Clone for Test {} //~ ERROR: not in scope - impl Iterator for Test {} //~ ERROR: not in scope - impl ToString for Test {} //~ ERROR: not in scope - impl Writer for Test {} //~ ERROR: not in scope - - fn foo() { - drop(2) //~ ERROR: unresolved name - } - } -} - -fn main() { - // these should work fine - drop(2) -} diff --git a/src/test/compile-fail/no-implicit-prelude.rs b/src/test/compile-fail/no-implicit-prelude.rs deleted file mode 100644 index b8afba4380dfe..0000000000000 --- a/src/test/compile-fail/no-implicit-prelude.rs +++ /dev/null @@ -1,20 +0,0 @@ -#![no_implicit_prelude] -//~^ WARN deprecated -//~^^ WARN deprecated - -// Test that things from the prelude aren't in scope. Use many of them -// so that renaming some things won't magically make this test fail -// for the wrong reason (e.g. if `Add` changes to `Addition`, and -// `no_implicit_prelude` stops working, then the `impl Add` will still -// fail with the same error message). - -struct Test; -impl Add for Test {} //~ ERROR: not in scope -impl Clone for Test {} //~ ERROR: not in scope -impl Iterator for Test {} //~ ERROR: not in scope -impl ToString for Test {} //~ ERROR: not in scope -impl Writer for Test {} //~ ERROR: not in scope - -fn main() { - drop(2) //~ ERROR: unresolved name -} diff --git a/src/test/ui/associated-types/associated-types-issue-20346.stderr b/src/test/ui/associated-types/associated-types-issue-20346.stderr index 7193d4163b9ce..5711be43a8095 100644 --- a/src/test/ui/associated-types/associated-types-issue-20346.stderr +++ b/src/test/ui/associated-types/associated-types-issue-20346.stderr @@ -1,5 +1,5 @@ error[E0271]: type mismatch resolving ` as Iterator>::Item == Option` - --> $DIR/associated-types-issue-20346.rs:34:5 + --> $DIR/associated-types-issue-20346.rs:35:5 | LL | fn is_iterator_of>(_: &I) {} | ------ required by this bound in `is_iterator_of` diff --git a/src/test/compile-fail/no-prelude-nested.rs b/src/test/ui/attributes/no-prelude-nested.rs similarity index 57% rename from src/test/compile-fail/no-prelude-nested.rs rename to src/test/ui/attributes/no-prelude-nested.rs index df3df116cc30c..c90592b2b12c8 100644 --- a/src/test/compile-fail/no-prelude-nested.rs +++ b/src/test/ui/attributes/no-prelude-nested.rs @@ -31,14 +31,14 @@ mod foo { } struct Test; - impl From for Test {} //~ ERROR: not in scope - impl Clone for Test {} //~ ERROR: not in scope - impl Iterator for Test {} //~ ERROR: not in scope - impl ToString for Test {} //~ ERROR: not in scope - impl Eq for Test {} //~ ERROR: not in scope + impl From for Test {} //~ ERROR: cannot find trait + impl Clone for Test {} //~ ERROR: expected trait, found derive macro + impl Iterator for Test {} //~ ERROR: cannot find trait + impl ToString for Test {} //~ ERROR: cannot find trait + impl Eq for Test {} //~ ERROR: expected trait, found derive macro fn foo() { - drop(2) //~ ERROR: unresolved name + drop(2) //~ ERROR: cannot find function `drop` } } @@ -46,14 +46,13 @@ fn qux() { #[no_prelude] mod qux_inner { struct Test; - impl From for Test {} //~ ERROR: not in scope - impl Clone for Test {} //~ ERROR: not in scope - impl Iterator for Test {} //~ ERROR: not in scope - impl ToString for Test {} //~ ERROR: not in scope - impl Eq for Test {} //~ ERROR: not in scope - + impl From for Test {} //~ ERROR: cannot find trait + impl Clone for Test {} //~ ERROR: expected trait, found derive macro + impl Iterator for Test {} //~ ERROR: cannot find trait + impl ToString for Test {} //~ ERROR: cannot find trait + impl Eq for Test {} //~ ERROR: expected trait, found derive macro fn foo() { - drop(2) //~ ERROR: unresolved name + drop(2) //~ ERROR: cannot find function `drop` } } } diff --git a/src/test/ui/attributes/no-prelude-nested.stderr b/src/test/ui/attributes/no-prelude-nested.stderr new file mode 100644 index 0000000000000..a59f9a8168c89 --- /dev/null +++ b/src/test/ui/attributes/no-prelude-nested.stderr @@ -0,0 +1,136 @@ +error[E0405]: cannot find trait `From` in this scope + --> $DIR/no-prelude-nested.rs:34:10 + | +LL | impl From for Test {} + | ^^^^ not found in this scope + | +help: consider importing this trait + | +LL | use std::convert::From; + | + +error[E0404]: expected trait, found derive macro `Clone` + --> $DIR/no-prelude-nested.rs:35:10 + | +LL | impl Clone for Test {} + | ^^^^^ not a trait + | +help: consider importing this trait instead + | +LL | use std::clone::Clone; + | + +error[E0405]: cannot find trait `Iterator` in this scope + --> $DIR/no-prelude-nested.rs:36:10 + | +LL | impl Iterator for Test {} + | ^^^^^^^^ not found in this scope + | +help: consider importing this trait + | +LL | use std::iter::Iterator; + | + +error[E0405]: cannot find trait `ToString` in this scope + --> $DIR/no-prelude-nested.rs:37:10 + | +LL | impl ToString for Test {} + | ^^^^^^^^ not found in this scope + | +help: consider importing this trait + | +LL | use std::string::ToString; + | + +error[E0404]: expected trait, found derive macro `Eq` + --> $DIR/no-prelude-nested.rs:38:10 + | +LL | impl Eq for Test {} + | ^^ not a trait + | +help: consider importing this trait instead + | +LL | use std::cmp::Eq; + | + +error[E0425]: cannot find function `drop` in this scope + --> $DIR/no-prelude-nested.rs:41:9 + | +LL | drop(2) + | ^^^^ not found in this scope + | +help: consider importing this function + | +LL | use std::mem::drop; + | + +error[E0405]: cannot find trait `From` in this scope + --> $DIR/no-prelude-nested.rs:49:14 + | +LL | impl From for Test {} + | ^^^^ not found in this scope + | +help: consider importing this trait + | +LL | use std::convert::From; + | + +error[E0404]: expected trait, found derive macro `Clone` + --> $DIR/no-prelude-nested.rs:50:14 + | +LL | impl Clone for Test {} + | ^^^^^ not a trait + | +help: consider importing this trait instead + | +LL | use std::clone::Clone; + | + +error[E0405]: cannot find trait `Iterator` in this scope + --> $DIR/no-prelude-nested.rs:51:14 + | +LL | impl Iterator for Test {} + | ^^^^^^^^ not found in this scope + | +help: consider importing this trait + | +LL | use std::iter::Iterator; + | + +error[E0405]: cannot find trait `ToString` in this scope + --> $DIR/no-prelude-nested.rs:52:14 + | +LL | impl ToString for Test {} + | ^^^^^^^^ not found in this scope + | +help: consider importing this trait + | +LL | use std::string::ToString; + | + +error[E0404]: expected trait, found derive macro `Eq` + --> $DIR/no-prelude-nested.rs:53:14 + | +LL | impl Eq for Test {} + | ^^ not a trait + | +help: consider importing this trait instead + | +LL | use std::cmp::Eq; + | + +error[E0425]: cannot find function `drop` in this scope + --> $DIR/no-prelude-nested.rs:55:13 + | +LL | drop(2) + | ^^^^ not found in this scope + | +help: consider importing this function + | +LL | use std::mem::drop; + | + +error: aborting due to 12 previous errors + +Some errors have detailed explanations: E0404, E0405, E0425. +For more information about an error, try `rustc --explain E0404`. diff --git a/src/test/compile-fail/no-prelude.rs b/src/test/ui/attributes/no-prelude.rs similarity index 52% rename from src/test/compile-fail/no-prelude.rs rename to src/test/ui/attributes/no-prelude.rs index bbce17de512a9..ab39a1d5dbd05 100644 --- a/src/test/compile-fail/no-prelude.rs +++ b/src/test/ui/attributes/no-prelude.rs @@ -8,12 +8,12 @@ // fail with the same error message). struct Test; -impl Add for Test {} //~ ERROR: not in scope -impl Clone for Test {} //~ ERROR: not in scope -impl Iterator for Test {} //~ ERROR: not in scope -impl ToString for Test {} //~ ERROR: not in scope -impl Writer for Test {} //~ ERROR: not in scope +impl Add for Test {} //~ ERROR: cannot find trait +impl Clone for Test {} //~ ERROR: expected trait, found derive macro +impl Iterator for Test {} //~ ERROR: cannot find trait +impl ToString for Test {} //~ ERROR: cannot find trait +impl Writer for Test {} //~ ERROR: cannot find trait fn main() { - drop(2) //~ ERROR: unresolved name + drop(2) //~ ERROR: cannot find function `drop` } diff --git a/src/test/ui/attributes/no-prelude.stderr b/src/test/ui/attributes/no-prelude.stderr new file mode 100644 index 0000000000000..b77dcfbaa5a9b --- /dev/null +++ b/src/test/ui/attributes/no-prelude.stderr @@ -0,0 +1,65 @@ +error[E0405]: cannot find trait `Add` in this scope + --> $DIR/no-prelude.rs:11:6 + | +LL | impl Add for Test {} + | ^^^ not found in this scope + | +help: consider importing this trait + | +LL | use std::ops::Add; + | + +error[E0404]: expected trait, found derive macro `Clone` + --> $DIR/no-prelude.rs:12:6 + | +LL | impl Clone for Test {} + | ^^^^^ not a trait + | +help: consider importing this trait instead + | +LL | use std::clone::Clone; + | + +error[E0405]: cannot find trait `Iterator` in this scope + --> $DIR/no-prelude.rs:13:6 + | +LL | impl Iterator for Test {} + | ^^^^^^^^ not found in this scope + | +help: consider importing this trait + | +LL | use std::iter::Iterator; + | + +error[E0405]: cannot find trait `ToString` in this scope + --> $DIR/no-prelude.rs:14:6 + | +LL | impl ToString for Test {} + | ^^^^^^^^ not found in this scope + | +help: consider importing this trait + | +LL | use std::string::ToString; + | + +error[E0405]: cannot find trait `Writer` in this scope + --> $DIR/no-prelude.rs:15:6 + | +LL | impl Writer for Test {} + | ^^^^^^ not found in this scope + +error[E0425]: cannot find function `drop` in this scope + --> $DIR/no-prelude.rs:18:5 + | +LL | drop(2) + | ^^^^ not found in this scope + | +help: consider importing this function + | +LL | use std::mem::drop; + | + +error: aborting due to 6 previous errors + +Some errors have detailed explanations: E0404, E0405, E0425. +For more information about an error, try `rustc --explain E0404`. diff --git a/src/test/ui/attributes/register-attr-tool-prelude.rs b/src/test/ui/attributes/register-attr-tool-prelude.rs index d217a8146d2ac..3be7804626370 100644 --- a/src/test/ui/attributes/register-attr-tool-prelude.rs +++ b/src/test/ui/attributes/register-attr-tool-prelude.rs @@ -4,7 +4,8 @@ #![register_attr(attr)] #![register_tool(tool)] -#[no_implicit_prelude] +#![feature(no_prelude)] +#[no_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` diff --git a/src/test/ui/attributes/register-attr-tool-prelude.stderr b/src/test/ui/attributes/register-attr-tool-prelude.stderr index 905b661206a6b..6c4d4e3b179fa 100644 --- a/src/test/ui/attributes/register-attr-tool-prelude.stderr +++ b/src/test/ui/attributes/register-attr-tool-prelude.stderr @@ -1,11 +1,11 @@ error[E0433]: failed to resolve: use of undeclared crate or module `tool` - --> $DIR/register-attr-tool-prelude.rs:10:7 + --> $DIR/register-attr-tool-prelude.rs:11: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 + --> $DIR/register-attr-tool-prelude.rs:10:7 | LL | #[attr] | ^^^^ diff --git a/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs b/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs index 21f40524f63df..90a4c12edfe80 100644 --- a/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs +++ b/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs @@ -60,6 +60,8 @@ #![should_panic] //~ WARN unused attribute #![ignore] //~ WARN unused attribute #![no_implicit_prelude] +//~^ WARNING: deprecated attribute +//~| HELP: may be removed #![reexport_test_harness_main = "2900"] // see gated-link-args.rs // see issue-43106-gating-of-macro_escape.rs for crate-level; but non crate-level is below at "2700" @@ -398,21 +400,33 @@ mod ignore { #[no_implicit_prelude] //~^ WARN unused attribute +//~| WARNING: deprecated attribute +//~| HELP: may be removed mod no_implicit_prelude { mod inner { #![no_implicit_prelude] } //~^ WARN unused attribute + //~| WARNING: deprecated attribute + //~| HELP: may be removed #[no_implicit_prelude] fn f() { } //~^ WARN unused attribute + //~| WARNING: deprecated attribute + //~| HELP: may be removed #[no_implicit_prelude] struct S; //~^ WARN unused attribute + //~| WARNING: deprecated attribute + //~| HELP: may be removed #[no_implicit_prelude] type T = S; //~^ WARN unused attribute + //~| WARNING: deprecated attribute + //~| HELP: may be removed #[no_implicit_prelude] impl S { } //~^ WARN unused attribute + //~| WARNING: deprecated attribute + //~| HELP: may be removed } #[reexport_test_harness_main = "2900"] diff --git a/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr b/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr index c908d2589cf49..e95ce18aa398b 100644 --- a/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr +++ b/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr @@ -29,151 +29,151 @@ LL | #![deny(x5100)] | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:111:8 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:113:8 | LL | #[warn(x5400)] | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:114:25 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:116:25 | LL | mod inner { #![warn(x5400)] } | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:117:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:119:12 | LL | #[warn(x5400)] fn f() { } | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:120:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:122:12 | LL | #[warn(x5400)] struct S; | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:123:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:125:12 | LL | #[warn(x5400)] type T = S; | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:126:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:128:12 | LL | #[warn(x5400)] impl S { } | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:130:9 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:132:9 | LL | #[allow(x5300)] | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:133:26 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:135:26 | LL | mod inner { #![allow(x5300)] } | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:136:13 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:138:13 | LL | #[allow(x5300)] fn f() { } | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:139:13 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:141:13 | LL | #[allow(x5300)] struct S; | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:142:13 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:144:13 | LL | #[allow(x5300)] type T = S; | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:145:13 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:147:13 | LL | #[allow(x5300)] impl S { } | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:149:10 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:151:10 | LL | #[forbid(x5200)] | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:152:27 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:154:27 | LL | mod inner { #![forbid(x5200)] } | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:155:14 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:157:14 | LL | #[forbid(x5200)] fn f() { } | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:158:14 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:160:14 | LL | #[forbid(x5200)] struct S; | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:161:14 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:163:14 | LL | #[forbid(x5200)] type T = S; | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:164:14 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:166:14 | LL | #[forbid(x5200)] impl S { } | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:168:8 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:170:8 | LL | #[deny(x5100)] | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:171:25 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:173:25 | LL | mod inner { #![deny(x5100)] } | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:174:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:176:12 | LL | #[deny(x5100)] fn f() { } | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:177:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:179:12 | LL | #[deny(x5100)] struct S; | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:180:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:182:12 | LL | #[deny(x5100)] type T = S; | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:183:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:185:12 | LL | #[deny(x5100)] impl S { } | ^^^^^ warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:441:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:455:17 | LL | mod inner { #![macro_escape] } | ^^^^^^^^^^^^^^^^ @@ -181,13 +181,13 @@ 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:438:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:452:1 | LL | #[macro_escape] | ^^^^^^^^^^^^^^^ warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:228:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:230:17 | LL | mod inner { #![plugin_registrar] } | ^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version @@ -195,49 +195,91 @@ LL | mod inner { #![plugin_registrar] } = note: `#[warn(deprecated)]` on by default warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:236:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:238:5 | LL | #[plugin_registrar] struct S; | ^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:241:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:243:5 | LL | #[plugin_registrar] type T = S; | ^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:246:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:248:5 | LL | #[plugin_registrar] impl S { } | ^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:223:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:225:1 | LL | #[plugin_registrar] | ^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version +warning: use of deprecated attribute `no_implicit_prelude`: deprecated in favor of no_prelude. See https://github.com/rust-lang/rust/issues/20561 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:406:17 + | +LL | mod inner { #![no_implicit_prelude] } + | ^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version + +warning: use of deprecated attribute `no_implicit_prelude`: deprecated in favor of no_prelude. See https://github.com/rust-lang/rust/issues/20561 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:411:5 + | +LL | #[no_implicit_prelude] fn f() { } + | ^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version + +warning: use of deprecated attribute `no_implicit_prelude`: deprecated in favor of no_prelude. See https://github.com/rust-lang/rust/issues/20561 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:416:5 + | +LL | #[no_implicit_prelude] struct S; + | ^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version + +warning: use of deprecated attribute `no_implicit_prelude`: deprecated in favor of no_prelude. See https://github.com/rust-lang/rust/issues/20561 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:421:5 + | +LL | #[no_implicit_prelude] type T = S; + | ^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version + +warning: use of deprecated attribute `no_implicit_prelude`: deprecated in favor of no_prelude. See https://github.com/rust-lang/rust/issues/20561 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:426:5 + | +LL | #[no_implicit_prelude] impl S { } + | ^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version + +warning: use of deprecated attribute `no_implicit_prelude`: deprecated in favor of no_prelude. See https://github.com/rust-lang/rust/issues/20561 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:401:1 + | +LL | #[no_implicit_prelude] + | ^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version + warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:46:1 | LL | #![plugin_registrar] | ^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version +warning: use of deprecated attribute `no_implicit_prelude`: deprecated in favor of no_prelude. See https://github.com/rust-lang/rust/issues/20561 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:62:1 + | +LL | #![no_implicit_prelude] + | ^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version + warning: use of deprecated attribute `crate_id`: no longer used. - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:91:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:93:1 | LL | #![crate_id = "10"] | ^^^^^^^^^^^^^^^^^^^ help: remove this attribute warning: use of deprecated attribute `no_start`: no longer used. - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:100:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:102:1 | LL | #![no_start] | ^^^^^^^^^^^^ help: remove this attribute warning: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:333:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:335:1 | LL | #[no_mangle] | ^^^^^^^^^^^^ @@ -259,7 +301,7 @@ LL | #![warn(unused_attributes, unknown_lints)] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: attribute should be applied to a function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:500:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:514:1 | LL | #[cold] | ^^^^^^^ @@ -276,7 +318,7 @@ LL | | } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: attribute should be applied to a foreign function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:529:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:543:1 | LL | #[link_name = "1900"] | ^^^^^^^^^^^^^^^^^^^^^ @@ -293,7 +335,7 @@ LL | | } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:568:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:582:1 | LL | #[link_section = "1800"] | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -310,7 +352,7 @@ LL | | } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: attribute should be applied to a function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:69:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:71:1 | LL | #![cold] | ^^^^^^^^ @@ -318,7 +360,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: attribute should be applied to a foreign function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:73:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:75:1 | LL | #![link_name = "1900"] | ^^^^^^^^^^^^^^^^^^^^^^ @@ -326,7 +368,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: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:76:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:78:1 | LL | #![link_section = "1800"] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -334,7 +376,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: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:338:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:340:17 | LL | mod inner { #![no_mangle] } | ------------^^^^^^^^^^^^^-- not a function or static @@ -342,7 +384,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: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:345:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:347:5 | LL | #[no_mangle] struct S; | ^^^^^^^^^^^^ --------- not a function or static @@ -350,7 +392,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: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:350:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:352:5 | LL | #[no_mangle] type T = S; | ^^^^^^^^^^^^ ----------- not a function or static @@ -358,7 +400,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: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:355:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:357:5 | LL | #[no_mangle] impl S { } | ^^^^^^^^^^^^ ---------- not a function or static @@ -366,7 +408,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: attribute should be applied to a function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:506:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:520:17 | LL | mod inner { #![cold] } | ------------^^^^^^^^-- not a function @@ -374,7 +416,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: attribute should be applied to a function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:513:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:527:5 | LL | #[cold] struct S; | ^^^^^^^ --------- not a function @@ -382,7 +424,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: attribute should be applied to a function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:518:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:532:5 | LL | #[cold] type T = S; | ^^^^^^^ ----------- not a function @@ -390,7 +432,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: attribute should be applied to a function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:523:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:537:5 | LL | #[cold] impl S { } | ^^^^^^^ ---------- not a function @@ -398,7 +440,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: attribute should be applied to a foreign function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:535:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:549:5 | LL | #[link_name = "1900"] | ^^^^^^^^^^^^^^^^^^^^^ @@ -408,13 +450,13 @@ LL | extern "C" { } | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! help: try `#[link(name = "1900")]` instead - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:535:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:549:5 | LL | #[link_name = "1900"] | ^^^^^^^^^^^^^^^^^^^^^ warning: attribute should be applied to a foreign function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:542:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:556:17 | LL | mod inner { #![link_name="1900"] } | ------------^^^^^^^^^^^^^^^^^^^^-- not a foreign function or static @@ -422,7 +464,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: attribute should be applied to a foreign function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:547:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:561:5 | LL | #[link_name = "1900"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^ ---------- not a foreign function or static @@ -430,7 +472,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: attribute should be applied to a foreign function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:552:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:566:5 | LL | #[link_name = "1900"] struct S; | ^^^^^^^^^^^^^^^^^^^^^ --------- not a foreign function or static @@ -438,7 +480,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: attribute should be applied to a foreign function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:557:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:571:5 | LL | #[link_name = "1900"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^ ----------- not a foreign function or static @@ -446,7 +488,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: attribute should be applied to a foreign function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:562:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:576:5 | LL | #[link_name = "1900"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^ ---------- not a foreign function or static @@ -454,7 +496,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: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:574:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:588:17 | LL | mod inner { #![link_section="1800"] } | ------------^^^^^^^^^^^^^^^^^^^^^^^-- not a function or static @@ -462,7 +504,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: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:581:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:595:5 | LL | #[link_section = "1800"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^ --------- not a function or static @@ -470,7 +512,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: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:586:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:600:5 | LL | #[link_section = "1800"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^ ----------- not a function or static @@ -478,7 +520,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: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:591:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:605:5 | LL | #[link_section = "1800"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^ ---------- not a function or static @@ -486,7 +528,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: the feature `rust1` has been stable since 1.0.0 and no longer requires an attribute to enable - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:96:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:98:12 | LL | #![feature(rust1)] | ^^^^^ @@ -494,823 +536,823 @@ LL | #![feature(rust1)] = note: `#[warn(stable_features)]` on by default warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:191:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:193:5 | LL | #[macro_use] fn f() { } | ^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:194:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:196:5 | LL | #[macro_use] struct S; | ^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:197:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:199:5 | LL | #[macro_use] type T = S; | ^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:200:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:202:5 | LL | #[macro_use] impl S { } | ^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:207:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:209:17 | LL | mod inner { #![macro_export] } | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:210:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:212:5 | LL | #[macro_export] fn f() { } | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:213:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:215:5 | LL | #[macro_export] struct S; | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:216:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:218:5 | LL | #[macro_export] type T = S; | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:219:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:221:5 | LL | #[macro_export] impl S { } | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:204:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:206:1 | LL | #[macro_export] | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:228:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:230:17 | LL | mod inner { #![plugin_registrar] } | ^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:236:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:238:5 | LL | #[plugin_registrar] struct S; | ^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:241:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:243:5 | LL | #[plugin_registrar] type T = S; | ^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:246:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:248:5 | LL | #[plugin_registrar] impl S { } | ^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:223:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:225:1 | LL | #[plugin_registrar] | ^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:301:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:303:5 | LL | #[path = "3800"] fn f() { } | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:304:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:306:5 | LL | #[path = "3800"] struct S; | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:307:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:309:5 | LL | #[path = "3800"] type T = S; | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:310:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:312:5 | LL | #[path = "3800"] impl S { } | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:317:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:319:17 | LL | mod inner { #![automatically_derived] } | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:320:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:322:5 | LL | #[automatically_derived] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:323:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:325:5 | LL | #[automatically_derived] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:326:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:328:5 | LL | #[automatically_derived] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:329:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:331:5 | LL | #[automatically_derived] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:314:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:316:1 | LL | #[automatically_derived] | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:364:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:366:17 | LL | mod inner { #![should_panic] } | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:367:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:369:5 | LL | #[should_panic] fn f() { } | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:370:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:372:5 | LL | #[should_panic] struct S; | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:373:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:375:5 | LL | #[should_panic] type T = S; | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:376:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:378:5 | LL | #[should_panic] impl S { } | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:361:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:363:1 | LL | #[should_panic] | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:383:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:385:17 | LL | mod inner { #![ignore] } | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:386:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:388:5 | LL | #[ignore] fn f() { } | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:389:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:391:5 | LL | #[ignore] struct S; | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:392:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:394:5 | LL | #[ignore] type T = S; | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:395:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:397:5 | LL | #[ignore] impl S { } | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:380:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:382:1 | LL | #[ignore] | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:402:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:406:17 | LL | mod inner { #![no_implicit_prelude] } | ^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:405:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:411:5 | LL | #[no_implicit_prelude] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:408:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:416:5 | LL | #[no_implicit_prelude] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:411:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:421:5 | LL | #[no_implicit_prelude] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:414:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:426:5 | LL | #[no_implicit_prelude] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:399:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:401:1 | LL | #[no_implicit_prelude] | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:421:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:435:17 | LL | mod inner { #![reexport_test_harness_main="2900"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:424:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:438:5 | LL | #[reexport_test_harness_main = "2900"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:427:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:441:5 | LL | #[reexport_test_harness_main = "2900"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:430:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:444:5 | LL | #[reexport_test_harness_main = "2900"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:433:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:447:5 | LL | #[reexport_test_harness_main = "2900"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:418:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:432:1 | LL | #[reexport_test_harness_main = "2900"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:445:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:459:5 | LL | #[macro_escape] fn f() { } | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:448:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:462:5 | LL | #[macro_escape] struct S; | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:451:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:465:5 | LL | #[macro_escape] type T = S; | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:454:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:468:5 | LL | #[macro_escape] impl S { } | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:462:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:476:17 | LL | mod inner { #![no_std] } | ^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:462:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:476:17 | LL | mod inner { #![no_std] } | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:466:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:480:5 | LL | #[no_std] fn f() { } | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:466:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:480:5 | LL | #[no_std] fn f() { } | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:470:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:484:5 | LL | #[no_std] struct S; | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:470:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:484:5 | LL | #[no_std] struct S; | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:474:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:488:5 | LL | #[no_std] type T = S; | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:474:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:488:5 | LL | #[no_std] type T = S; | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:478:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:492:5 | LL | #[no_std] impl S { } | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:478:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:492:5 | LL | #[no_std] impl S { } | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:458:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:472:1 | LL | #[no_std] | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:458:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:472:1 | LL | #[no_std] | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:663:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:677:17 | LL | mod inner { #![crate_name="0900"] } | ^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:663:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:677:17 | LL | mod inner { #![crate_name="0900"] } | ^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:667:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:681:5 | LL | #[crate_name = "0900"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:667:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:681:5 | LL | #[crate_name = "0900"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:671:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:685:5 | LL | #[crate_name = "0900"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:671:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:685:5 | LL | #[crate_name = "0900"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:675:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:689:5 | LL | #[crate_name = "0900"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:675:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:689:5 | LL | #[crate_name = "0900"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:679:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:693:5 | LL | #[crate_name = "0900"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:679:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:693:5 | LL | #[crate_name = "0900"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:659:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:673:1 | LL | #[crate_name = "0900"] | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:659:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:673:1 | LL | #[crate_name = "0900"] | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:688:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:702:17 | LL | mod inner { #![crate_type="0800"] } | ^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:688:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:702:17 | LL | mod inner { #![crate_type="0800"] } | ^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:692:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:706:5 | LL | #[crate_type = "0800"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:692:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:706:5 | LL | #[crate_type = "0800"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:696:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:710:5 | LL | #[crate_type = "0800"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:696:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:710:5 | LL | #[crate_type = "0800"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:700:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:714:5 | LL | #[crate_type = "0800"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:700:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:714:5 | LL | #[crate_type = "0800"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:704:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:718:5 | LL | #[crate_type = "0800"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:704:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:718:5 | LL | #[crate_type = "0800"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:684:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:698:1 | LL | #[crate_type = "0800"] | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:684:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:698:1 | LL | #[crate_type = "0800"] | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:713:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:727:17 | LL | mod inner { #![feature(x0600)] } | ^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:713:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:727:17 | LL | mod inner { #![feature(x0600)] } | ^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:717:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:731:5 | LL | #[feature(x0600)] fn f() { } | ^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:717:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:731:5 | LL | #[feature(x0600)] fn f() { } | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:721:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:735:5 | LL | #[feature(x0600)] struct S; | ^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:721:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:735:5 | LL | #[feature(x0600)] struct S; | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:725:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:739:5 | LL | #[feature(x0600)] type T = S; | ^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:725:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:739:5 | LL | #[feature(x0600)] type T = S; | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:729:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:743:5 | LL | #[feature(x0600)] impl S { } | ^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:729:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:743:5 | LL | #[feature(x0600)] impl S { } | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:709:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:723:1 | LL | #[feature(x0600)] | ^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:709:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:723:1 | LL | #[feature(x0600)] | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:739:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:753:17 | LL | mod inner { #![no_main] } | ^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:739:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:753:17 | LL | mod inner { #![no_main] } | ^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:743:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:757:5 | LL | #[no_main] fn f() { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:743:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:757:5 | LL | #[no_main] fn f() { } | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:747:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:761:5 | LL | #[no_main] struct S; | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:747:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:761:5 | LL | #[no_main] struct S; | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:751:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:765:5 | LL | #[no_main] type T = S; | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:751:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:765:5 | LL | #[no_main] type T = S; | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:755:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:769:5 | LL | #[no_main] impl S { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:755:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:769:5 | LL | #[no_main] impl S { } | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:735:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:749:1 | LL | #[no_main] | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:735:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:749:1 | LL | #[no_main] | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:777:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:791:17 | LL | mod inner { #![recursion_limit="0200"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:777:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:791:17 | LL | mod inner { #![recursion_limit="0200"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:781:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:795:5 | LL | #[recursion_limit="0200"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:781:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:795:5 | LL | #[recursion_limit="0200"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:785:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:799:5 | LL | #[recursion_limit="0200"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:785:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:799:5 | LL | #[recursion_limit="0200"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:789:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:803:5 | LL | #[recursion_limit="0200"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:789:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:803:5 | LL | #[recursion_limit="0200"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:793:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:807:5 | LL | #[recursion_limit="0200"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:793:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:807:5 | LL | #[recursion_limit="0200"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:773:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:787:1 | LL | #[recursion_limit="0200"] | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:773:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:787:1 | LL | #[recursion_limit="0200"] | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:802:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:816:17 | LL | mod inner { #![type_length_limit="0100"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:802:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:816:17 | LL | mod inner { #![type_length_limit="0100"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:806:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:820:5 | LL | #[type_length_limit="0100"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:806:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:820:5 | LL | #[type_length_limit="0100"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:810:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:824:5 | LL | #[type_length_limit="0100"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:810:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:824:5 | LL | #[type_length_limit="0100"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:814:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:828:5 | LL | #[type_length_limit="0100"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:814:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:828:5 | LL | #[type_length_limit="0100"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:818:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:832:5 | LL | #[type_length_limit="0100"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:818:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:832:5 | LL | #[type_length_limit="0100"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:798:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:812:1 | LL | #[type_length_limit="0100"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:798:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:812:1 | LL | #[type_length_limit="0100"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1334,10 +1376,10 @@ LL | #![ignore] | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:67:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:69:1 | LL | #![proc_macro_derive()] | ^^^^^^^^^^^^^^^^^^^^^^^ -warning: 205 warnings emitted +warning: 212 warnings emitted diff --git a/src/test/ui/hygiene/no_implicit_prelude-2018.rs b/src/test/ui/hygiene/no_implicit_prelude-2018.rs index 83ca28167a468..30bc697a2b315 100644 --- a/src/test/ui/hygiene/no_implicit_prelude-2018.rs +++ b/src/test/ui/hygiene/no_implicit_prelude-2018.rs @@ -1,6 +1,7 @@ // edition:2018 #[no_implicit_prelude] +//~^ WARNING: deprecated mod bar { fn f() { ::std::print!(""); // OK diff --git a/src/test/ui/hygiene/no_implicit_prelude-2018.stderr b/src/test/ui/hygiene/no_implicit_prelude-2018.stderr index 02ddc391f6e3c..6c7cba91aa74c 100644 --- a/src/test/ui/hygiene/no_implicit_prelude-2018.stderr +++ b/src/test/ui/hygiene/no_implicit_prelude-2018.stderr @@ -1,5 +1,5 @@ error: cannot find macro `print` in this scope - --> $DIR/no_implicit_prelude-2018.rs:7:9 + --> $DIR/no_implicit_prelude-2018.rs:8:9 | LL | print!(); | ^^^^^ @@ -7,5 +7,13 @@ LL | print!(); = note: consider importing this macro: std::print -error: aborting due to previous error +warning: use of deprecated attribute `no_implicit_prelude`: deprecated in favor of no_prelude. See https://github.com/rust-lang/rust/issues/20561 + --> $DIR/no_implicit_prelude-2018.rs:3:1 + | +LL | #[no_implicit_prelude] + | ^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version + | + = note: `#[warn(deprecated)]` on by default + +error: aborting due to previous error; 1 warning emitted diff --git a/src/test/ui/hygiene/no_implicit_prelude.rs b/src/test/ui/hygiene/no_implicit_prelude.rs index e23826e9d4ef6..c20ff5d46276d 100644 --- a/src/test/ui/hygiene/no_implicit_prelude.rs +++ b/src/test/ui/hygiene/no_implicit_prelude.rs @@ -6,6 +6,7 @@ mod foo { } #[no_implicit_prelude] +//~^ WARNING: deprecated mod bar { pub macro m() { Vec::new(); //~ ERROR failed to resolve diff --git a/src/test/ui/hygiene/no_implicit_prelude.stderr b/src/test/ui/hygiene/no_implicit_prelude.stderr index 835ecce94b97a..457de7100ca8b 100644 --- a/src/test/ui/hygiene/no_implicit_prelude.stderr +++ b/src/test/ui/hygiene/no_implicit_prelude.stderr @@ -1,5 +1,5 @@ error[E0433]: failed to resolve: use of undeclared type `Vec` - --> $DIR/no_implicit_prelude.rs:11:9 + --> $DIR/no_implicit_prelude.rs:12:9 | LL | fn f() { ::bar::m!(); } | ------------ in this macro invocation @@ -13,8 +13,16 @@ help: consider importing this struct LL | use std::vec::Vec; | +warning: use of deprecated attribute `no_implicit_prelude`: deprecated in favor of no_prelude. See https://github.com/rust-lang/rust/issues/20561 + --> $DIR/no_implicit_prelude.rs:8:1 + | +LL | #[no_implicit_prelude] + | ^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version + | + = note: `#[warn(deprecated)]` on by default + error[E0599]: no method named `clone` found for unit type `()` in the current scope - --> $DIR/no_implicit_prelude.rs:12:12 + --> $DIR/no_implicit_prelude.rs:13:12 | LL | fn f() { ::bar::m!(); } | ------------ in this macro invocation @@ -27,7 +35,7 @@ LL | ().clone() `use std::clone::Clone;` = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to 2 previous errors +error: aborting due to 2 previous errors; 1 warning emitted Some errors have detailed explanations: E0433, E0599. For more information about an error, try `rustc --explain E0433`. diff --git a/src/test/ui/no-implicit-prelude-nested.rs b/src/test/ui/no-implicit-prelude-nested.rs index c314967da4fb7..d085612b3ad88 100644 --- a/src/test/ui/no-implicit-prelude-nested.rs +++ b/src/test/ui/no-implicit-prelude-nested.rs @@ -5,6 +5,7 @@ // fail with the same error message). #[no_implicit_prelude] +//~^ WARNING: deprecated mod foo { mod baz { struct Test; @@ -33,6 +34,7 @@ mod foo { fn qux() { #[no_implicit_prelude] + //~^ WARNING: deprecated mod qux_inner { struct Test; impl Add for Test {} //~ ERROR cannot find trait `Add` in this scope diff --git a/src/test/ui/no-implicit-prelude-nested.stderr b/src/test/ui/no-implicit-prelude-nested.stderr index 198b630c52c8f..5666662f29084 100644 --- a/src/test/ui/no-implicit-prelude-nested.stderr +++ b/src/test/ui/no-implicit-prelude-nested.stderr @@ -1,5 +1,5 @@ error[E0405]: cannot find trait `Add` in this scope - --> $DIR/no-implicit-prelude-nested.rs:11:14 + --> $DIR/no-implicit-prelude-nested.rs:12:14 | LL | impl Add for Test {} | ^^^ not found in this scope @@ -10,7 +10,7 @@ LL | use std::ops::Add; | error[E0404]: expected trait, found derive macro `Clone` - --> $DIR/no-implicit-prelude-nested.rs:12:14 + --> $DIR/no-implicit-prelude-nested.rs:13:14 | LL | impl Clone for Test {} | ^^^^^ not a trait @@ -21,7 +21,7 @@ LL | use std::clone::Clone; | error[E0405]: cannot find trait `Iterator` in this scope - --> $DIR/no-implicit-prelude-nested.rs:13:14 + --> $DIR/no-implicit-prelude-nested.rs:14:14 | LL | impl Iterator for Test {} | ^^^^^^^^ not found in this scope @@ -32,7 +32,7 @@ LL | use std::iter::Iterator; | error[E0405]: cannot find trait `ToString` in this scope - --> $DIR/no-implicit-prelude-nested.rs:14:14 + --> $DIR/no-implicit-prelude-nested.rs:15:14 | LL | impl ToString for Test {} | ^^^^^^^^ not found in this scope @@ -43,13 +43,13 @@ LL | use std::string::ToString; | error[E0405]: cannot find trait `Writer` in this scope - --> $DIR/no-implicit-prelude-nested.rs:15:14 + --> $DIR/no-implicit-prelude-nested.rs:16:14 | LL | impl Writer for Test {} | ^^^^^^ not found in this scope error[E0425]: cannot find function `drop` in this scope - --> $DIR/no-implicit-prelude-nested.rs:18:13 + --> $DIR/no-implicit-prelude-nested.rs:19:13 | LL | drop(2) | ^^^^ not found in this scope @@ -60,7 +60,7 @@ LL | use std::mem::drop; | error[E0405]: cannot find trait `Add` in this scope - --> $DIR/no-implicit-prelude-nested.rs:23:10 + --> $DIR/no-implicit-prelude-nested.rs:24:10 | LL | impl Add for Test {} | ^^^ not found in this scope @@ -71,7 +71,7 @@ LL | use std::ops::Add; | error[E0404]: expected trait, found derive macro `Clone` - --> $DIR/no-implicit-prelude-nested.rs:24:10 + --> $DIR/no-implicit-prelude-nested.rs:25:10 | LL | impl Clone for Test {} | ^^^^^ not a trait @@ -82,7 +82,7 @@ LL | use std::clone::Clone; | error[E0405]: cannot find trait `Iterator` in this scope - --> $DIR/no-implicit-prelude-nested.rs:25:10 + --> $DIR/no-implicit-prelude-nested.rs:26:10 | LL | impl Iterator for Test {} | ^^^^^^^^ not found in this scope @@ -93,7 +93,7 @@ LL | use std::iter::Iterator; | error[E0405]: cannot find trait `ToString` in this scope - --> $DIR/no-implicit-prelude-nested.rs:26:10 + --> $DIR/no-implicit-prelude-nested.rs:27:10 | LL | impl ToString for Test {} | ^^^^^^^^ not found in this scope @@ -104,13 +104,13 @@ LL | use std::string::ToString; | error[E0405]: cannot find trait `Writer` in this scope - --> $DIR/no-implicit-prelude-nested.rs:27:10 + --> $DIR/no-implicit-prelude-nested.rs:28:10 | LL | impl Writer for Test {} | ^^^^^^ not found in this scope error[E0425]: cannot find function `drop` in this scope - --> $DIR/no-implicit-prelude-nested.rs:30:9 + --> $DIR/no-implicit-prelude-nested.rs:31:9 | LL | drop(2) | ^^^^ not found in this scope @@ -121,7 +121,7 @@ LL | use std::mem::drop; | error[E0405]: cannot find trait `Add` in this scope - --> $DIR/no-implicit-prelude-nested.rs:38:14 + --> $DIR/no-implicit-prelude-nested.rs:40:14 | LL | impl Add for Test {} | ^^^ not found in this scope @@ -132,7 +132,7 @@ LL | use std::ops::Add; | error[E0404]: expected trait, found derive macro `Clone` - --> $DIR/no-implicit-prelude-nested.rs:39:14 + --> $DIR/no-implicit-prelude-nested.rs:41:14 | LL | impl Clone for Test {} | ^^^^^ not a trait @@ -143,7 +143,7 @@ LL | use std::clone::Clone; | error[E0405]: cannot find trait `Iterator` in this scope - --> $DIR/no-implicit-prelude-nested.rs:40:14 + --> $DIR/no-implicit-prelude-nested.rs:42:14 | LL | impl Iterator for Test {} | ^^^^^^^^ not found in this scope @@ -154,7 +154,7 @@ LL | use std::iter::Iterator; | error[E0405]: cannot find trait `ToString` in this scope - --> $DIR/no-implicit-prelude-nested.rs:41:14 + --> $DIR/no-implicit-prelude-nested.rs:43:14 | LL | impl ToString for Test {} | ^^^^^^^^ not found in this scope @@ -165,13 +165,13 @@ LL | use std::string::ToString; | error[E0405]: cannot find trait `Writer` in this scope - --> $DIR/no-implicit-prelude-nested.rs:42:14 + --> $DIR/no-implicit-prelude-nested.rs:44:14 | LL | impl Writer for Test {} | ^^^^^^ not found in this scope error[E0425]: cannot find function `drop` in this scope - --> $DIR/no-implicit-prelude-nested.rs:45:13 + --> $DIR/no-implicit-prelude-nested.rs:47:13 | LL | drop(2) | ^^^^ not found in this scope @@ -181,7 +181,21 @@ help: consider importing this function LL | use std::mem::drop; | -error: aborting due to 18 previous errors +warning: use of deprecated attribute `no_implicit_prelude`: deprecated in favor of no_prelude. See https://github.com/rust-lang/rust/issues/20561 + --> $DIR/no-implicit-prelude-nested.rs:7:1 + | +LL | #[no_implicit_prelude] + | ^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version + | + = note: `#[warn(deprecated)]` on by default + +warning: use of deprecated attribute `no_implicit_prelude`: deprecated in favor of no_prelude. See https://github.com/rust-lang/rust/issues/20561 + --> $DIR/no-implicit-prelude-nested.rs:36:5 + | +LL | #[no_implicit_prelude] + | ^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version + +error: aborting due to 18 previous errors; 2 warnings emitted Some errors have detailed explanations: E0404, E0405, E0425. For more information about an error, try `rustc --explain E0404`. diff --git a/src/test/ui/no-implicit-prelude.rs b/src/test/ui/no-implicit-prelude.rs index 4b0ca4d524e62..46ac7e7a144db 100644 --- a/src/test/ui/no-implicit-prelude.rs +++ b/src/test/ui/no-implicit-prelude.rs @@ -1,4 +1,5 @@ #![no_implicit_prelude] +//~^ WARNING: deprecated // Test that things from the prelude aren't in scope. Use many of them // so that renaming some things won't magically make this test fail diff --git a/src/test/ui/no-implicit-prelude.stderr b/src/test/ui/no-implicit-prelude.stderr index 36a9b65b7d161..3e36ac06ea6d7 100644 --- a/src/test/ui/no-implicit-prelude.stderr +++ b/src/test/ui/no-implicit-prelude.stderr @@ -1,5 +1,5 @@ error[E0405]: cannot find trait `Add` in this scope - --> $DIR/no-implicit-prelude.rs:10:6 + --> $DIR/no-implicit-prelude.rs:11:6 | LL | impl Add for Test {} | ^^^ not found in this scope @@ -10,7 +10,7 @@ LL | use std::ops::Add; | error[E0404]: expected trait, found derive macro `Clone` - --> $DIR/no-implicit-prelude.rs:11:6 + --> $DIR/no-implicit-prelude.rs:12:6 | LL | impl Clone for Test {} | ^^^^^ not a trait @@ -21,7 +21,7 @@ LL | use std::clone::Clone; | error[E0405]: cannot find trait `Iterator` in this scope - --> $DIR/no-implicit-prelude.rs:12:6 + --> $DIR/no-implicit-prelude.rs:13:6 | LL | impl Iterator for Test {} | ^^^^^^^^ not found in this scope @@ -32,7 +32,7 @@ LL | use std::iter::Iterator; | error[E0405]: cannot find trait `ToString` in this scope - --> $DIR/no-implicit-prelude.rs:13:6 + --> $DIR/no-implicit-prelude.rs:14:6 | LL | impl ToString for Test {} | ^^^^^^^^ not found in this scope @@ -43,13 +43,13 @@ LL | use std::string::ToString; | error[E0405]: cannot find trait `Writer` in this scope - --> $DIR/no-implicit-prelude.rs:14:6 + --> $DIR/no-implicit-prelude.rs:15:6 | LL | impl Writer for Test {} | ^^^^^^ not found in this scope error[E0425]: cannot find function `drop` in this scope - --> $DIR/no-implicit-prelude.rs:17:5 + --> $DIR/no-implicit-prelude.rs:18:5 | LL | drop(2) | ^^^^ not found in this scope @@ -59,7 +59,15 @@ help: consider importing this function LL | use std::mem::drop; | -error: aborting due to 6 previous errors +warning: use of deprecated attribute `no_implicit_prelude`: deprecated in favor of no_prelude. See https://github.com/rust-lang/rust/issues/20561 + --> $DIR/no-implicit-prelude.rs:1:1 + | +LL | #![no_implicit_prelude] + | ^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version + | + = note: `#[warn(deprecated)]` on by default + +error: aborting due to 6 previous errors; 1 warning emitted Some errors have detailed explanations: E0404, E0405, E0425. For more information about an error, try `rustc --explain E0404`. From 7d6a5d4ab01f322f6ca9d08b1e0c505a6431c02e Mon Sep 17 00:00:00 2001 From: Skgland Date: Mon, 28 Dec 2020 03:52:01 +0100 Subject: [PATCH 10/12] don't deprecate `no_implicit_prelude` --- compiler/rustc_feature/src/builtin_attrs.rs | 10 +- .../issue-43106-gating-of-builtin-attrs.rs | 14 - ...issue-43106-gating-of-builtin-attrs.stderr | 440 ++++++++---------- .../ui/hygiene/no_implicit_prelude-2018.rs | 1 - .../hygiene/no_implicit_prelude-2018.stderr | 12 +- src/test/ui/hygiene/no_implicit_prelude.rs | 1 - .../ui/hygiene/no_implicit_prelude.stderr | 14 +- src/test/ui/no-implicit-prelude-nested.rs | 2 - src/test/ui/no-implicit-prelude-nested.stderr | 52 +-- src/test/ui/no-implicit-prelude.rs | 1 - src/test/ui/no-implicit-prelude.stderr | 22 +- 11 files changed, 231 insertions(+), 338 deletions(-) diff --git a/compiler/rustc_feature/src/builtin_attrs.rs b/compiler/rustc_feature/src/builtin_attrs.rs index 2995eb6d02cf5..3899d0a7c7977 100644 --- a/compiler/rustc_feature/src/builtin_attrs.rs +++ b/compiler/rustc_feature/src/builtin_attrs.rs @@ -252,15 +252,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ // Modules, prelude, and resolution: ungated!(path, Normal, template!(NameValueStr: "file")), ungated!(no_std, CrateLevel, template!(Word)), - (sym::no_implicit_prelude, Normal, template!(Word), Gated( - Stability::Deprecated( - "https://github.com/rust-lang/rust/issues/20561", - Some("may be removed in a future compiler version"), - ), - sym::no_implicit_prelude, - "deprecated in favor of no_prelude", - |_|true - )), + ungated!(no_implicit_prelude, Normal, template!(Word)), gated!( no_prelude, Normal, template!(Word), "experimental feature: replacement for #![no_implicit_prelude] that is not inherited by descendants" diff --git a/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs b/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs index 90a4c12edfe80..21f40524f63df 100644 --- a/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs +++ b/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs @@ -60,8 +60,6 @@ #![should_panic] //~ WARN unused attribute #![ignore] //~ WARN unused attribute #![no_implicit_prelude] -//~^ WARNING: deprecated attribute -//~| HELP: may be removed #![reexport_test_harness_main = "2900"] // see gated-link-args.rs // see issue-43106-gating-of-macro_escape.rs for crate-level; but non crate-level is below at "2700" @@ -400,33 +398,21 @@ mod ignore { #[no_implicit_prelude] //~^ WARN unused attribute -//~| WARNING: deprecated attribute -//~| HELP: may be removed mod no_implicit_prelude { mod inner { #![no_implicit_prelude] } //~^ WARN unused attribute - //~| WARNING: deprecated attribute - //~| HELP: may be removed #[no_implicit_prelude] fn f() { } //~^ WARN unused attribute - //~| WARNING: deprecated attribute - //~| HELP: may be removed #[no_implicit_prelude] struct S; //~^ WARN unused attribute - //~| WARNING: deprecated attribute - //~| HELP: may be removed #[no_implicit_prelude] type T = S; //~^ WARN unused attribute - //~| WARNING: deprecated attribute - //~| HELP: may be removed #[no_implicit_prelude] impl S { } //~^ WARN unused attribute - //~| WARNING: deprecated attribute - //~| HELP: may be removed } #[reexport_test_harness_main = "2900"] diff --git a/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr b/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr index e95ce18aa398b..c908d2589cf49 100644 --- a/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr +++ b/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr @@ -29,151 +29,151 @@ LL | #![deny(x5100)] | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:113:8 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:111:8 | LL | #[warn(x5400)] | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:116:25 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:114:25 | LL | mod inner { #![warn(x5400)] } | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:119:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:117:12 | LL | #[warn(x5400)] fn f() { } | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:122:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:120:12 | LL | #[warn(x5400)] struct S; | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:125:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:123:12 | LL | #[warn(x5400)] type T = S; | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:128:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:126:12 | LL | #[warn(x5400)] impl S { } | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:132:9 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:130:9 | LL | #[allow(x5300)] | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:135:26 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:133:26 | LL | mod inner { #![allow(x5300)] } | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:138:13 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:136:13 | LL | #[allow(x5300)] fn f() { } | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:141:13 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:139:13 | LL | #[allow(x5300)] struct S; | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:144:13 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:142:13 | LL | #[allow(x5300)] type T = S; | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:147:13 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:145:13 | LL | #[allow(x5300)] impl S { } | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:151:10 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:149:10 | LL | #[forbid(x5200)] | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:154:27 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:152:27 | LL | mod inner { #![forbid(x5200)] } | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:157:14 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:155:14 | LL | #[forbid(x5200)] fn f() { } | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:160:14 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:158:14 | LL | #[forbid(x5200)] struct S; | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:163:14 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:161:14 | LL | #[forbid(x5200)] type T = S; | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:166:14 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:164:14 | LL | #[forbid(x5200)] impl S { } | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:170:8 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:168:8 | LL | #[deny(x5100)] | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:173:25 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:171:25 | LL | mod inner { #![deny(x5100)] } | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:176:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:174:12 | LL | #[deny(x5100)] fn f() { } | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:179:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:177:12 | LL | #[deny(x5100)] struct S; | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:182:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:180:12 | LL | #[deny(x5100)] type T = S; | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:185:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:183:12 | LL | #[deny(x5100)] impl S { } | ^^^^^ warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:455:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:441:17 | LL | mod inner { #![macro_escape] } | ^^^^^^^^^^^^^^^^ @@ -181,13 +181,13 @@ 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:452:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:438:1 | LL | #[macro_escape] | ^^^^^^^^^^^^^^^ warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:230:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:228:17 | LL | mod inner { #![plugin_registrar] } | ^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version @@ -195,91 +195,49 @@ LL | mod inner { #![plugin_registrar] } = note: `#[warn(deprecated)]` on by default warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:238:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:236:5 | LL | #[plugin_registrar] struct S; | ^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:243:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:241:5 | LL | #[plugin_registrar] type T = S; | ^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:248:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:246:5 | LL | #[plugin_registrar] impl S { } | ^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:225:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:223:1 | LL | #[plugin_registrar] | ^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version -warning: use of deprecated attribute `no_implicit_prelude`: deprecated in favor of no_prelude. See https://github.com/rust-lang/rust/issues/20561 - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:406:17 - | -LL | mod inner { #![no_implicit_prelude] } - | ^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - -warning: use of deprecated attribute `no_implicit_prelude`: deprecated in favor of no_prelude. See https://github.com/rust-lang/rust/issues/20561 - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:411:5 - | -LL | #[no_implicit_prelude] fn f() { } - | ^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - -warning: use of deprecated attribute `no_implicit_prelude`: deprecated in favor of no_prelude. See https://github.com/rust-lang/rust/issues/20561 - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:416:5 - | -LL | #[no_implicit_prelude] struct S; - | ^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - -warning: use of deprecated attribute `no_implicit_prelude`: deprecated in favor of no_prelude. See https://github.com/rust-lang/rust/issues/20561 - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:421:5 - | -LL | #[no_implicit_prelude] type T = S; - | ^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - -warning: use of deprecated attribute `no_implicit_prelude`: deprecated in favor of no_prelude. See https://github.com/rust-lang/rust/issues/20561 - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:426:5 - | -LL | #[no_implicit_prelude] impl S { } - | ^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - -warning: use of deprecated attribute `no_implicit_prelude`: deprecated in favor of no_prelude. See https://github.com/rust-lang/rust/issues/20561 - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:401:1 - | -LL | #[no_implicit_prelude] - | ^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:46:1 | LL | #![plugin_registrar] | ^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version -warning: use of deprecated attribute `no_implicit_prelude`: deprecated in favor of no_prelude. See https://github.com/rust-lang/rust/issues/20561 - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:62:1 - | -LL | #![no_implicit_prelude] - | ^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - warning: use of deprecated attribute `crate_id`: no longer used. - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:93:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:91:1 | LL | #![crate_id = "10"] | ^^^^^^^^^^^^^^^^^^^ help: remove this attribute warning: use of deprecated attribute `no_start`: no longer used. - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:102:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:100:1 | LL | #![no_start] | ^^^^^^^^^^^^ help: remove this attribute warning: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:335:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:333:1 | LL | #[no_mangle] | ^^^^^^^^^^^^ @@ -301,7 +259,7 @@ LL | #![warn(unused_attributes, unknown_lints)] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: attribute should be applied to a function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:514:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:500:1 | LL | #[cold] | ^^^^^^^ @@ -318,7 +276,7 @@ LL | | } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: attribute should be applied to a foreign function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:543:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:529:1 | LL | #[link_name = "1900"] | ^^^^^^^^^^^^^^^^^^^^^ @@ -335,7 +293,7 @@ LL | | } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:582:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:568:1 | LL | #[link_section = "1800"] | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -352,7 +310,7 @@ LL | | } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: attribute should be applied to a function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:71:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:69:1 | LL | #![cold] | ^^^^^^^^ @@ -360,7 +318,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: attribute should be applied to a foreign function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:75:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:73:1 | LL | #![link_name = "1900"] | ^^^^^^^^^^^^^^^^^^^^^^ @@ -368,7 +326,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: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:78:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:76:1 | LL | #![link_section = "1800"] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -376,7 +334,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: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:340:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:338:17 | LL | mod inner { #![no_mangle] } | ------------^^^^^^^^^^^^^-- not a function or static @@ -384,7 +342,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: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:347:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:345:5 | LL | #[no_mangle] struct S; | ^^^^^^^^^^^^ --------- not a function or static @@ -392,7 +350,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: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:352:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:350:5 | LL | #[no_mangle] type T = S; | ^^^^^^^^^^^^ ----------- not a function or static @@ -400,7 +358,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: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:357:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:355:5 | LL | #[no_mangle] impl S { } | ^^^^^^^^^^^^ ---------- not a function or static @@ -408,7 +366,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: attribute should be applied to a function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:520:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:506:17 | LL | mod inner { #![cold] } | ------------^^^^^^^^-- not a function @@ -416,7 +374,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: attribute should be applied to a function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:527:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:513:5 | LL | #[cold] struct S; | ^^^^^^^ --------- not a function @@ -424,7 +382,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: attribute should be applied to a function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:532:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:518:5 | LL | #[cold] type T = S; | ^^^^^^^ ----------- not a function @@ -432,7 +390,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: attribute should be applied to a function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:537:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:523:5 | LL | #[cold] impl S { } | ^^^^^^^ ---------- not a function @@ -440,7 +398,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: attribute should be applied to a foreign function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:549:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:535:5 | LL | #[link_name = "1900"] | ^^^^^^^^^^^^^^^^^^^^^ @@ -450,13 +408,13 @@ LL | extern "C" { } | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! help: try `#[link(name = "1900")]` instead - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:549:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:535:5 | LL | #[link_name = "1900"] | ^^^^^^^^^^^^^^^^^^^^^ warning: attribute should be applied to a foreign function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:556:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:542:17 | LL | mod inner { #![link_name="1900"] } | ------------^^^^^^^^^^^^^^^^^^^^-- not a foreign function or static @@ -464,7 +422,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: attribute should be applied to a foreign function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:561:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:547:5 | LL | #[link_name = "1900"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^ ---------- not a foreign function or static @@ -472,7 +430,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: attribute should be applied to a foreign function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:566:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:552:5 | LL | #[link_name = "1900"] struct S; | ^^^^^^^^^^^^^^^^^^^^^ --------- not a foreign function or static @@ -480,7 +438,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: attribute should be applied to a foreign function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:571:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:557:5 | LL | #[link_name = "1900"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^ ----------- not a foreign function or static @@ -488,7 +446,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: attribute should be applied to a foreign function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:576:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:562:5 | LL | #[link_name = "1900"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^ ---------- not a foreign function or static @@ -496,7 +454,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: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:588:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:574:17 | LL | mod inner { #![link_section="1800"] } | ------------^^^^^^^^^^^^^^^^^^^^^^^-- not a function or static @@ -504,7 +462,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: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:595:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:581:5 | LL | #[link_section = "1800"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^ --------- not a function or static @@ -512,7 +470,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: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:600:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:586:5 | LL | #[link_section = "1800"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^ ----------- not a function or static @@ -520,7 +478,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: attribute should be applied to a function or static - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:605:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:591:5 | LL | #[link_section = "1800"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^ ---------- not a function or static @@ -528,7 +486,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: the feature `rust1` has been stable since 1.0.0 and no longer requires an attribute to enable - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:98:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:96:12 | LL | #![feature(rust1)] | ^^^^^ @@ -536,823 +494,823 @@ LL | #![feature(rust1)] = note: `#[warn(stable_features)]` on by default warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:193:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:191:5 | LL | #[macro_use] fn f() { } | ^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:196:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:194:5 | LL | #[macro_use] struct S; | ^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:199:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:197:5 | LL | #[macro_use] type T = S; | ^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:202:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:200:5 | LL | #[macro_use] impl S { } | ^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:209:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:207:17 | LL | mod inner { #![macro_export] } | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:212:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:210:5 | LL | #[macro_export] fn f() { } | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:215:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:213:5 | LL | #[macro_export] struct S; | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:218:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:216:5 | LL | #[macro_export] type T = S; | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:221:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:219:5 | LL | #[macro_export] impl S { } | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:206:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:204:1 | LL | #[macro_export] | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:230:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:228:17 | LL | mod inner { #![plugin_registrar] } | ^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:238:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:236:5 | LL | #[plugin_registrar] struct S; | ^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:243:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:241:5 | LL | #[plugin_registrar] type T = S; | ^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:248:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:246:5 | LL | #[plugin_registrar] impl S { } | ^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:225:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:223:1 | LL | #[plugin_registrar] | ^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:303:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:301:5 | LL | #[path = "3800"] fn f() { } | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:306:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:304:5 | LL | #[path = "3800"] struct S; | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:309:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:307:5 | LL | #[path = "3800"] type T = S; | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:312:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:310:5 | LL | #[path = "3800"] impl S { } | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:319:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:317:17 | LL | mod inner { #![automatically_derived] } | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:322:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:320:5 | LL | #[automatically_derived] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:325:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:323:5 | LL | #[automatically_derived] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:328:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:326:5 | LL | #[automatically_derived] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:331:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:329:5 | LL | #[automatically_derived] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:316:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:314:1 | LL | #[automatically_derived] | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:366:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:364:17 | LL | mod inner { #![should_panic] } | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:369:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:367:5 | LL | #[should_panic] fn f() { } | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:372:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:370:5 | LL | #[should_panic] struct S; | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:375:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:373:5 | LL | #[should_panic] type T = S; | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:378:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:376:5 | LL | #[should_panic] impl S { } | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:363:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:361:1 | LL | #[should_panic] | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:385:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:383:17 | LL | mod inner { #![ignore] } | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:388:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:386:5 | LL | #[ignore] fn f() { } | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:391:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:389:5 | LL | #[ignore] struct S; | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:394:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:392:5 | LL | #[ignore] type T = S; | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:397:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:395:5 | LL | #[ignore] impl S { } | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:382:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:380:1 | LL | #[ignore] | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:406:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:402:17 | LL | mod inner { #![no_implicit_prelude] } | ^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:411:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:405:5 | LL | #[no_implicit_prelude] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:416:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:408:5 | LL | #[no_implicit_prelude] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:421:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:411:5 | LL | #[no_implicit_prelude] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:426:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:414:5 | LL | #[no_implicit_prelude] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:401:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:399:1 | LL | #[no_implicit_prelude] | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:435:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:421:17 | LL | mod inner { #![reexport_test_harness_main="2900"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:438:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:424:5 | LL | #[reexport_test_harness_main = "2900"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:441:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:427:5 | LL | #[reexport_test_harness_main = "2900"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:444:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:430:5 | LL | #[reexport_test_harness_main = "2900"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:447:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:433:5 | LL | #[reexport_test_harness_main = "2900"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:432:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:418:1 | LL | #[reexport_test_harness_main = "2900"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:459:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:445:5 | LL | #[macro_escape] fn f() { } | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:462:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:448:5 | LL | #[macro_escape] struct S; | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:465:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:451:5 | LL | #[macro_escape] type T = S; | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:468:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:454:5 | LL | #[macro_escape] impl S { } | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:476:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:462:17 | LL | mod inner { #![no_std] } | ^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:476:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:462:17 | LL | mod inner { #![no_std] } | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:480:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:466:5 | LL | #[no_std] fn f() { } | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:480:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:466:5 | LL | #[no_std] fn f() { } | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:484:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:470:5 | LL | #[no_std] struct S; | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:484:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:470:5 | LL | #[no_std] struct S; | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:488:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:474:5 | LL | #[no_std] type T = S; | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:488:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:474:5 | LL | #[no_std] type T = S; | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:492:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:478:5 | LL | #[no_std] impl S { } | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:492:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:478:5 | LL | #[no_std] impl S { } | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:472:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:458:1 | LL | #[no_std] | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:472:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:458:1 | LL | #[no_std] | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:677:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:663:17 | LL | mod inner { #![crate_name="0900"] } | ^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:677:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:663:17 | LL | mod inner { #![crate_name="0900"] } | ^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:681:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:667:5 | LL | #[crate_name = "0900"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:681:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:667:5 | LL | #[crate_name = "0900"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:685:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:671:5 | LL | #[crate_name = "0900"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:685:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:671:5 | LL | #[crate_name = "0900"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:689:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:675:5 | LL | #[crate_name = "0900"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:689:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:675:5 | LL | #[crate_name = "0900"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:693:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:679:5 | LL | #[crate_name = "0900"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:693:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:679:5 | LL | #[crate_name = "0900"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:673:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:659:1 | LL | #[crate_name = "0900"] | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:673:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:659:1 | LL | #[crate_name = "0900"] | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:702:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:688:17 | LL | mod inner { #![crate_type="0800"] } | ^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:702:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:688:17 | LL | mod inner { #![crate_type="0800"] } | ^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:706:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:692:5 | LL | #[crate_type = "0800"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:706:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:692:5 | LL | #[crate_type = "0800"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:710:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:696:5 | LL | #[crate_type = "0800"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:710:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:696:5 | LL | #[crate_type = "0800"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:714:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:700:5 | LL | #[crate_type = "0800"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:714:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:700:5 | LL | #[crate_type = "0800"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:718:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:704:5 | LL | #[crate_type = "0800"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:718:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:704:5 | LL | #[crate_type = "0800"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:698:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:684:1 | LL | #[crate_type = "0800"] | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:698:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:684:1 | LL | #[crate_type = "0800"] | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:727:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:713:17 | LL | mod inner { #![feature(x0600)] } | ^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:727:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:713:17 | LL | mod inner { #![feature(x0600)] } | ^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:731:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:717:5 | LL | #[feature(x0600)] fn f() { } | ^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:731:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:717:5 | LL | #[feature(x0600)] fn f() { } | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:735:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:721:5 | LL | #[feature(x0600)] struct S; | ^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:735:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:721:5 | LL | #[feature(x0600)] struct S; | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:739:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:725:5 | LL | #[feature(x0600)] type T = S; | ^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:739:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:725:5 | LL | #[feature(x0600)] type T = S; | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:743:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:729:5 | LL | #[feature(x0600)] impl S { } | ^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:743:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:729:5 | LL | #[feature(x0600)] impl S { } | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:723:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:709:1 | LL | #[feature(x0600)] | ^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:723:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:709:1 | LL | #[feature(x0600)] | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:753:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:739:17 | LL | mod inner { #![no_main] } | ^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:753:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:739:17 | LL | mod inner { #![no_main] } | ^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:757:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:743:5 | LL | #[no_main] fn f() { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:757:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:743:5 | LL | #[no_main] fn f() { } | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:761:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:747:5 | LL | #[no_main] struct S; | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:761:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:747:5 | LL | #[no_main] struct S; | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:765:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:751:5 | LL | #[no_main] type T = S; | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:765:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:751:5 | LL | #[no_main] type T = S; | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:769:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:755:5 | LL | #[no_main] impl S { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:769:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:755:5 | LL | #[no_main] impl S { } | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:749:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:735:1 | LL | #[no_main] | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:749:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:735:1 | LL | #[no_main] | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:791:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:777:17 | LL | mod inner { #![recursion_limit="0200"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:791:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:777:17 | LL | mod inner { #![recursion_limit="0200"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:795:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:781:5 | LL | #[recursion_limit="0200"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:795:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:781:5 | LL | #[recursion_limit="0200"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:799:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:785:5 | LL | #[recursion_limit="0200"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:799:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:785:5 | LL | #[recursion_limit="0200"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:803:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:789:5 | LL | #[recursion_limit="0200"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:803:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:789:5 | LL | #[recursion_limit="0200"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:807:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:793:5 | LL | #[recursion_limit="0200"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:807:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:793:5 | LL | #[recursion_limit="0200"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:787:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:773:1 | LL | #[recursion_limit="0200"] | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:787:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:773:1 | LL | #[recursion_limit="0200"] | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:816:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:802:17 | LL | mod inner { #![type_length_limit="0100"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:816:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:802:17 | LL | mod inner { #![type_length_limit="0100"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:820:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:806:5 | LL | #[type_length_limit="0100"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:820:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:806:5 | LL | #[type_length_limit="0100"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:824:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:810:5 | LL | #[type_length_limit="0100"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:824:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:810:5 | LL | #[type_length_limit="0100"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:828:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:814:5 | LL | #[type_length_limit="0100"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:828:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:814:5 | LL | #[type_length_limit="0100"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:832:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:818:5 | LL | #[type_length_limit="0100"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:832:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:818:5 | LL | #[type_length_limit="0100"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:812:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:798:1 | LL | #[type_length_limit="0100"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:812:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:798:1 | LL | #[type_length_limit="0100"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1376,10 +1334,10 @@ LL | #![ignore] | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:69:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:67:1 | LL | #![proc_macro_derive()] | ^^^^^^^^^^^^^^^^^^^^^^^ -warning: 212 warnings emitted +warning: 205 warnings emitted diff --git a/src/test/ui/hygiene/no_implicit_prelude-2018.rs b/src/test/ui/hygiene/no_implicit_prelude-2018.rs index 30bc697a2b315..83ca28167a468 100644 --- a/src/test/ui/hygiene/no_implicit_prelude-2018.rs +++ b/src/test/ui/hygiene/no_implicit_prelude-2018.rs @@ -1,7 +1,6 @@ // edition:2018 #[no_implicit_prelude] -//~^ WARNING: deprecated mod bar { fn f() { ::std::print!(""); // OK diff --git a/src/test/ui/hygiene/no_implicit_prelude-2018.stderr b/src/test/ui/hygiene/no_implicit_prelude-2018.stderr index 6c7cba91aa74c..02ddc391f6e3c 100644 --- a/src/test/ui/hygiene/no_implicit_prelude-2018.stderr +++ b/src/test/ui/hygiene/no_implicit_prelude-2018.stderr @@ -1,5 +1,5 @@ error: cannot find macro `print` in this scope - --> $DIR/no_implicit_prelude-2018.rs:8:9 + --> $DIR/no_implicit_prelude-2018.rs:7:9 | LL | print!(); | ^^^^^ @@ -7,13 +7,5 @@ LL | print!(); = note: consider importing this macro: std::print -warning: use of deprecated attribute `no_implicit_prelude`: deprecated in favor of no_prelude. See https://github.com/rust-lang/rust/issues/20561 - --> $DIR/no_implicit_prelude-2018.rs:3:1 - | -LL | #[no_implicit_prelude] - | ^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - -error: aborting due to previous error; 1 warning emitted +error: aborting due to previous error diff --git a/src/test/ui/hygiene/no_implicit_prelude.rs b/src/test/ui/hygiene/no_implicit_prelude.rs index c20ff5d46276d..e23826e9d4ef6 100644 --- a/src/test/ui/hygiene/no_implicit_prelude.rs +++ b/src/test/ui/hygiene/no_implicit_prelude.rs @@ -6,7 +6,6 @@ mod foo { } #[no_implicit_prelude] -//~^ WARNING: deprecated mod bar { pub macro m() { Vec::new(); //~ ERROR failed to resolve diff --git a/src/test/ui/hygiene/no_implicit_prelude.stderr b/src/test/ui/hygiene/no_implicit_prelude.stderr index 457de7100ca8b..835ecce94b97a 100644 --- a/src/test/ui/hygiene/no_implicit_prelude.stderr +++ b/src/test/ui/hygiene/no_implicit_prelude.stderr @@ -1,5 +1,5 @@ error[E0433]: failed to resolve: use of undeclared type `Vec` - --> $DIR/no_implicit_prelude.rs:12:9 + --> $DIR/no_implicit_prelude.rs:11:9 | LL | fn f() { ::bar::m!(); } | ------------ in this macro invocation @@ -13,16 +13,8 @@ help: consider importing this struct LL | use std::vec::Vec; | -warning: use of deprecated attribute `no_implicit_prelude`: deprecated in favor of no_prelude. See https://github.com/rust-lang/rust/issues/20561 - --> $DIR/no_implicit_prelude.rs:8:1 - | -LL | #[no_implicit_prelude] - | ^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - error[E0599]: no method named `clone` found for unit type `()` in the current scope - --> $DIR/no_implicit_prelude.rs:13:12 + --> $DIR/no_implicit_prelude.rs:12:12 | LL | fn f() { ::bar::m!(); } | ------------ in this macro invocation @@ -35,7 +27,7 @@ LL | ().clone() `use std::clone::Clone;` = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to 2 previous errors; 1 warning emitted +error: aborting due to 2 previous errors Some errors have detailed explanations: E0433, E0599. For more information about an error, try `rustc --explain E0433`. diff --git a/src/test/ui/no-implicit-prelude-nested.rs b/src/test/ui/no-implicit-prelude-nested.rs index d085612b3ad88..c314967da4fb7 100644 --- a/src/test/ui/no-implicit-prelude-nested.rs +++ b/src/test/ui/no-implicit-prelude-nested.rs @@ -5,7 +5,6 @@ // fail with the same error message). #[no_implicit_prelude] -//~^ WARNING: deprecated mod foo { mod baz { struct Test; @@ -34,7 +33,6 @@ mod foo { fn qux() { #[no_implicit_prelude] - //~^ WARNING: deprecated mod qux_inner { struct Test; impl Add for Test {} //~ ERROR cannot find trait `Add` in this scope diff --git a/src/test/ui/no-implicit-prelude-nested.stderr b/src/test/ui/no-implicit-prelude-nested.stderr index 5666662f29084..198b630c52c8f 100644 --- a/src/test/ui/no-implicit-prelude-nested.stderr +++ b/src/test/ui/no-implicit-prelude-nested.stderr @@ -1,5 +1,5 @@ error[E0405]: cannot find trait `Add` in this scope - --> $DIR/no-implicit-prelude-nested.rs:12:14 + --> $DIR/no-implicit-prelude-nested.rs:11:14 | LL | impl Add for Test {} | ^^^ not found in this scope @@ -10,7 +10,7 @@ LL | use std::ops::Add; | error[E0404]: expected trait, found derive macro `Clone` - --> $DIR/no-implicit-prelude-nested.rs:13:14 + --> $DIR/no-implicit-prelude-nested.rs:12:14 | LL | impl Clone for Test {} | ^^^^^ not a trait @@ -21,7 +21,7 @@ LL | use std::clone::Clone; | error[E0405]: cannot find trait `Iterator` in this scope - --> $DIR/no-implicit-prelude-nested.rs:14:14 + --> $DIR/no-implicit-prelude-nested.rs:13:14 | LL | impl Iterator for Test {} | ^^^^^^^^ not found in this scope @@ -32,7 +32,7 @@ LL | use std::iter::Iterator; | error[E0405]: cannot find trait `ToString` in this scope - --> $DIR/no-implicit-prelude-nested.rs:15:14 + --> $DIR/no-implicit-prelude-nested.rs:14:14 | LL | impl ToString for Test {} | ^^^^^^^^ not found in this scope @@ -43,13 +43,13 @@ LL | use std::string::ToString; | error[E0405]: cannot find trait `Writer` in this scope - --> $DIR/no-implicit-prelude-nested.rs:16:14 + --> $DIR/no-implicit-prelude-nested.rs:15:14 | LL | impl Writer for Test {} | ^^^^^^ not found in this scope error[E0425]: cannot find function `drop` in this scope - --> $DIR/no-implicit-prelude-nested.rs:19:13 + --> $DIR/no-implicit-prelude-nested.rs:18:13 | LL | drop(2) | ^^^^ not found in this scope @@ -60,7 +60,7 @@ LL | use std::mem::drop; | error[E0405]: cannot find trait `Add` in this scope - --> $DIR/no-implicit-prelude-nested.rs:24:10 + --> $DIR/no-implicit-prelude-nested.rs:23:10 | LL | impl Add for Test {} | ^^^ not found in this scope @@ -71,7 +71,7 @@ LL | use std::ops::Add; | error[E0404]: expected trait, found derive macro `Clone` - --> $DIR/no-implicit-prelude-nested.rs:25:10 + --> $DIR/no-implicit-prelude-nested.rs:24:10 | LL | impl Clone for Test {} | ^^^^^ not a trait @@ -82,7 +82,7 @@ LL | use std::clone::Clone; | error[E0405]: cannot find trait `Iterator` in this scope - --> $DIR/no-implicit-prelude-nested.rs:26:10 + --> $DIR/no-implicit-prelude-nested.rs:25:10 | LL | impl Iterator for Test {} | ^^^^^^^^ not found in this scope @@ -93,7 +93,7 @@ LL | use std::iter::Iterator; | error[E0405]: cannot find trait `ToString` in this scope - --> $DIR/no-implicit-prelude-nested.rs:27:10 + --> $DIR/no-implicit-prelude-nested.rs:26:10 | LL | impl ToString for Test {} | ^^^^^^^^ not found in this scope @@ -104,13 +104,13 @@ LL | use std::string::ToString; | error[E0405]: cannot find trait `Writer` in this scope - --> $DIR/no-implicit-prelude-nested.rs:28:10 + --> $DIR/no-implicit-prelude-nested.rs:27:10 | LL | impl Writer for Test {} | ^^^^^^ not found in this scope error[E0425]: cannot find function `drop` in this scope - --> $DIR/no-implicit-prelude-nested.rs:31:9 + --> $DIR/no-implicit-prelude-nested.rs:30:9 | LL | drop(2) | ^^^^ not found in this scope @@ -121,7 +121,7 @@ LL | use std::mem::drop; | error[E0405]: cannot find trait `Add` in this scope - --> $DIR/no-implicit-prelude-nested.rs:40:14 + --> $DIR/no-implicit-prelude-nested.rs:38:14 | LL | impl Add for Test {} | ^^^ not found in this scope @@ -132,7 +132,7 @@ LL | use std::ops::Add; | error[E0404]: expected trait, found derive macro `Clone` - --> $DIR/no-implicit-prelude-nested.rs:41:14 + --> $DIR/no-implicit-prelude-nested.rs:39:14 | LL | impl Clone for Test {} | ^^^^^ not a trait @@ -143,7 +143,7 @@ LL | use std::clone::Clone; | error[E0405]: cannot find trait `Iterator` in this scope - --> $DIR/no-implicit-prelude-nested.rs:42:14 + --> $DIR/no-implicit-prelude-nested.rs:40:14 | LL | impl Iterator for Test {} | ^^^^^^^^ not found in this scope @@ -154,7 +154,7 @@ LL | use std::iter::Iterator; | error[E0405]: cannot find trait `ToString` in this scope - --> $DIR/no-implicit-prelude-nested.rs:43:14 + --> $DIR/no-implicit-prelude-nested.rs:41:14 | LL | impl ToString for Test {} | ^^^^^^^^ not found in this scope @@ -165,13 +165,13 @@ LL | use std::string::ToString; | error[E0405]: cannot find trait `Writer` in this scope - --> $DIR/no-implicit-prelude-nested.rs:44:14 + --> $DIR/no-implicit-prelude-nested.rs:42:14 | LL | impl Writer for Test {} | ^^^^^^ not found in this scope error[E0425]: cannot find function `drop` in this scope - --> $DIR/no-implicit-prelude-nested.rs:47:13 + --> $DIR/no-implicit-prelude-nested.rs:45:13 | LL | drop(2) | ^^^^ not found in this scope @@ -181,21 +181,7 @@ help: consider importing this function LL | use std::mem::drop; | -warning: use of deprecated attribute `no_implicit_prelude`: deprecated in favor of no_prelude. See https://github.com/rust-lang/rust/issues/20561 - --> $DIR/no-implicit-prelude-nested.rs:7:1 - | -LL | #[no_implicit_prelude] - | ^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - -warning: use of deprecated attribute `no_implicit_prelude`: deprecated in favor of no_prelude. See https://github.com/rust-lang/rust/issues/20561 - --> $DIR/no-implicit-prelude-nested.rs:36:5 - | -LL | #[no_implicit_prelude] - | ^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - -error: aborting due to 18 previous errors; 2 warnings emitted +error: aborting due to 18 previous errors Some errors have detailed explanations: E0404, E0405, E0425. For more information about an error, try `rustc --explain E0404`. diff --git a/src/test/ui/no-implicit-prelude.rs b/src/test/ui/no-implicit-prelude.rs index 46ac7e7a144db..4b0ca4d524e62 100644 --- a/src/test/ui/no-implicit-prelude.rs +++ b/src/test/ui/no-implicit-prelude.rs @@ -1,5 +1,4 @@ #![no_implicit_prelude] -//~^ WARNING: deprecated // Test that things from the prelude aren't in scope. Use many of them // so that renaming some things won't magically make this test fail diff --git a/src/test/ui/no-implicit-prelude.stderr b/src/test/ui/no-implicit-prelude.stderr index 3e36ac06ea6d7..36a9b65b7d161 100644 --- a/src/test/ui/no-implicit-prelude.stderr +++ b/src/test/ui/no-implicit-prelude.stderr @@ -1,5 +1,5 @@ error[E0405]: cannot find trait `Add` in this scope - --> $DIR/no-implicit-prelude.rs:11:6 + --> $DIR/no-implicit-prelude.rs:10:6 | LL | impl Add for Test {} | ^^^ not found in this scope @@ -10,7 +10,7 @@ LL | use std::ops::Add; | error[E0404]: expected trait, found derive macro `Clone` - --> $DIR/no-implicit-prelude.rs:12:6 + --> $DIR/no-implicit-prelude.rs:11:6 | LL | impl Clone for Test {} | ^^^^^ not a trait @@ -21,7 +21,7 @@ LL | use std::clone::Clone; | error[E0405]: cannot find trait `Iterator` in this scope - --> $DIR/no-implicit-prelude.rs:13:6 + --> $DIR/no-implicit-prelude.rs:12:6 | LL | impl Iterator for Test {} | ^^^^^^^^ not found in this scope @@ -32,7 +32,7 @@ LL | use std::iter::Iterator; | error[E0405]: cannot find trait `ToString` in this scope - --> $DIR/no-implicit-prelude.rs:14:6 + --> $DIR/no-implicit-prelude.rs:13:6 | LL | impl ToString for Test {} | ^^^^^^^^ not found in this scope @@ -43,13 +43,13 @@ LL | use std::string::ToString; | error[E0405]: cannot find trait `Writer` in this scope - --> $DIR/no-implicit-prelude.rs:15:6 + --> $DIR/no-implicit-prelude.rs:14:6 | LL | impl Writer for Test {} | ^^^^^^ not found in this scope error[E0425]: cannot find function `drop` in this scope - --> $DIR/no-implicit-prelude.rs:18:5 + --> $DIR/no-implicit-prelude.rs:17:5 | LL | drop(2) | ^^^^ not found in this scope @@ -59,15 +59,7 @@ help: consider importing this function LL | use std::mem::drop; | -warning: use of deprecated attribute `no_implicit_prelude`: deprecated in favor of no_prelude. See https://github.com/rust-lang/rust/issues/20561 - --> $DIR/no-implicit-prelude.rs:1:1 - | -LL | #![no_implicit_prelude] - | ^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - -error: aborting due to 6 previous errors; 1 warning emitted +error: aborting due to 6 previous errors Some errors have detailed explanations: E0404, E0405, E0425. For more information about an error, try `rustc --explain E0404`. From 9005a0b3f07af2ab37807ca6cdf1743257e91b13 Mon Sep 17 00:00:00 2001 From: Skgland Date: Tue, 29 Dec 2020 22:30:46 +0100 Subject: [PATCH 11/12] move feature gate test to where the other feature gate testes are --- .../feature-gates}/feature-gate-no_prelude.rs | 0 .../ui/feature-gates/feature-gate-no_prelude.stderr | 12 ++++++++++++ 2 files changed, 12 insertions(+) rename src/test/{compile-fail => ui/feature-gates}/feature-gate-no_prelude.rs (100%) create mode 100644 src/test/ui/feature-gates/feature-gate-no_prelude.stderr diff --git a/src/test/compile-fail/feature-gate-no_prelude.rs b/src/test/ui/feature-gates/feature-gate-no_prelude.rs similarity index 100% rename from src/test/compile-fail/feature-gate-no_prelude.rs rename to src/test/ui/feature-gates/feature-gate-no_prelude.rs diff --git a/src/test/ui/feature-gates/feature-gate-no_prelude.stderr b/src/test/ui/feature-gates/feature-gate-no_prelude.stderr new file mode 100644 index 0000000000000..f5dfce5d35e59 --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-no_prelude.stderr @@ -0,0 +1,12 @@ +error[E0658]: experimental feature: replacement for #![no_implicit_prelude] that is not inherited by descendants + --> $DIR/feature-gate-no_prelude.rs:1:1 + | +LL | #![no_prelude] + | ^^^^^^^^^^^^^^ + | + = note: see issue #20561 for more information + = help: add `#![feature(no_prelude)]` to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. From 2fdbd7882635b4d21d8e8a627516c75088922b86 Mon Sep 17 00:00:00 2001 From: Skgland Date: Thu, 31 Dec 2020 15:56:53 +0100 Subject: [PATCH 12/12] short circuit local_no_prelude evaluation so that #![no_prelude] is not marked as used when it is implied by #![no_implicit_prelude] --- .../rustc_resolve/src/build_reduced_graph.rs | 5 +++-- compiler/rustc_resolve/src/lib.rs | 5 +++-- src/test/ui/unused/unused-no_prelude.rs | 12 +++++++++++ src/test/ui/unused/unused-no_prelude.stderr | 20 +++++++++++++++++++ 4 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 src/test/ui/unused/unused-no_prelude.rs create mode 100644 src/test/ui/unused/unused-no_prelude.stderr diff --git a/compiler/rustc_resolve/src/build_reduced_graph.rs b/compiler/rustc_resolve/src/build_reduced_graph.rs index 74b665d133b2b..bbbdf44a1f041 100644 --- a/compiler/rustc_resolve/src/build_reduced_graph.rs +++ b/compiler/rustc_resolve/src/build_reduced_graph.rs @@ -763,10 +763,11 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> { let module_kind = ModuleKind::Def(DefKind::Mod, def_id, ident.name); let inheritable_no_prelude = parent.pass_on_no_prelude || self.r.session.contains_name(&item.attrs, sym::no_implicit_prelude); - let local_no_prelude = self.r.session.contains_name(&item.attrs, sym::no_prelude); + let local_no_prelude = inheritable_no_prelude + || self.r.session.contains_name(&item.attrs, sym::no_prelude); let module = self.r.arenas.alloc_module(ModuleData { pass_on_no_prelude: inheritable_no_prelude, - no_prelude: inheritable_no_prelude || local_no_prelude, + no_prelude: local_no_prelude, ..ModuleData::new(Some(parent), module_kind, def_id, expansion, item.span) }); self.r.define(parent, ident, TypeNS, (module, vis, sp, expansion)); diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index 6652d8541a4c0..371168c986960 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -1214,10 +1214,11 @@ impl<'a> Resolver<'a> { let root_def_id = root_local_def_id.to_def_id(); let root_module_kind = ModuleKind::Def(DefKind::Mod, root_def_id, kw::Empty); let inheritable_no_prelude = session.contains_name(&krate.attrs, sym::no_implicit_prelude); - let local_no_prelude = session.contains_name(&krate.attrs, sym::no_prelude); + let local_no_prelude = + inheritable_no_prelude || session.contains_name(&krate.attrs, sym::no_prelude); let graph_root = arenas.alloc_module(ModuleData { pass_on_no_prelude: inheritable_no_prelude, - no_prelude: local_no_prelude || inheritable_no_prelude, + no_prelude: local_no_prelude, ..ModuleData::new(None, root_module_kind, root_def_id, ExpnId::root(), krate.span) }); let empty_module_kind = ModuleKind::Def(DefKind::Mod, root_def_id, kw::Empty); diff --git a/src/test/ui/unused/unused-no_prelude.rs b/src/test/ui/unused/unused-no_prelude.rs new file mode 100644 index 0000000000000..766cd274d4274 --- /dev/null +++ b/src/test/ui/unused/unused-no_prelude.rs @@ -0,0 +1,12 @@ +#![no_implicit_prelude] +#![feature(no_prelude)] +#![deny(unused_attributes)] +#![no_prelude] +//~^ ERROR: unused attribute + +mod unused { + #![no_prelude] + //~^ ERROR: unused attribute +} + +fn main() {} diff --git a/src/test/ui/unused/unused-no_prelude.stderr b/src/test/ui/unused/unused-no_prelude.stderr new file mode 100644 index 0000000000000..7e1411d651ab7 --- /dev/null +++ b/src/test/ui/unused/unused-no_prelude.stderr @@ -0,0 +1,20 @@ +error: unused attribute + --> $DIR/unused-no_prelude.rs:8:5 + | +LL | #![no_prelude] + | ^^^^^^^^^^^^^^ + | +note: the lint level is defined here + --> $DIR/unused-no_prelude.rs:3:9 + | +LL | #![deny(unused_attributes)] + | ^^^^^^^^^^^^^^^^^ + +error: unused attribute + --> $DIR/unused-no_prelude.rs:4:1 + | +LL | #![no_prelude] + | ^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors +