diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2018-11-28 02:58:18 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2018-12-17 22:43:00 +0300 |
| commit | 7c901ba537c0df324c8b99f06ca3b76fcf20766a (patch) | |
| tree | a8b9817bb23f94392f8ab08b883f86c3cd90582f /src/libsyntax | |
| parent | adbfec229ce07ff4b2a7bf2d6dec2d13cb224980 (diff) | |
| download | rust-7c901ba537c0df324c8b99f06ca3b76fcf20766a.tar.gz rust-7c901ba537c0df324c8b99f06ca3b76fcf20766a.zip | |
Stabilize `underscore_imports`
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 23 |
1 files changed, 2 insertions, 21 deletions
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 == "_" { |
