]> git.lizzy.rs Git - rust.git/commitdiff
Stabilize `use_extern_macros`
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>
Mon, 14 May 2018 00:22:52 +0000 (03:22 +0300)
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>
Fri, 17 Aug 2018 10:14:26 +0000 (13:14 +0300)
82 files changed:
src/librustc_resolve/build_reduced_graph.rs
src/librustc_resolve/check_unused.rs
src/librustc_resolve/lib.rs
src/librustc_resolve/macros.rs
src/librustc_resolve/resolve_imports.rs
src/libstd/lib.rs
src/libsyntax/ext/expand.rs
src/libsyntax/feature_gate.rs
src/test/compile-fail-fulldeps/proc-macro/attribute-with-error.rs
src/test/compile-fail-fulldeps/proc-macro/attributes-included.rs
src/test/compile-fail-fulldeps/proc-macro/issue-41211.rs
src/test/compile-fail-fulldeps/proc-macro/macro-use-attr.rs
src/test/compile-fail-fulldeps/proc-macro/macros-in-extern.rs
src/test/compile-fail-fulldeps/proc-macro/more-gates.rs
src/test/compile-fail-fulldeps/proc-macro/no-macro-use-attr.rs
src/test/run-pass-fulldeps/proc-macro/attr-args.rs
src/test/run-pass-fulldeps/proc-macro/attr-cfg.rs
src/test/run-pass-fulldeps/proc-macro/attr-on-trait.rs
src/test/run-pass-fulldeps/proc-macro/auxiliary/hygiene_example.rs
src/test/run-pass-fulldeps/proc-macro/derive-attr-cfg.rs
src/test/run-pass-fulldeps/proc-macro/derive-two-attrs.rs
src/test/run-pass-fulldeps/proc-macro/gen-lifetime-token.rs
src/test/run-pass-fulldeps/proc-macro/issue-39889.rs
src/test/run-pass-fulldeps/proc-macro/lifetimes.rs
src/test/run-pass-fulldeps/proc-macro/modify-ast.rs
src/test/run-pass-fulldeps/proc-macro/not-joint.rs
src/test/run-pass-fulldeps/proc-macro/span-api-tests.rs
src/test/run-pass/auxiliary/issue_38715-modern.rs
src/test/run-pass/paths-in-macro-invocations.rs
src/test/run-pass/use-macro-self.rs
src/test/rustdoc/cross-crate-links.rs
src/test/rustdoc/inline_cross/macro-vis.rs
src/test/rustdoc/inline_cross/macros.rs
src/test/rustdoc/pub-use-extern-macros.rs
src/test/ui-fulldeps/proc-macro/attribute-spans-preserved.rs
src/test/ui-fulldeps/proc-macro/attribute-spans-preserved.stderr
src/test/ui-fulldeps/proc-macro/macro-brackets.rs
src/test/ui-fulldeps/proc-macro/macro-brackets.stderr
src/test/ui-fulldeps/proc-macro/macro-namespace-reserved-2.rs
src/test/ui-fulldeps/proc-macro/macro-namespace-reserved-2.stderr
src/test/ui-fulldeps/proc-macro/nested-item-spans.rs
src/test/ui-fulldeps/proc-macro/nested-item-spans.stderr
src/test/ui/duplicate/duplicate-check-macro-exports.rs
src/test/ui/duplicate/duplicate-check-macro-exports.stderr
src/test/ui/extern/extern-macro.rs
src/test/ui/extern/extern-macro.stderr
src/test/ui/feature-gates/feature-gate-tool_attributes.rs
src/test/ui/feature-gates/feature-gate-tool_attributes.stderr
src/test/ui/hygiene/local_inner_macros.rs
src/test/ui/hygiene/local_inner_macros_disabled.rs [deleted file]
src/test/ui/hygiene/local_inner_macros_disabled.stderr [deleted file]
src/test/ui/imports/local-modularized-tricky-fail-3.rs
src/test/ui/imports/local-modularized-tricky-fail-3.stderr
src/test/ui/imports/local-modularized-tricky-pass.rs
src/test/ui/imports/local-modularized.rs
src/test/ui/imports/macro-paths.rs
src/test/ui/imports/macro-paths.stderr
src/test/ui/imports/macros.rs
src/test/ui/imports/macros.stderr
src/test/ui/imports/shadow_builtin_macros.rs
src/test/ui/imports/shadow_builtin_macros.stderr
src/test/ui/macros/macro-path-prelude-fail-1.rs
src/test/ui/macros/macro-path-prelude-fail-2.rs
src/test/ui/macros/macro-path-prelude-fail-2.stderr
src/test/ui/macros/macro-path-prelude-fail-3.rs
src/test/ui/macros/macro-path-prelude-fail-3.stderr
src/test/ui/macros/macro-path-prelude-pass.rs
src/test/ui/macros/macro-reexport-removed.stderr
src/test/ui/macros/macro-with-seps-err-msg.rs [deleted file]
src/test/ui/macros/macro-with-seps-err-msg.stderr [deleted file]
src/test/ui/macros/macro_undefined.rs
src/test/ui/macros/macro_undefined.stderr
src/test/ui/macros/macros-nonfatal-errors.rs
src/test/ui/macros/macros-nonfatal-errors.stderr
src/test/ui/no-link.rs
src/test/ui/no-link.stderr
src/test/ui/rust-2018/macro-use-warned-against.rs
src/test/ui/rust-2018/macro-use-warned-against.stderr
src/test/ui/tool-attributes/tool-attributes-disabled-1.rs [deleted file]
src/test/ui/tool-attributes/tool-attributes-disabled-1.stderr [deleted file]
src/test/ui/tool-attributes/tool-attributes-disabled-2.rs [deleted file]
src/test/ui/tool-attributes/tool-attributes-disabled-2.stderr [deleted file]

index fa2af891f109b86770589ecda50eb36dbdac87b7..19dc35f854eed5bbf6a05f977e11f7b77c0bbfe3 100644 (file)
@@ -833,19 +833,12 @@ fn process_legacy_macro_imports(&mut self, item: &Item, module: Module<'a>, expa
                                     -> bool {
         let allow_shadowing = expansion == Mark::root();
         let legacy_imports = self.legacy_macro_imports(&item.attrs);
-        let mut used = legacy_imports != LegacyMacroImports::default();
+        let used = legacy_imports != LegacyMacroImports::default();
 
         // `#[macro_use]` is only allowed at the crate root.
         if self.current_module.parent.is_some() && used {
             span_err!(self.session, item.span, E0468,
                       "an `extern crate` loading macros must be at the crate root");
-        } else if !self.use_extern_macros && !used &&
-                  self.cstore.dep_kind_untracked(module.def_id().unwrap().krate)
-                      .macros_only() {
-            let msg = "proc macro crates and `#[no_link]` crates have no effect without \
-                       `#[macro_use]`";
-            self.session.span_warn(item.span, msg);
-            used = true; // Avoid the normal unused extern crate warning
         }
 
         let (graph_root, arenas) = (self.graph_root, self.arenas);
index e1b059d2b733f30670ad6ae1eadd0982dcb5c83e..77005a83e42c3113a6629002efda842c71ef7f04 100644 (file)
@@ -131,7 +131,7 @@ pub fn check_crate(resolver: &mut Resolver, krate: &ast::Crate) {
                  directive.vis.get() == ty::Visibility::Public ||
                  directive.span.is_dummy() => {
                 if let ImportDirectiveSubclass::MacroUse = directive.subclass {
-                    if resolver.use_extern_macros && !directive.span.is_dummy() {
+                    if !directive.span.is_dummy() {
                         resolver.session.buffer_lint(
                             lint::builtin::MACRO_USE_EXTERN_CRATE,
                             directive.id,
index 992ea12ffa2b14c44dde94f4fdfc303ac356d791..ba9e8d685d1be56f0853b08181d84efd884207e8 100644 (file)
@@ -80,7 +80,7 @@
 use rustc_data_structures::sync::Lrc;
 
 use resolve_imports::{ImportDirective, ImportDirectiveSubclass, NameResolution, ImportResolver};
-use macros::{InvocationData, LegacyBinding, LegacyScope, MacroBinding};
+use macros::{InvocationData, LegacyBinding, MacroBinding};
 
 // NB: This module needs to be declared first so diagnostics are
 // registered before they are used.
@@ -1399,23 +1399,18 @@ pub struct Resolver<'a, 'b: 'a> {
     /// crate-local macro expanded `macro_export` referred to by a module-relative path
     macro_expanded_macro_export_errors: BTreeSet<(Span, Span)>,
 
-    gated_errors: FxHashSet<Span>,
     disallowed_shadowing: Vec<&'a LegacyBinding<'a>>,
 
     arenas: &'a ResolverArenas<'a>,
     dummy_binding: &'a NameBinding<'a>,
-    /// true if `#![feature(use_extern_macros)]`
-    use_extern_macros: bool,
 
     crate_loader: &'a mut CrateLoader<'b>,
     macro_names: FxHashSet<Ident>,
     macro_prelude: FxHashMap<Name, &'a NameBinding<'a>>,
     pub all_macros: FxHashMap<Name, Def>,
-    lexical_macro_resolutions: Vec<(Ident, &'a Cell<LegacyScope<'a>>)>,
     macro_map: FxHashMap<DefId, Lrc<SyntaxExtension>>,
     macro_defs: FxHashMap<Mark, DefId>,
     local_macro_def_scopes: FxHashMap<NodeId, Module<'a>>,
-    macro_exports: Vec<Export>, // FIXME: Remove when `use_extern_macros` is stabilized
     pub whitelisted_legacy_custom_derives: Vec<Name>,
     pub found_unresolved_macro: bool,
 
@@ -1657,8 +1652,6 @@ pub fn new(session: &'a Session,
         invocations.insert(Mark::root(),
                            arenas.alloc_invocation_data(InvocationData::root(graph_root)));
 
-        let features = session.features_untracked();
-
         let mut macro_defs = FxHashMap();
         macro_defs.insert(Mark::root(), root_def_id);
 
@@ -1717,7 +1710,6 @@ pub fn new(session: &'a Session,
             ambiguity_errors: Vec::new(),
             use_injections: Vec::new(),
             proc_mac_errors: Vec::new(),
-            gated_errors: FxHashSet(),
             disallowed_shadowing: Vec::new(),
             macro_expanded_macro_export_errors: BTreeSet::new(),
 
@@ -1729,15 +1721,11 @@ pub fn new(session: &'a Session,
                 vis: ty::Visibility::Public,
             }),
 
-            use_extern_macros: features.use_extern_macros(),
-
             crate_loader,
             macro_names: FxHashSet(),
             macro_prelude: FxHashMap(),
             all_macros: FxHashMap(),
-            lexical_macro_resolutions: Vec::new(),
             macro_map: FxHashMap(),
-            macro_exports: Vec::new(),
             invocations,
             macro_defs,
             local_macro_def_scopes: FxHashMap(),
@@ -1770,9 +1758,7 @@ pub fn arenas() -> ResolverArenas<'a> {
     fn per_ns<F: FnMut(&mut Self, Namespace)>(&mut self, mut f: F) {
         f(self, TypeNS);
         f(self, ValueNS);
-        if self.use_extern_macros {
-            f(self, MacroNS);
-        }
+        f(self, MacroNS);
     }
 
     fn macro_def(&self, mut ctxt: SyntaxContext) -> DefId {
@@ -2186,11 +2172,8 @@ fn search_label<P, R>(&self, mut ident: Ident, pred: P) -> Option<R>
 
     fn resolve_item(&mut self, item: &Item) {
         let name = item.ident.name;
-
         debug!("(resolving item) resolving {}", name);
 
-        self.check_proc_macro_attrs(&item.attrs);
-
         match item.node {
             ItemKind::Enum(_, ref generics) |
             ItemKind::Ty(_, ref generics) |
@@ -2218,8 +2201,6 @@ fn resolve_item(&mut self, item: &Item) {
                         walk_list!(this, visit_param_bound, bounds);
 
                         for trait_item in trait_items {
-                            this.check_proc_macro_attrs(&trait_item.attrs);
-
                             let type_parameters = HasTypeParameters(&trait_item.generics,
                                                                     TraitOrImplItemRibKind);
                             this.with_type_parameter_rib(type_parameters, |this| {
@@ -2498,7 +2479,6 @@ fn resolve_implementation(&mut self,
                         this.visit_generics(generics);
                         this.with_current_self_type(self_type, |this| {
                             for impl_item in impl_items {
-                                this.check_proc_macro_attrs(&impl_item.attrs);
                                 this.resolve_visibility(&impl_item.vis);
 
                                 // We also need a new scope for the impl item type parameters.
@@ -4495,10 +4475,6 @@ fn report_with_use_injections(&mut self, krate: &Crate) {
     }
 
     fn report_shadowing_errors(&mut self) {
-        for (ident, scope) in replace(&mut self.lexical_macro_resolutions, Vec::new()) {
-            self.resolve_legacy_scope(scope, ident, true);
-        }
-
         let mut reported_errors = FxHashSet();
         for binding in replace(&mut self.disallowed_shadowing, Vec::new()) {
             if self.resolve_legacy_scope(&binding.parent, binding.ident, false).is_some() &&
@@ -4619,36 +4595,6 @@ fn report_conflict<'b>(&mut self,
         err.emit();
         self.name_already_seen.insert(name, span);
     }
-
-    fn check_proc_macro_attrs(&mut self, attrs: &[ast::Attribute]) {
-        if self.use_extern_macros { return; }
-
-        for attr in attrs {
-            if attr.path.segments.len() > 1 {
-                continue
-            }
-            let ident = attr.path.segments[0].ident;
-            let result = self.resolve_lexical_macro_path_segment(ident,
-                                                                 MacroNS,
-                                                                 false,
-                                                                 false,
-                                                                 true,
-                                                                 attr.path.span);
-            if let Ok(binding) = result {
-                if let SyntaxExtension::AttrProcMacro(..) = *binding.binding().get_macro(self) {
-                    attr::mark_known(attr);
-
-                    let msg = "attribute procedural macros are experimental";
-                    let feature = "use_extern_macros";
-
-                    feature_err(&self.session.parse_sess, feature,
-                                attr.span, GateIssue::Language, msg)
-                        .span_label(binding.span(), "procedural macro imported here")
-                        .emit();
-                }
-            }
-        }
-    }
 }
 
 fn is_self_type(path: &[Ident], namespace: Namespace) -> bool {
index 44d0c888c5dd248bc63b80dd3a397e7731db9b75..8f2e76d8866ddd2fbb18dce796c9a6ff7fdd503c 100644 (file)
@@ -16,7 +16,7 @@
 use resolve_imports::ImportResolver;
 use rustc::hir::def_id::{DefId, BUILTIN_MACROS_CRATE, CRATE_DEF_INDEX, DefIndex,
                          DefIndexAddressSpace};
-use rustc::hir::def::{Def, Export, NonMacroAttrKind};
+use rustc::hir::def::{Def, NonMacroAttrKind};
 use rustc::hir::map::{self, DefCollector};
 use rustc::{ty, lint};
 use rustc::middle::cstore::CrateStore;
@@ -524,21 +524,13 @@ pub fn resolve_macro_to_def_inner(&mut self, scope: Mark, path: &ast::Path,
         self.current_module = if module.is_trait() { module.parent.unwrap() } else { module };
 
         // Possibly apply the macro helper hack
-        if self.use_extern_macros && kind == MacroKind::Bang && path.len() == 1 &&
+        if kind == MacroKind::Bang && path.len() == 1 &&
            path[0].span.ctxt().outer().expn_info().map_or(false, |info| info.local_inner_macros) {
             let root = Ident::new(keywords::DollarCrate.name(), path[0].span);
             path.insert(0, root);
         }
 
         if path.len() > 1 {
-            if !self.use_extern_macros && self.gated_errors.insert(span) {
-                let msg = "non-ident macro paths are experimental";
-                let feature = "use_extern_macros";
-                emit_feature_err(&self.session.parse_sess, feature, span, GateIssue::Language, msg);
-                self.found_unresolved_macro = true;
-                return Err(Determinacy::Determined);
-            }
-
             let res = self.resolve_path(None, &path, Some(MacroNS), false, span, CrateLint::No);
             let def = match res {
                 PathResult::NonModule(path_res) => match path_res.base_def() {
@@ -843,7 +835,6 @@ pub fn resolve_legacy_scope(&mut self,
                                 record_used: bool)
                                 -> Option<MacroBinding<'a>> {
         let ident = ident.modern();
-        let mut possible_time_travel = None;
         let mut relative_depth: u32 = 0;
         let mut binding = None;
         loop {
@@ -853,9 +844,6 @@ pub fn resolve_legacy_scope(&mut self,
                     match invocation.expansion.get() {
                         LegacyScope::Invocation(_) => scope.set(invocation.legacy_scope.get()),
                         LegacyScope::Empty => {
-                            if possible_time_travel.is_none() {
-                                possible_time_travel = Some(scope);
-                            }
                             scope = &invocation.legacy_scope;
                         }
                         _ => {
@@ -870,7 +858,7 @@ pub fn resolve_legacy_scope(&mut self,
                 }
                 LegacyScope::Binding(potential_binding) => {
                     if potential_binding.ident == ident {
-                        if (!self.use_extern_macros || record_used) && relative_depth > 0 {
+                        if record_used && relative_depth > 0 {
                             self.disallowed_shadowing.push(potential_binding);
                         }
                         binding = Some(potential_binding);
@@ -884,21 +872,11 @@ pub fn resolve_legacy_scope(&mut self,
         let binding = if let Some(binding) = binding {
             MacroBinding::Legacy(binding)
         } else if let Some(binding) = self.macro_prelude.get(&ident.name).cloned() {
-            if !self.use_extern_macros {
-                self.record_use(ident, MacroNS, binding, DUMMY_SP);
-            }
             MacroBinding::Global(binding)
         } else {
             return None;
         };
 
-        if !self.use_extern_macros {
-            if let Some(scope) = possible_time_travel {
-                // Check for disallowed shadowing later
-                self.lexical_macro_resolutions.push((ident, scope));
-            }
-        }
-
         Some(binding)
     }
 
@@ -1008,9 +986,6 @@ fn suggest_macro_name(&mut self, name: &str, kind: MacroKind,
             find_best_match_for_name(names, name, None)
         // Then check modules.
         }).or_else(|| {
-            if !self.use_extern_macros {
-                return None;
-            }
             let is_macro = |def| {
                 if let Def::Macro(_, def_kind) = def {
                     def_kind == kind
@@ -1086,19 +1061,10 @@ pub fn define_macro(&mut self,
             let def = Def::Macro(def_id, MacroKind::Bang);
             self.all_macros.insert(ident.name, def);
             if attr::contains_name(&item.attrs, "macro_export") {
-                if self.use_extern_macros {
-                    let module = self.graph_root;
-                    let vis = ty::Visibility::Public;
-                    self.define(module, ident, MacroNS,
-                                (def, vis, item.span, expansion, IsMacroExport));
-                } else {
-                    self.macro_exports.push(Export {
-                        ident: ident.modern(),
-                        def: def,
-                        vis: ty::Visibility::Public,
-                        span: item.span,
-                    });
-                }
+                let module = self.graph_root;
+                let vis = ty::Visibility::Public;
+                self.define(module, ident, MacroNS,
+                            (def, vis, item.span, expansion, IsMacroExport));
             } else {
                 self.unused_macros.insert(def_id);
             }
index c70f52e91dbb6fe36967de867eeb6de354829789..e16039bc239c087a9757beb3a5bfc4858dde6ad1 100644 (file)
@@ -24,7 +24,7 @@
 use rustc::hir::def_id::{CRATE_DEF_INDEX, DefId};
 use rustc::hir::def::*;
 use rustc::session::DiagnosticMessageId;
-use rustc::util::nodemap::{FxHashMap, FxHashSet};
+use rustc::util::nodemap::FxHashSet;
 
 use syntax::ast::{Ident, Name, NodeId, CRATE_NODE_ID};
 use syntax::ext::base::Determinacy::{self, Determined, Undetermined};
@@ -1142,24 +1142,6 @@ fn finalize_resolutions_in(&mut self, module: Module<'b>) {
         *module.globs.borrow_mut() = Vec::new();
 
         let mut reexports = Vec::new();
-        let mut exported_macro_names = FxHashMap();
-        if ptr::eq(module, self.graph_root) {
-            let macro_exports = mem::replace(&mut self.macro_exports, Vec::new());
-            for export in macro_exports.into_iter().rev() {
-                if let Some(later_span) = exported_macro_names.insert(export.ident.modern(),
-                                                                      export.span) {
-                    self.session.buffer_lint_with_diagnostic(
-                        DUPLICATE_MACRO_EXPORTS,
-                        CRATE_NODE_ID,
-                        later_span,
-                        &format!("a macro named `{}` has already been exported", export.ident),
-                        BuiltinLintDiagnostics::DuplicatedMacroExports(
-                            export.ident, export.span, later_span));
-                } else {
-                    reexports.push(export);
-                }
-            }
-        }
 
         for (&(ident, ns), resolution) in module.resolutions.borrow().iter() {
             let resolution = &mut *resolution.borrow_mut();
@@ -1174,16 +1156,6 @@ fn finalize_resolutions_in(&mut self, module: Module<'b>) {
                     if !def.def_id().is_local() {
                         self.cstore.export_macros_untracked(def.def_id().krate);
                     }
-                    if let Def::Macro(..) = def {
-                        if let Some(&span) = exported_macro_names.get(&ident.modern()) {
-                            let msg =
-                                format!("a macro named `{}` has already been exported", ident);
-                            self.session.struct_span_err(span, &msg)
-                                .span_label(span, format!("`{}` already exported", ident))
-                                .span_note(binding.span, "previous macro export here")
-                                .emit();
-                        }
-                    }
                     reexports.push(Export {
                         ident: ident.modern(),
                         def: def,
index 60ad330bb9b72a280dd9f888de474e6888c916ba..b0069f826eefa68bb5b468ea41e1aae13912d71e 100644 (file)
 #![feature(unboxed_closures)]
 #![feature(untagged_unions)]
 #![feature(unwind_attributes)]
-#![feature(use_extern_macros)]
+#![cfg_attr(stage0, feature(use_extern_macros))]
 #![feature(doc_cfg)]
 #![feature(doc_masked)]
 #![feature(doc_spotlight)]
index f7ea781e0211538a97e7a821cc7f1f1c7c1549c0..90b46268045e7df77c021a30f06de5aa8a4a2d69 100644 (file)
@@ -1124,9 +1124,7 @@ fn classify_item<T>(&mut self, mut item: T) -> (Option<ast::Attribute>, Vec<Path
                 return attrs;
             }
 
-            if self.cx.ecfg.use_extern_macros_enabled() {
-                attr = find_attr_invoc(&mut attrs);
-            }
+            attr = find_attr_invoc(&mut attrs);
             traits = collect_derives(&mut self.cx, &mut attrs);
             attrs
         });
@@ -1147,9 +1145,7 @@ fn classify_nonitem<T: HasAttrs>(&mut self, mut item: T) -> (Option<ast::Attribu
                 return attrs;
             }
 
-            if self.cx.ecfg.use_extern_macros_enabled() {
-                attr = find_attr_invoc(&mut attrs);
-            }
+            attr = find_attr_invoc(&mut attrs);
             attrs
         });
 
@@ -1667,10 +1663,6 @@ fn proc_macro_gen = proc_macro_gen,
         fn proc_macro_expr = proc_macro_expr,
         fn proc_macro_non_items = proc_macro_non_items,
     }
-
-    pub fn use_extern_macros_enabled(&self) -> bool {
-        self.features.map_or(false, |features| features.use_extern_macros())
-    }
 }
 
 // A Marker adds the given mark to the syntax context.
index 395e5c98652326091ed5ce6f79d573698426722c..6fec1f3b1d500af5d0d97dab4309417a430b8cf3 100644 (file)
@@ -81,17 +81,6 @@ pub fn walk_feature_fields<F>(&self, mut f: F)
             {
                 $(f(stringify!($feature), self.$feature);)+
             }
-
-            pub fn use_extern_macros(&self) -> bool {
-                // A number of "advanced" macro features enable
-                // macro modularization (`use_extern_macros`) implicitly.
-                self.use_extern_macros || self.decl_macro ||
-                self.tool_attributes || self.custom_attribute ||
-                self.macros_in_extern || self.proc_macro_path_invoc ||
-                self.proc_macro_mod || self.proc_macro_expr ||
-                self.proc_macro_non_items || self.proc_macro_gen ||
-                self.stmt_expr_attributes || self.unrestricted_attribute_tokens
-            }
         }
     };
 
@@ -308,8 +297,6 @@ pub fn use_extern_macros(&self) -> bool {
     // Allows #[link(..., cfg(..))]
     (active, link_cfg, "1.14.0", Some(37406), None),
 
-    (active, use_extern_macros, "1.15.0", Some(35896), Some(Edition::Edition2018)),
-
     // `extern "ptx-*" fn()`
     (active, abi_ptx, "1.15.0", Some(38788), None),
 
@@ -535,7 +522,7 @@ pub fn use_extern_macros(&self) -> bool {
     (removed, advanced_slice_patterns, "1.0.0", Some(23121), None,
      Some("merged into `#![feature(slice_patterns)]`")),
     (removed, macro_reexport, "1.0.0", Some(29638), None,
-     Some("subsumed by `#![feature(use_extern_macros)]` and `pub use`")),
+     Some("subsumed by `pub use`")),
 );
 
 declare_features! (
@@ -652,6 +639,9 @@ pub fn use_extern_macros(&self) -> bool {
     (accepted, repr_transparent, "1.28.0", Some(43036), None),
     // Defining procedural macros in `proc-macro` crates
     (accepted, proc_macro, "1.29.0", Some(38356), None),
+    // Allows importing and reexporting macros with `use`,
+    // enables macro modularization in general.
+    (accepted, use_extern_macros, "1.30.0", Some(35896), None),
 );
 
 // If you change this, please modify src/doc/unstable-book as well. You must
index 9e7bbb2b8f7ff119c244fd6ad17d5141faf10b81..3cb565c1ede38efeb2e3a6bb8b63b1a72cbcaaed 100644 (file)
@@ -11,8 +11,6 @@
 // aux-build:attribute-with-error.rs
 // ignore-stage1
 
-#![feature(use_extern_macros)]
-
 extern crate attribute_with_error;
 
 use attribute_with_error::foo;
index ea66d3c0ef6bbab22cbfb8d918e006bbaaadbe21..e941367b08de9ade82c41f03dfef01bcd854ceba 100644 (file)
@@ -12,7 +12,6 @@
 // ignore-stage1
 // compile-pass
 
-#![feature(use_extern_macros)]
 #![warn(unused)]
 
 extern crate attributes_included;
index f71d4b86f1e0147f40878fce5c509e519abdf654..52d7afb26adbab633fa0eb32568c98cb38fd2816 100644 (file)
@@ -13,7 +13,6 @@
 // FIXME: https://github.com/rust-lang/rust/issues/41430
 // This is a temporary regression test for the ICE reported in #41211
 
-#![feature(use_extern_macros)]
 #![emit_unchanged]
 //~^ ERROR attribute `emit_unchanged` is currently unknown to the compiler
 extern crate issue_41211;
index bb7f341f9678632f2d2004e02d8f003c678b075c..0fcb9efc1c95c4f824c7aab2a00a9c63b8641c42 100644 (file)
@@ -9,7 +9,6 @@
 // except according to those terms.
 
 // aux-build:attr_proc_macro.rs
-#![feature(use_extern_macros)]
 
 #[macro_use] extern crate attr_proc_macro;
 
index e418ecc114cc1112a16e7494773a9fce987df938..f280e74fc90bde4377382249a869627acec6ade1 100644 (file)
@@ -12,8 +12,6 @@
 // ignore-stage1
 // ignore-wasm32
 
-#![feature(use_extern_macros)]
-
 extern crate test_macros;
 
 use test_macros::{nop_attr, no_output, emit_input};
index ff9f1705c5b84765d5878fac54ef519ded8d7056..b7ab978b8ed0a9714eb61008495091faf1702908 100644 (file)
@@ -10,8 +10,6 @@
 
 // aux-build:more-gates.rs
 
-#![feature(use_extern_macros)]
-
 extern crate more_gates as foo;
 
 use foo::*;
index e47a4aefb5e0b67447dde7a118477e45622574ba..ab05ca28386ab0f094db1a05e55c0b4701274b1b 100644 (file)
 // aux-build:derive-a.rs
 
 #![feature(rustc_attrs)]
+#![warn(unused_extern_crates)]
 
 extern crate derive_a;
-//~^ WARN proc macro crates and `#[no_link]` crates have no effect without `#[macro_use]`
+//~^ WARN unused extern crate
 
 #[rustc_error]
 fn main() {} //~ ERROR compilation successful
index 26522396d6b331b7e72f123fc20545362e876d80..effb3ad5189e1937e617086588b16757a3d90478 100644 (file)
@@ -12,7 +12,6 @@
 // ignore-stage1
 
 #![allow(warnings)]
-#![feature(use_extern_macros)]
 
 extern crate attr_args;
 use attr_args::{attr_with_args, identity};
index 4ee30b8252baa12a283501f7561d8f6e136a10c7..1a9d9b9ee621d5fd84cdfb953017160c421452fc 100644 (file)
@@ -12,8 +12,6 @@
 // ignore-stage1
 // revisions: foo bar
 
-#![feature(use_extern_macros)]
-
 extern crate attr_cfg;
 use attr_cfg::attr_cfg;
 
index 256096f118aa40b5e6e5f32d2efc9c02cc8e2b5e..698a0eca1734fd0bb038752107b8361c081a0292 100644 (file)
@@ -11,8 +11,6 @@
 // aux-build:attr-on-trait.rs
 // ignore-stage1
 
-#![feature(use_extern_macros)]
-
 extern crate attr_on_trait;
 
 use attr_on_trait::foo;
index bac6524847a887f30f68918e2d398df5cee80a0f..ca88482064bc91ba39659f539d1c13afdf9de50b 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(use_extern_macros)]
-
 extern crate hygiene_example_codegen;
 
 pub use hygiene_example_codegen::hello;
index 6ef23bc772b5c26ab5cbce89ba9dfb1f2bcff5fe..93023f8f8edfc25e2a982babb5e48a9f86e00091 100644 (file)
@@ -11,8 +11,6 @@
 // aux-build:derive-attr-cfg.rs
 // ignore-stage1
 
-#![feature(use_extern_macros)]
-
 extern crate derive_attr_cfg;
 use derive_attr_cfg::Foo;
 
index 6a0a3b3a9416a1a22e297932de600fad62dd64d6..0df0288216eff20bca370b29164fbfd24c59248e 100644 (file)
@@ -10,8 +10,6 @@
 
 // aux-build:derive-two-attrs.rs
 
-#![feature(use_extern_macros)]
-
 extern crate derive_two_attrs as foo;
 
 use foo::A;
index c8a9bea3631cb582adc2c565e2a3cb0fa7cb951b..ce2fed86e46ae86850870b2c9b0b821bfa5cedf6 100644 (file)
@@ -10,8 +10,6 @@
 
 // aux-build:gen-lifetime-token.rs
 
-#![feature(use_extern_macros)]
-
 extern crate gen_lifetime_token as bar;
 
 bar::bar!();
index 5b7d8c2b05b69123bcf4c6d3929ba9225070d7b3..3fc7446815eb4cf9dacf5f5dc3a07c66519ee50b 100644 (file)
@@ -11,9 +11,6 @@
 // aux-build:issue-39889.rs
 // ignore-stage1
 
-#![feature(use_extern_macros)]
-#![allow(unused)]
-
 extern crate issue_39889;
 use issue_39889::Issue39889;
 
index cfe0ce19a460627f04c34c747e5367d360311573..c73441e30e6d57b7933f57be500715eb3ed9fd6d 100644 (file)
@@ -11,8 +11,6 @@
 // aux-build:lifetimes.rs
 // ignore-stage1
 
-#![feature(use_extern_macros)]
-
 extern crate lifetimes;
 use lifetimes::*;
 
index 0b584fdd44d478c8194d489a56e4f1b4f254bcf0..d6f7cc4699adb39c9fb0cbd05918e3667afa5038 100644 (file)
@@ -10,8 +10,6 @@
 
 // aux-build:modify-ast.rs
 
-#![feature(use_extern_macros)]
-
 extern crate modify_ast;
 
 use modify_ast::*;
index 8a59d57a938aaa8438bb77ece29155dc3f8aa173..7a53348f96396ebd3acc270477e7d583f9b0bcd2 100644 (file)
@@ -10,8 +10,6 @@
 
 // aux-build:not-joint.rs
 
-#![feature(use_extern_macros)]
-
 extern crate not_joint as bar;
 use bar::{tokens, nothing};
 
index 735e088b82a50354f72812dcda1e4949fb7d5522..415cada265ec7c35da8be1ad174d12fddf3c3b34 100644 (file)
@@ -13,8 +13,6 @@
 
 // ignore-pretty
 
-#![feature(use_extern_macros)]
-
 #[macro_use]
 extern crate span_test_macros;
 
index 68aced7f979c952e0fd86eccbd40c5aeeaf52f1e..7f14b2c4659c68908cac4669c452da298823abf1 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(use_extern_macros)]
 #![allow(duplicate_macro_exports)]
 
 #[macro_export]
index 69f8906778a1694875313023aaf40e2896aadb57..e860f7021e5368378f5d0abc1ba1cabe96ecbbfb 100644 (file)
@@ -10,8 +10,6 @@
 
 // aux-build:two_macros.rs
 
-#![feature(use_extern_macros)]
-
 extern crate two_macros;
 
 ::two_macros::macro_one!();
index 9162ad3268132777bce3df29a8454dbdecd9016e..66ab00da7f4a7b6ea51c10c92365d69af3ca6e89 100644 (file)
@@ -10,8 +10,6 @@
 
 // aux-build:use-macro-self.rs
 
-#![feature(use_extern_macros)]
-
 #[macro_use]
 extern crate use_macro_self;
 
index 15a774dc9353d57fb905066f3a6f65b73509384f..7ccfb3d9da675b744c80566340b6f6db67986cd1 100644 (file)
@@ -11,8 +11,6 @@
 // aux-build:all-item-types.rs
 // build-aux-docs
 
-#![feature(use_extern_macros)]
-
 #![crate_name = "foo"]
 
 #[macro_use]
index 6de13338dd376cafd94fd96cad564967043e6c90..5467a210bfd86482c042cf9ff03066425734f460 100644 (file)
@@ -12,8 +12,6 @@
 // build-aux-docs
 // ignore-cross-compile
 
-#![feature(use_extern_macros)]
-
 #[macro_use] extern crate qwop;
 
 // @has macro_vis/macro.some_macro.html
index 8d2f7d15d7d7f6865fdbcf5305e9de943a4e47d1..474a1da1875496383d44f0cca2a42a4350763e50 100644 (file)
@@ -12,7 +12,6 @@
 // build-aux-docs
 
 #![feature(macro_test)]
-#![feature(use_extern_macros)]
 
 #![crate_name = "foo"]
 
index 13957fd6a702294a7790acef048f15c64cea6bc0..48fb9bfd2075ec62c18b8b8f170b0c61cee71d86 100644 (file)
@@ -10,8 +10,6 @@
 
 // aux-build:pub-use-extern-macros.rs
 
-#![feature(use_extern_macros)]
-
 extern crate macros;
 
 // @has pub_use_extern_macros/macro.bar.html
index 18ca34b117db7a943aa2b5543fd3f39af1e8ba8e..af47dad9e0bd7240fd7b28e9338a434bce5c304f 100644 (file)
@@ -10,8 +10,6 @@
 
 // aux-build:attribute-spans-preserved.rs
 
-#![feature(use_extern_macros)]
-
 extern crate attribute_spans_preserved as foo;
 
 use foo::foo;
index a6cbf79209e2e0dccd4ce9bbb221439dd7544276..329e5bea61cd5ba54cd20d50d6f1583e032b664d 100644 (file)
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/attribute-spans-preserved.rs:19:23
+  --> $DIR/attribute-spans-preserved.rs:17:23
    |
 LL | #[ foo ( let y: u32 = "z"; ) ] //~ ERROR: mismatched types
    |                       ^^^ expected u32, found reference
@@ -8,7 +8,7 @@ LL | #[ foo ( let y: u32 = "z"; ) ] //~ ERROR: mismatched types
               found type `&'static str`
 
 error[E0308]: mismatched types
-  --> $DIR/attribute-spans-preserved.rs:20:23
+  --> $DIR/attribute-spans-preserved.rs:18:23
    |
 LL | #[ bar { let x: u32 = "y"; } ] //~ ERROR: mismatched types
    |                       ^^^ expected u32, found reference
index 1c16faa9986a5df926e5986057d5f439b36ee393..b29f2775201b8baa6feabf560ec444913e4a0573 100644 (file)
@@ -10,8 +10,6 @@
 
 // aux-build:macro-brackets.rs
 
-#![feature(use_extern_macros)]
-
 extern crate macro_brackets as bar;
 use bar::doit;
 
index 1f31a03491311e0868b640c32de6a6c2608976f0..7c263d38df9714c7329801f9917a6a74158d0e25 100644 (file)
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/macro-brackets.rs:23:21
+  --> $DIR/macro-brackets.rs:21:21
    |
 LL | id![static X: u32 = 'a';]; //~ ERROR: mismatched types
    |                     ^^^ expected u32, found char
index 9cfd486606abfaa766bcfb007be43d8c1a11d6ca..fa05ad2fc605bed9d436d0c6e0efcc5e33641da5 100644 (file)
@@ -10,7 +10,6 @@
 
 // no-prefer-dynamic
 
-#![feature(use_extern_macros)]
 #![crate_type = "proc-macro"]
 
 extern crate proc_macro;
index 58a7f97490515e1bd915970df21c581a6058ff03..342d7ddb36cf2660866db1a9ee282b8cfc2bac18 100644 (file)
@@ -1,53 +1,53 @@
 error: can't use a procedural macro from the same crate that defines it
-  --> $DIR/macro-namespace-reserved-2.rs:35:5
+  --> $DIR/macro-namespace-reserved-2.rs:34:5
    |
 LL |     my_macro!(); //~ ERROR can't use a procedural macro from the same crate that defines it
    |     ^^^^^^^^^^^^
 
 error: can't use a procedural macro from the same crate that defines it
-  --> $DIR/macro-namespace-reserved-2.rs:38:5
+  --> $DIR/macro-namespace-reserved-2.rs:37:5
    |
 LL |     my_macro_attr!(); //~ ERROR can't use a procedural macro from the same crate that defines it
    |     ^^^^^^^^^^^^^^^^^
 
 error: can't use a procedural macro from the same crate that defines it
-  --> $DIR/macro-namespace-reserved-2.rs:41:5
+  --> $DIR/macro-namespace-reserved-2.rs:40:5
    |
 LL |     MyTrait!(); //~ ERROR can't use a procedural macro from the same crate that defines it
    |     ^^^^^^^^^^^
 
 error: can't use a procedural macro from the same crate that defines it
-  --> $DIR/macro-namespace-reserved-2.rs:44:1
+  --> $DIR/macro-namespace-reserved-2.rs:43:1
    |
 LL | #[my_macro] //~ ERROR can't use a procedural macro from the same crate that defines it
    | ^^^^^^^^^^^
 
 error: can't use a procedural macro from the same crate that defines it
-  --> $DIR/macro-namespace-reserved-2.rs:46:1
+  --> $DIR/macro-namespace-reserved-2.rs:45:1
    |
 LL | #[my_macro_attr] //~ ERROR can't use a procedural macro from the same crate that defines it
    | ^^^^^^^^^^^^^^^^
 
 error: can't use a procedural macro from the same crate that defines it
-  --> $DIR/macro-namespace-reserved-2.rs:48:1
+  --> $DIR/macro-namespace-reserved-2.rs:47:1
    |
 LL | #[MyTrait] //~ ERROR can't use a procedural macro from the same crate that defines it
    | ^^^^^^^^^^
 
 error: can't use a procedural macro from the same crate that defines it
-  --> $DIR/macro-namespace-reserved-2.rs:51:10
+  --> $DIR/macro-namespace-reserved-2.rs:50:10
    |
 LL | #[derive(my_macro)] //~ ERROR can't use a procedural macro from the same crate that defines it
    |          ^^^^^^^^
 
 error: can't use a procedural macro from the same crate that defines it
-  --> $DIR/macro-namespace-reserved-2.rs:53:10
+  --> $DIR/macro-namespace-reserved-2.rs:52:10
    |
 LL | #[derive(my_macro_attr)] //~ ERROR can't use a procedural macro from the same crate that defines it
    |          ^^^^^^^^^^^^^
 
 error: can't use a procedural macro from the same crate that defines it
-  --> $DIR/macro-namespace-reserved-2.rs:55:10
+  --> $DIR/macro-namespace-reserved-2.rs:54:10
    |
 LL | #[derive(MyTrait)] //~ ERROR can't use a procedural macro from the same crate that defines it
    |          ^^^^^^^
index bacab345351ca12e63e2c5fe007aa689e4399874..8f059d6344df67bae76a34d748eb27ebd556289b 100644 (file)
@@ -10,8 +10,6 @@
 
 // aux-build:nested-item-spans.rs
 
-#![feature(use_extern_macros)]
-
 extern crate nested_item_spans;
 
 use nested_item_spans::foo;
index c02cc2520f8d62d9f99ef46393a523c5535aabf4..75140747e8c76fbe3e7b7d207360edc2e7b8ed6b 100644 (file)
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/nested-item-spans.rs:22:22
+  --> $DIR/nested-item-spans.rs:20:22
    |
 LL |         let x: u32 = "x"; //~ ERROR: mismatched types
    |                      ^^^ expected u32, found reference
@@ -8,7 +8,7 @@ LL |         let x: u32 = "x"; //~ ERROR: mismatched types
               found type `&'static str`
 
 error[E0308]: mismatched types
-  --> $DIR/nested-item-spans.rs:31:22
+  --> $DIR/nested-item-spans.rs:29:22
    |
 LL |         let x: u32 = "x"; //~ ERROR: mismatched types
    |                      ^^^ expected u32, found reference
index d8159bff567ad18cf7bb6178ce9602e8188cd255..42b2b1d650f763b89fc52087da4d4a66ebd8e48a 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(use_extern_macros)]
-
 pub use std::panic;
 
 #[macro_export]
index 651e984b274528f4ff5a4aff47b032db88c30789..e2119efbd3db5b2d572a47195fb0ed2fb1dfcbf1 100644 (file)
@@ -1,5 +1,5 @@
 error[E0255]: the name `panic` is defined multiple times
-  --> $DIR/duplicate-check-macro-exports.rs:16:1
+  --> $DIR/duplicate-check-macro-exports.rs:14:1
    |
 LL | pub use std::panic;
    |         ---------- previous import of the macro `panic` here
index 4267103ab9a3aacae556f5a919e5f9bab8e449af..4b1bf7d8f7923ff4438ed51bdddef297bb7a081c 100644 (file)
@@ -10,8 +10,6 @@
 
 // #41719
 
-#![feature(use_extern_macros)]
-
 fn main() {
     enum Foo {}
     let _ = Foo::bar!(); //~ ERROR fail to resolve non-ident macro path
index 8918ac3143b1bf0f9dc24a8c93e8a57e471b218e..b5515bfcc64232c7c45ea732945ed0db026eaf9b 100644 (file)
@@ -1,5 +1,5 @@
 error: fail to resolve non-ident macro path
-  --> $DIR/extern-macro.rs:17:13
+  --> $DIR/extern-macro.rs:15:13
    |
 LL |     let _ = Foo::bar!(); //~ ERROR fail to resolve non-ident macro path
    |             ^^^^^^^^
index 47c623574ec90ef84e77f3357dbcb6ae588967d1..5aa1670b82888f9736776a1ae4b9f36b3248256d 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(use_extern_macros)]
-
 fn main() {
     #[rustfmt::skip] //~ ERROR tool attributes are unstable
     let x = 3
index ebc266e004ecceaf293e746e76cadd471d4e4f79..ca9542dcc956acb4893d39c18f5c159437cbd6a1 100644 (file)
@@ -1,5 +1,5 @@
 error[E0658]: tool attributes are unstable (see issue #44690)
-  --> $DIR/feature-gate-tool_attributes.rs:14:5
+  --> $DIR/feature-gate-tool_attributes.rs:12:5
    |
 LL |     #[rustfmt::skip] //~ ERROR tool attributes are unstable
    |     ^^^^^^^^^^^^^^^^
index 787e2df3ec2464e8e9617680e7db446750f458ae..92e10c190aa058745a3c3ca58585001da0e6c337 100644 (file)
@@ -11,8 +11,6 @@
 // compile-pass
 // aux-build:local_inner_macros.rs
 
-#![feature(use_extern_macros)]
-
 extern crate local_inner_macros;
 
 use local_inner_macros::{public_macro, public_macro_dynamic};
diff --git a/src/test/ui/hygiene/local_inner_macros_disabled.rs b/src/test/ui/hygiene/local_inner_macros_disabled.rs
deleted file mode 100644 (file)
index 0a4bdb7..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2018 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// `local_inner_macros` has no effect if `feature(use_extern_macros)` is not enabled
-
-// aux-build:local_inner_macros.rs
-
-#[macro_use(public_macro)]
-extern crate local_inner_macros;
-
-public_macro!(); //~ ERROR cannot find macro `helper2!` in this scope
-
-fn main() {}
diff --git a/src/test/ui/hygiene/local_inner_macros_disabled.stderr b/src/test/ui/hygiene/local_inner_macros_disabled.stderr
deleted file mode 100644 (file)
index 3dcd03b..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-error: cannot find macro `helper2!` in this scope
-  --> $DIR/local_inner_macros_disabled.rs:18:1
-   |
-LL | public_macro!(); //~ ERROR cannot find macro `helper2!` in this scope
-   | ^^^^^^^^^^^^^^^^
-   |
-   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
-
-error: aborting due to previous error
-
index ab1f312e161e87ba42d288e17349d6b140071697..6691d98c2b7f43332fdfdc050d02a62436d7b08e 100644 (file)
@@ -10,8 +10,6 @@
 
 // Crate-local macro expanded `macro_export` macros cannot be accessed with module-relative paths.
 
-#![feature(use_extern_macros)]
-
 macro_rules! define_exported { () => {
     #[macro_export]
     macro_rules! exported {
index 6da52842d83d7d09631799c3e97936ca65a6ca10..34c50e04288e50d8df200f2a54ed85de66830466 100644 (file)
@@ -1,11 +1,11 @@
 error: macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths
-  --> $DIR/local-modularized-tricky-fail-3.rs:25:9
+  --> $DIR/local-modularized-tricky-fail-3.rs:23:9
    |
 LL |     use exported;
    |         ^^^^^^^^
    |
 note: the macro is defined here
-  --> $DIR/local-modularized-tricky-fail-3.rs:17:5
+  --> $DIR/local-modularized-tricky-fail-3.rs:15:5
    |
 LL | /     macro_rules! exported {
 LL | |         () => ()
@@ -16,13 +16,13 @@ LL |   define_exported!();
    |   ------------------- in this macro invocation
 
 error: macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths
-  --> $DIR/local-modularized-tricky-fail-3.rs:30:5
+  --> $DIR/local-modularized-tricky-fail-3.rs:28:5
    |
 LL |     ::exported!();
    |     ^^^^^^^^^^
    |
 note: the macro is defined here
-  --> $DIR/local-modularized-tricky-fail-3.rs:17:5
+  --> $DIR/local-modularized-tricky-fail-3.rs:15:5
    |
 LL | /     macro_rules! exported {
 LL | |         () => ()
index 04df357e106cba97d2693387b8df3a2f51a88b25..9392473eace66c45672e2d63a1bafa55ffbb47e4 100644 (file)
@@ -10,8 +10,6 @@
 
 // compile-pass
 
-#![feature(use_extern_macros)]
-
 macro_rules! define_exported { () => {
     #[macro_export]
     macro_rules! exported {
index a5297c54c9e0275160e972b90a048c969420037d..260a406ef75f9d2c3a32f9aed4f2bc395c1be071 100644 (file)
@@ -10,8 +10,6 @@
 
 // compile-pass
 
-#![feature(use_extern_macros)]
-
 #[macro_export(local_inner_macros)]
 macro_rules! dollar_crate_exported {
     (1) => { $crate::exported!(); };
index e709eeee14a8452e4852ae322a16d7f380210bc0..50cfd2d2170e82a5155641894dfd8935743fe58c 100644 (file)
@@ -10,8 +10,6 @@
 
 // aux-build:two_macros.rs
 
-#![feature(use_extern_macros)]
-
 extern crate two_macros;
 
 mod foo {
index 799e7f972464b55f73d754a39392d7e3316eca3e..08f45e1a57530d33881eddf75312e5866a3b148c 100644 (file)
@@ -1,34 +1,34 @@
 error[E0659]: `bar` is ambiguous
-  --> $DIR/macro-paths.rs:25:5
+  --> $DIR/macro-paths.rs:23:5
    |
 LL |     bar::m! { //~ ERROR ambiguous
    |     ^^^^^^
    |
 note: `bar` could refer to the name defined here
-  --> $DIR/macro-paths.rs:26:9
+  --> $DIR/macro-paths.rs:24:9
    |
 LL |         mod bar { pub use two_macros::m; }
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 note: `bar` could also refer to the name imported here
-  --> $DIR/macro-paths.rs:24:9
+  --> $DIR/macro-paths.rs:22:9
    |
 LL |     use foo::*;
    |         ^^^^^^
    = note: macro-expanded items do not shadow when used in a macro invocation path
 
 error[E0659]: `baz` is ambiguous
-  --> $DIR/macro-paths.rs:35:5
+  --> $DIR/macro-paths.rs:33:5
    |
 LL |     baz::m! { //~ ERROR ambiguous
    |     ^^^^^^
    |
 note: `baz` could refer to the name defined here
-  --> $DIR/macro-paths.rs:36:9
+  --> $DIR/macro-paths.rs:34:9
    |
 LL |         mod baz { pub use two_macros::m; }
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 note: `baz` could also refer to the name defined here
-  --> $DIR/macro-paths.rs:30:1
+  --> $DIR/macro-paths.rs:28:1
    |
 LL | / pub mod baz {
 LL | |     pub use two_macros::m;
index ed5907800e9de7367618d1f9d158e7c459aca6d4..47ab8fc6c2f75ccbd663fd47f3e99c176f421f67 100644 (file)
@@ -10,8 +10,6 @@
 
 // aux-build:two_macros.rs
 
-#![feature(use_extern_macros)]
-
 extern crate two_macros; // two identity macros `m` and `n`
 
 mod foo {
index f91987cd9f3402779b2d9f78ed9ecae8c6b1cdfb..01d1f4fdfad03df261080be2fa31a4b06a28b30c 100644 (file)
@@ -1,51 +1,51 @@
 error: `m` is ambiguous
-  --> $DIR/macros.rs:50:5
+  --> $DIR/macros.rs:48:5
    |
 LL |     m!(); //~ ERROR ambiguous
    |     ^
    |
 note: `m` could refer to the macro defined here
-  --> $DIR/macros.rs:48:5
+  --> $DIR/macros.rs:46:5
    |
 LL |     macro_rules! m { () => {} }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 note: `m` could also refer to the macro imported here
-  --> $DIR/macros.rs:49:9
+  --> $DIR/macros.rs:47:9
    |
 LL |     use two_macros::m;
    |         ^^^^^^^^^^^^^
 
 error[E0659]: `m` is ambiguous
-  --> $DIR/macros.rs:28:5
+  --> $DIR/macros.rs:26:5
    |
 LL |     m! { //~ ERROR ambiguous
    |     ^
    |
 note: `m` could refer to the name imported here
-  --> $DIR/macros.rs:29:13
+  --> $DIR/macros.rs:27:13
    |
 LL |         use foo::m;
    |             ^^^^^^
 note: `m` could also refer to the name imported here
-  --> $DIR/macros.rs:27:9
+  --> $DIR/macros.rs:25:9
    |
 LL |     use two_macros::*;
    |         ^^^^^^^^^^^^^
    = note: macro-expanded macro imports do not shadow
 
 error[E0659]: `m` is ambiguous
-  --> $DIR/macros.rs:41:9
+  --> $DIR/macros.rs:39:9
    |
 LL |         m! { //~ ERROR ambiguous
    |         ^
    |
 note: `m` could refer to the name imported here
-  --> $DIR/macros.rs:42:17
+  --> $DIR/macros.rs:40:17
    |
 LL |             use two_macros::n as m;
    |                 ^^^^^^^^^^^^^^^^^^
 note: `m` could also refer to the name imported here
-  --> $DIR/macros.rs:34:9
+  --> $DIR/macros.rs:32:9
    |
 LL |     use two_macros::m;
    |         ^^^^^^^^^^^^^
index 93de136c4051d6875345c8e420cd38e9048961d7..90718abc37b3101ef9aaca11992e63354254cfbf 100644 (file)
@@ -10,8 +10,6 @@
 
 // aux-build:two_macros.rs
 
-#![feature(use_extern_macros)]
-
 mod foo {
     extern crate two_macros;
     pub use self::two_macros::m as panic;
index c9d80ada47250407080bd720869042aca6bd8353..693b7aadeca4e334d8767f269317eb38fcde4d0e 100644 (file)
@@ -1,5 +1,5 @@
 error: `panic` is already in scope
-  --> $DIR/shadow_builtin_macros.rs:42:9
+  --> $DIR/shadow_builtin_macros.rs:40:9
    |
 LL |         macro_rules! panic { () => {} } //~ ERROR `panic` is already in scope
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -10,13 +10,13 @@ LL |     m!();
    = note: macro-expanded `macro_rules!`s may not shadow existing macros (see RFC 1560)
 
 error[E0659]: `panic` is ambiguous
-  --> $DIR/shadow_builtin_macros.rs:27:14
+  --> $DIR/shadow_builtin_macros.rs:25:14
    |
 LL |     fn f() { panic!(); } //~ ERROR ambiguous
    |              ^^^^^
    |
 note: `panic` could refer to the name imported here
-  --> $DIR/shadow_builtin_macros.rs:26:9
+  --> $DIR/shadow_builtin_macros.rs:24:9
    |
 LL |     use foo::*;
    |         ^^^^^^
@@ -24,13 +24,13 @@ LL |     use foo::*;
    = note: consider adding an explicit import of `panic` to disambiguate
 
 error[E0659]: `panic` is ambiguous
-  --> $DIR/shadow_builtin_macros.rs:32:14
+  --> $DIR/shadow_builtin_macros.rs:30:14
    |
 LL |     fn f() { panic!(); } //~ ERROR ambiguous
    |              ^^^^^
    |
 note: `panic` could refer to the name imported here
-  --> $DIR/shadow_builtin_macros.rs:31:26
+  --> $DIR/shadow_builtin_macros.rs:29:26
    |
 LL |     ::two_macros::m!(use foo::panic;);
    |                          ^^^^^^^^^^
@@ -38,18 +38,18 @@ LL |     ::two_macros::m!(use foo::panic;);
    = note: macro-expanded macro imports do not shadow
 
 error[E0659]: `n` is ambiguous
-  --> $DIR/shadow_builtin_macros.rs:61:5
+  --> $DIR/shadow_builtin_macros.rs:59:5
    |
 LL |     n!(); //~ ERROR ambiguous
    |     ^
    |
 note: `n` could refer to the name imported here
-  --> $DIR/shadow_builtin_macros.rs:60:9
+  --> $DIR/shadow_builtin_macros.rs:58:9
    |
 LL |     use bar::*;
    |         ^^^^^^
 note: `n` could also refer to the name imported here
-  --> $DIR/shadow_builtin_macros.rs:48:13
+  --> $DIR/shadow_builtin_macros.rs:46:13
    |
 LL | #[macro_use(n)]
    |             ^
index b953805a7eb2f2ef2c85d074f4b25334bfbbbe81..e1181eb741bf9e71fc52c1641506c6ee7db189e7 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(use_extern_macros, extern_prelude)]
+#![feature(extern_prelude)]
 
 mod m {
     fn check() {
index ec77e276bd4031c3a8ac007830da790eee1f3430..82258dac37b86bf9b64cf0b99ebf37fb6041c72a 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(use_extern_macros)]
-
 mod m {
     fn check() {
         Result::Ok!(); //~ ERROR fail to resolve non-ident macro path
index d23aed847a30c733ca73b9475abb8599b29c4a65..876ee2584e9aa8287f74bb50f93960b3c54e9ab0 100644 (file)
@@ -1,5 +1,5 @@
 error: fail to resolve non-ident macro path
-  --> $DIR/macro-path-prelude-fail-2.rs:15:9
+  --> $DIR/macro-path-prelude-fail-2.rs:13:9
    |
 LL |         Result::Ok!(); //~ ERROR fail to resolve non-ident macro path
    |         ^^^^^^^^^^
index d325b0460015c7f18660ce555e42aa0136757b44..c706b8f613dd7a78e4c63539b07de81aaead4c2c 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(use_extern_macros)]
-
 #[derive(inline)] //~ ERROR cannot find derive macro `inline` in this scope
 struct S;
 
index c9af4b66427516df4a674b863d0a2c7b5e68d057..a8edf54d2204851045c74700ca826144a2e3cd96 100644 (file)
@@ -1,11 +1,11 @@
 error: cannot find derive macro `inline` in this scope
-  --> $DIR/macro-path-prelude-fail-3.rs:13:10
+  --> $DIR/macro-path-prelude-fail-3.rs:11:10
    |
 LL | #[derive(inline)] //~ ERROR cannot find derive macro `inline` in this scope
    |          ^^^^^^
 
 error: cannot find macro `inline!` in this scope
-  --> $DIR/macro-path-prelude-fail-3.rs:17:5
+  --> $DIR/macro-path-prelude-fail-3.rs:15:5
    |
 LL |     inline!(); //~ ERROR cannot find macro `inline!` in this scope
    |     ^^^^^^ help: you could try the macro: `line`
index bc58754513b6d400077bfe0750257e2c3f5b4a76..1f281d4a686035802a5458dc97f21071bfc460da 100644 (file)
@@ -10,7 +10,7 @@
 
 // compile-pass
 
-#![feature(use_extern_macros, extern_prelude)]
+#![feature(extern_prelude)]
 
 mod m {
     fn check() {
index ba0ab232e8648eb6d37275be4f69aeeeae96bdc7..c93c7144f9ebe08bc8165f2ad7f648aaf226cb5f 100644 (file)
@@ -4,7 +4,7 @@ error[E0557]: feature has been removed
 LL | #![feature(macro_reexport)] //~ ERROR feature has been removed
    |            ^^^^^^^^^^^^^^
    |
-note: subsumed by `#![feature(use_extern_macros)]` and `pub use`
+note: subsumed by `pub use`
   --> $DIR/macro-reexport-removed.rs:13:12
    |
 LL | #![feature(macro_reexport)] //~ ERROR feature has been removed
diff --git a/src/test/ui/macros/macro-with-seps-err-msg.rs b/src/test/ui/macros/macro-with-seps-err-msg.rs
deleted file mode 100644 (file)
index 1281adc..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2012 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// gate-test-use_extern_macros
-
-fn main() {
-    globnar::brotz!(); //~ ERROR non-ident macro paths are experimental
-}
diff --git a/src/test/ui/macros/macro-with-seps-err-msg.stderr b/src/test/ui/macros/macro-with-seps-err-msg.stderr
deleted file mode 100644 (file)
index 0b6d186..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0658]: non-ident macro paths are experimental (see issue #35896)
-  --> $DIR/macro-with-seps-err-msg.rs:14:5
-   |
-LL |     globnar::brotz!(); //~ ERROR non-ident macro paths are experimental
-   |     ^^^^^^^^^^^^^^
-   |
-   = help: add #![feature(use_extern_macros)] to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0658`.
index c0acbc979ad1f8c49fdb828608dec6b56b6f1b30..4a812739a6b26f43163c22d52a1da810242330c6 100644 (file)
@@ -19,5 +19,5 @@ macro_rules! kl {
 
 fn main() {
     k!(); //~ ERROR cannot find
-    kl!(); //~ ERROR cannot find
+    kl!();
 }
index 8d44df8af0cbd35df8a06981aab2b0a423958319..87b039f483485d57d07258279df54ad4d0b6f467 100644 (file)
@@ -1,16 +1,8 @@
-error: cannot find macro `kl!` in this scope
-  --> $DIR/macro_undefined.rs:22:5
-   |
-LL |     kl!(); //~ ERROR cannot find
-   |     ^^
-   |
-   = help: have you added the `#[macro_use]` on the module/import?
-
 error: cannot find macro `k!` in this scope
   --> $DIR/macro_undefined.rs:21:5
    |
 LL |     k!(); //~ ERROR cannot find
    |     ^ help: you could try the macro: `kl`
 
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
index 2815e1be70983377e45eaae934acb59da450eee7..ce2dfb906c5ce3cf648b728576c023a37a7f18cc 100644 (file)
@@ -30,8 +30,6 @@ fn main() {
     env!(foo, abr, baz); //~ ERROR
     env!("RUST_HOPEFULLY_THIS_DOESNT_EXIST"); //~ ERROR
 
-    foo::blah!(); //~ ERROR
-
     format!(invalid); //~ ERROR
 
     include!(invalid); //~ ERROR
index 084042acc974d698f5655013cec24e281707ce81..81e250d5ea09e43ee780b4593039ba7f6ccbb514 100644 (file)
@@ -40,16 +40,8 @@ error: environment variable `RUST_HOPEFULLY_THIS_DOESNT_EXIST` not defined
 LL |     env!("RUST_HOPEFULLY_THIS_DOESNT_EXIST"); //~ ERROR
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error[E0658]: non-ident macro paths are experimental (see issue #35896)
-  --> $DIR/macros-nonfatal-errors.rs:33:5
-   |
-LL |     foo::blah!(); //~ ERROR
-   |     ^^^^^^^^^
-   |
-   = help: add #![feature(use_extern_macros)] to the crate attributes to enable
-
 error: format argument must be a string literal
-  --> $DIR/macros-nonfatal-errors.rs:35:13
+  --> $DIR/macros-nonfatal-errors.rs:33:13
    |
 LL |     format!(invalid); //~ ERROR
    |             ^^^^^^^
@@ -59,42 +51,41 @@ LL |     format!("{}", invalid); //~ ERROR
    |             ^^^^^
 
 error: argument must be a string literal
-  --> $DIR/macros-nonfatal-errors.rs:37:14
+  --> $DIR/macros-nonfatal-errors.rs:35:14
    |
 LL |     include!(invalid); //~ ERROR
    |              ^^^^^^^
 
 error: argument must be a string literal
-  --> $DIR/macros-nonfatal-errors.rs:39:18
+  --> $DIR/macros-nonfatal-errors.rs:37:18
    |
 LL |     include_str!(invalid); //~ ERROR
    |                  ^^^^^^^
 
 error: couldn't read $DIR/i'd be quite surprised if a file with this name existed: No such file or directory (os error 2)
-  --> $DIR/macros-nonfatal-errors.rs:40:5
+  --> $DIR/macros-nonfatal-errors.rs:38:5
    |
 LL |     include_str!("i'd be quite surprised if a file with this name existed"); //~ ERROR
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: argument must be a string literal
-  --> $DIR/macros-nonfatal-errors.rs:41:20
+  --> $DIR/macros-nonfatal-errors.rs:39:20
    |
 LL |     include_bytes!(invalid); //~ ERROR
    |                    ^^^^^^^
 
 error: couldn't read $DIR/i'd be quite surprised if a file with this name existed: No such file or directory (os error 2)
-  --> $DIR/macros-nonfatal-errors.rs:42:5
+  --> $DIR/macros-nonfatal-errors.rs:40:5
    |
 LL |     include_bytes!("i'd be quite surprised if a file with this name existed"); //~ ERROR
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: trace_macros! accepts only `true` or `false`
-  --> $DIR/macros-nonfatal-errors.rs:44:5
+  --> $DIR/macros-nonfatal-errors.rs:42:5
    |
 LL |     trace_macros!(invalid); //~ ERROR
    |     ^^^^^^^^^^^^^^^^^^^^^^^
 
-error: aborting due to 15 previous errors
+error: aborting due to 14 previous errors
 
-Some errors occurred: E0658, E0665.
-For more information about an error, try `rustc --explain E0658`.
+For more information about this error, try `rustc --explain E0665`.
index f74ff55e2c08e406399443b2c7a4ca49a3a3c7c1..36efb67cf803264cc9ce96a56afd0c97e5dfa512 100644 (file)
@@ -12,7 +12,6 @@
 
 #[no_link]
 extern crate empty_struct;
-//~^ WARN proc macro crates and `#[no_link]` crates have no effect without `#[macro_use]`
 
 fn main() {
     empty_struct::XEmpty1; //~ ERROR cannot find value `XEmpty1` in module `empty_struct`
index 3af7968f6404313e7920aab1b44e08bf27c25699..3f159ddfbd18aa07f388ab9a5811f3e366081c15 100644 (file)
@@ -1,11 +1,5 @@
-warning: proc macro crates and `#[no_link]` crates have no effect without `#[macro_use]`
-  --> $DIR/no-link.rs:14:1
-   |
-LL | extern crate empty_struct;
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
-
 error[E0425]: cannot find value `XEmpty1` in module `empty_struct`
-  --> $DIR/no-link.rs:18:19
+  --> $DIR/no-link.rs:17:19
    |
 LL |     empty_struct::XEmpty1; //~ ERROR cannot find value `XEmpty1` in module `empty_struct`
    |                   ^^^^^^^ not found in `empty_struct`
index f50419434ae1ddfa518d5ef64f49bad26d7ad865..ce4c6960281801a19f7e92642707a8cca10aec80 100644 (file)
@@ -13,7 +13,6 @@
 // compile-pass
 
 #![warn(macro_use_extern_crate, unused)]
-#![feature(use_extern_macros)]
 
 #[macro_use] //~ WARN should be replaced at use sites with a `use` statement
 extern crate macro_use_warned_against;
index 7af404fab790e432ac20cee4d7e1637fe92a9124..da69daf6ba8e7bebf4eccc5b0fcaf9df2ef22427 100644 (file)
@@ -1,5 +1,5 @@
 warning: deprecated `#[macro_use]` directive used to import macros should be replaced at use sites with a `use` statement to import the macro instead
-  --> $DIR/macro-use-warned-against.rs:18:1
+  --> $DIR/macro-use-warned-against.rs:17:1
    |
 LL | #[macro_use] //~ WARN should be replaced at use sites with a `use` statement
    | ^^^^^^^^^^^^
@@ -11,7 +11,7 @@ LL | #![warn(macro_use_extern_crate, unused)]
    |         ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused `#[macro_use]` import
-  --> $DIR/macro-use-warned-against.rs:20:1
+  --> $DIR/macro-use-warned-against.rs:19:1
    |
 LL | #[macro_use] //~ WARN unused `#[macro_use]`
    | ^^^^^^^^^^^^
diff --git a/src/test/ui/tool-attributes/tool-attributes-disabled-1.rs b/src/test/ui/tool-attributes/tool-attributes-disabled-1.rs
deleted file mode 100644 (file)
index 87d47b7..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2018 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// If macro modularization (`use_extern_macros`) is not enabled,
-// then tool attributes are treated as custom attributes.
-
-#[rustfmt::bar] //~ ERROR The attribute `rustfmt::bar` is currently unknown to the compiler
-fn main() {}
diff --git a/src/test/ui/tool-attributes/tool-attributes-disabled-1.stderr b/src/test/ui/tool-attributes/tool-attributes-disabled-1.stderr
deleted file mode 100644 (file)
index 6302c06..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0658]: The attribute `rustfmt::bar` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
-  --> $DIR/tool-attributes-disabled-1.rs:14:1
-   |
-LL | #[rustfmt::bar] //~ ERROR The attribute `rustfmt::bar` is currently unknown to the compiler
-   | ^^^^^^^^^^^^^^^
-   |
-   = help: add #![feature(custom_attribute)] to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/tool-attributes/tool-attributes-disabled-2.rs b/src/test/ui/tool-attributes/tool-attributes-disabled-2.rs
deleted file mode 100644 (file)
index 2d97e16..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2018 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// If macro modularization (`use_extern_macros`) is not enabled,
-// then tool attributes are treated as custom attributes.
-
-#[rustfmt::bar] //~ ERROR attribute `rustfmt::bar` is currently unknown to the compiler
-fn main() {}
diff --git a/src/test/ui/tool-attributes/tool-attributes-disabled-2.stderr b/src/test/ui/tool-attributes/tool-attributes-disabled-2.stderr
deleted file mode 100644 (file)
index b327773..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0658]: The attribute `rustfmt::bar` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
-  --> $DIR/tool-attributes-disabled-2.rs:14:1
-   |
-LL | #[rustfmt::bar] //~ ERROR attribute `rustfmt::bar` is currently unknown to the compiler
-   | ^^^^^^^^^^^^^^^
-   |
-   = help: add #![feature(custom_attribute)] to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0658`.