From 7c901ba537c0df324c8b99f06ca3b76fcf20766a Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Wed, 28 Nov 2018 02:58:18 +0300 Subject: Stabilize `underscore_imports` --- src/libsyntax/feature_gate.rs | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 1a4de59cce6..4eca0c942f3 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -400,9 +400,6 @@ declare_features! ( // Allows `#[repr(packed)]` attribute on structs. (active, repr_packed, "1.26.0", Some(33158), None), - // Allows `use path as _;` and `extern crate c as _;`. - (active, underscore_imports, "1.26.0", Some(48216), None), - // Allows macro invocations in `extern {}` blocks. (active, macros_in_extern, "1.27.0", Some(49476), None), @@ -694,6 +691,8 @@ declare_features! ( (accepted, self_struct_ctor, "1.32.0", Some(51994), None), // `Self` in type definitions (RFC 2300) (accepted, self_in_typedefs, "1.32.0", Some(49303), None), + // `use path as _;` and `extern crate c as _;` + (accepted, underscore_imports, "1.33.0", Some(48216), None), ); // If you change this, please modify `src/doc/unstable-book` as well. You must @@ -1547,26 +1546,8 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { } } - fn visit_use_tree(&mut self, use_tree: &'a ast::UseTree, id: NodeId, _nested: bool) { - if let ast::UseTreeKind::Simple(Some(ident), ..) = use_tree.kind { - if ident.name == "_" { - gate_feature_post!(&self, underscore_imports, use_tree.span, - "renaming imports with `_` is unstable"); - } - } - - visit::walk_use_tree(self, use_tree, id); - } - fn visit_item(&mut self, i: &'a ast::Item) { match i.node { - ast::ItemKind::ExternCrate(_) => { - if i.ident.name == "_" { - gate_feature_post!(&self, underscore_imports, i.span, - "renaming extern crates with `_` is unstable"); - } - } - ast::ItemKind::Static(..) | ast::ItemKind::Const(_,_) => { if i.ident.name == "_" { -- cgit 1.4.1-3-g733a5