about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-09-12 08:08:13 +0000
committerbors <bors@rust-lang.org>2018-09-12 08:08:13 +0000
commit8586ec6980462c99a8926646201b2444d8938d29 (patch)
tree3a587254a39f2463c18874e31d3eadf471e7ee16 /src/libsyntax
parenta2b991b5305b770c7d5288ab3aa231428511c530 (diff)
parent1fed251927ec14db621b7705b9cf10f267477254 (diff)
downloadrust-8586ec6980462c99a8926646201b2444d8938d29.tar.gz
rust-8586ec6980462c99a8926646201b2444d8938d29.zip
Auto merge of #54146 - kennytm:rollup, r=kennytm
Rollup of 15 pull requests

Successful merges:

 - #52514 (Fix a few AMDGPU related issues)
 - #53703 (Document .0 to unpack integer from Wrapping)
 - #53777 (Implemented map_or_else for Result<T, E>)
 - #54031 (A few cleanups and minor improvements to rustc_passes)
 - #54046 (Update documentation for fill_buf in std::io::BufRead)
 - #54064 (`&CStr`, not `CStr`, is the counterpart of `&str`)
 - #54072 (Stabilization change for mod.rs)
 - #54073 (docs: Use dollar sign for all bash prompts)
 - #54074 (simplify ordering for Kind)
 - #54085 (Remove documentation about proc_macro being bare-bones)
 - #54087 (rustdoc: Remove generated blanket impls from trait pages)
 - #54106 (Reexport CheckLintNameResult)
 - #54107 (Fix typos in libstd hash map)
 - #54136 (Update LLVM to fix GlobalISel dbg.declare)
 - #54142 (Recover proper regression test for issue #16278.)

Failed merges:

r? @ghost
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/feature_gate.rs33
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);
 }