diff options
| author | kennytm <kennytm@gmail.com> | 2018-09-12 12:17:30 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-09-12 12:17:30 +0800 |
| commit | e7b45a0b1fa26e55453965b6060667a86ef4d099 (patch) | |
| tree | f2f57d3362488167866d421341378ceab82fc44a /src/libsyntax | |
| parent | de2c0f95e85d5f5140821805dfa76ec4e9867f50 (diff) | |
| parent | 7f6b60899502c45fc0b58adf79d09fb77ffc8884 (diff) | |
| download | rust-e7b45a0b1fa26e55453965b6060667a86ef4d099.tar.gz rust-e7b45a0b1fa26e55453965b6060667a86ef4d099.zip | |
Rollup merge of #54072 - blitzerr:master, r=Mark-Simulacrum
Stabilization change for mod.rs This change is in response to https://github.com/rust-lang/rust/issues/53125. The patch makes the feature accepted and removes the tests that tested the non-accepted status of the feature.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index d7ae88ea08a..2b4daa6440c 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -37,7 +37,7 @@ use visit::{self, FnKind, Visitor}; use parse::ParseSess; use symbol::{keywords, Symbol}; -use std::{env, path}; +use std::{env}; macro_rules! set { // The const_fn feature also enables the min_const_fn feature, because `min_const_fn` allows @@ -406,9 +406,6 @@ declare_features! ( // Resolve absolute paths as paths from other crates (active, extern_absolute_paths, "1.24.0", Some(44660), Some(Edition::Edition2018)), - // `foo.rs` as an alternative to `foo/mod.rs` - (active, non_modrs_mods, "1.24.0", Some(44660), Some(Edition::Edition2018)), - // `extern` in paths (active, extern_in_paths, "1.23.0", Some(44660), None), @@ -660,6 +657,8 @@ declare_features! ( (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), + // `foo.rs` as an alternative to `foo/mod.rs` + (accepted, non_modrs_mods, "1.30.0", Some(44660), None), // Allows use of the :vis macro fragment specifier (accepted, macro_vis_matcher, "1.30.0", Some(41022), None), // Allows importing and reexporting macros with `use`, @@ -1498,31 +1497,6 @@ impl<'a> PostExpansionVisitor<'a> { } } -impl<'a> PostExpansionVisitor<'a> { - fn whole_crate_feature_gates(&mut self, _krate: &ast::Crate) { - for &(ident, span) in &*self.context.parse_sess.non_modrs_mods.borrow() { - if !span.allows_unstable() { - let cx = &self.context; - let level = GateStrength::Hard; - let has_feature = cx.features.non_modrs_mods; - let name = "non_modrs_mods"; - debug!("gate_feature(feature = {:?}, span = {:?}); has? {}", - name, span, has_feature); - - if !has_feature && !span.allows_unstable() { - leveled_feature_err( - cx.parse_sess, name, span, GateIssue::Language, - "mod statements in non-mod.rs files are unstable", level - ) - .help(&format!("on stable builds, rename this file to {}{}mod.rs", - ident, path::MAIN_SEPARATOR)) - .emit(); - } - } - } - } -} - impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { fn visit_attribute(&mut self, attr: &ast::Attribute) { if !attr.span.allows_unstable() { @@ -2092,7 +2066,6 @@ pub fn check_crate(krate: &ast::Crate, }; let visitor = &mut PostExpansionVisitor { context: &ctx }; - visitor.whole_crate_feature_gates(krate); visit::walk_crate(visitor, krate); } |
