@@ -37,7 +37,7 @@ use visit::{self, FnKind, Visitor};
3737use parse:: ParseSess ;
3838use symbol:: { keywords, Symbol } ;
3939
40- use std:: { env, path } ;
40+ use std:: { env} ;
4141
4242macro_rules! set {
4343 // The const_fn feature also enables the min_const_fn feature, because `min_const_fn` allows
@@ -406,9 +406,6 @@ declare_features! (
406406 // Resolve absolute paths as paths from other crates
407407 ( active, extern_absolute_paths, "1.24.0" , Some ( 44660 ) , Some ( Edition :: Edition2018 ) ) ,
408408
409- // `foo.rs` as an alternative to `foo/mod.rs`
410- ( active, non_modrs_mods, "1.24.0" , Some ( 44660 ) , Some ( Edition :: Edition2018 ) ) ,
411-
412409 // `extern` in paths
413410 ( active, extern_in_paths, "1.23.0" , Some ( 44660 ) , None ) ,
414411
@@ -660,6 +657,8 @@ declare_features! (
660657 ( accepted, repr_transparent, "1.28.0" , Some ( 43036 ) , None ) ,
661658 // Defining procedural macros in `proc-macro` crates
662659 ( accepted, proc_macro, "1.29.0" , Some ( 38356 ) , None ) ,
660+ // `foo.rs` as an alternative to `foo/mod.rs`
661+ ( accepted, non_modrs_mods, "1.30.0" , Some ( 44660 ) , None ) ,
663662 // Allows use of the :vis macro fragment specifier
664663 ( accepted, macro_vis_matcher, "1.30.0" , Some ( 41022 ) , None ) ,
665664 // Allows importing and reexporting macros with `use`,
@@ -1498,31 +1497,6 @@ impl<'a> PostExpansionVisitor<'a> {
14981497 }
14991498}
15001499
1501- impl < ' a > PostExpansionVisitor < ' a > {
1502- fn whole_crate_feature_gates ( & mut self , _krate : & ast:: Crate ) {
1503- for & ( ident, span) in & * self . context . parse_sess . non_modrs_mods . borrow ( ) {
1504- if !span. allows_unstable ( ) {
1505- let cx = & self . context ;
1506- let level = GateStrength :: Hard ;
1507- let has_feature = cx. features . non_modrs_mods ;
1508- let name = "non_modrs_mods" ;
1509- debug ! ( "gate_feature(feature = {:?}, span = {:?}); has? {}" ,
1510- name, span, has_feature) ;
1511-
1512- if !has_feature && !span. allows_unstable ( ) {
1513- leveled_feature_err (
1514- cx. parse_sess , name, span, GateIssue :: Language ,
1515- "mod statements in non-mod.rs files are unstable" , level
1516- )
1517- . help ( & format ! ( "on stable builds, rename this file to {}{}mod.rs" ,
1518- ident, path:: MAIN_SEPARATOR ) )
1519- . emit ( ) ;
1520- }
1521- }
1522- }
1523- }
1524- }
1525-
15261500impl < ' a > Visitor < ' a > for PostExpansionVisitor < ' a > {
15271501 fn visit_attribute ( & mut self , attr : & ast:: Attribute ) {
15281502 if !attr. span . allows_unstable ( ) {
@@ -2092,7 +2066,6 @@ pub fn check_crate(krate: &ast::Crate,
20922066 } ;
20932067
20942068 let visitor = & mut PostExpansionVisitor { context : & ctx } ;
2095- visitor. whole_crate_feature_gates ( krate) ;
20962069 visit:: walk_crate ( visitor, krate) ;
20972070}
20982071
0 commit comments