@@ -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
@@ -409,9 +409,6 @@ declare_features! (
409409 // Resolve absolute paths as paths from other crates
410410 ( active, extern_absolute_paths, "1.24.0" , Some ( 44660 ) , Some ( Edition :: Edition2018 ) ) ,
411411
412- // `foo.rs` as an alternative to `foo/mod.rs`
413- ( active, non_modrs_mods, "1.24.0" , Some ( 44660 ) , Some ( Edition :: Edition2018 ) ) ,
414-
415412 // `extern` in paths
416413 ( active, extern_in_paths, "1.23.0" , Some ( 44660 ) , None ) ,
417414
@@ -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`,
@@ -1494,31 +1493,6 @@ impl<'a> PostExpansionVisitor<'a> {
14941493 }
14951494}
14961495
1497- impl < ' a > PostExpansionVisitor < ' a > {
1498- fn whole_crate_feature_gates ( & mut self , _krate : & ast:: Crate ) {
1499- for & ( ident, span) in & * self . context . parse_sess . non_modrs_mods . borrow ( ) {
1500- if !span. allows_unstable ( ) {
1501- let cx = & self . context ;
1502- let level = GateStrength :: Hard ;
1503- let has_feature = cx. features . non_modrs_mods ;
1504- let name = "non_modrs_mods" ;
1505- debug ! ( "gate_feature(feature = {:?}, span = {:?}); has? {}" ,
1506- name, span, has_feature) ;
1507-
1508- if !has_feature && !span. allows_unstable ( ) {
1509- leveled_feature_err (
1510- cx. parse_sess , name, span, GateIssue :: Language ,
1511- "mod statements in non-mod.rs files are unstable" , level
1512- )
1513- . help ( & format ! ( "on stable builds, rename this file to {}{}mod.rs" ,
1514- ident, path:: MAIN_SEPARATOR ) )
1515- . emit ( ) ;
1516- }
1517- }
1518- }
1519- }
1520- }
1521-
15221496impl < ' a > Visitor < ' a > for PostExpansionVisitor < ' a > {
15231497 fn visit_attribute ( & mut self , attr : & ast:: Attribute ) {
15241498 if !attr. span . allows_unstable ( ) {
@@ -2088,7 +2062,6 @@ pub fn check_crate(krate: &ast::Crate,
20882062 } ;
20892063
20902064 let visitor = & mut PostExpansionVisitor { context : & ctx } ;
2091- visitor. whole_crate_feature_gates ( krate) ;
20922065 visit:: walk_crate ( visitor, krate) ;
20932066}
20942067
0 commit comments