@@ -37,7 +37,7 @@ use visit::{self, FnKind, Visitor};
37
37
use parse:: ParseSess ;
38
38
use symbol:: { keywords, Symbol } ;
39
39
40
- use std:: { env, path } ;
40
+ use std:: { env} ;
41
41
42
42
macro_rules! set {
43
43
// The const_fn feature also enables the min_const_fn feature, because `min_const_fn` allows
@@ -409,9 +409,6 @@ declare_features! (
409
409
// Resolve absolute paths as paths from other crates
410
410
( active, extern_absolute_paths, "1.24.0" , Some ( 44660 ) , Some ( Edition :: Edition2018 ) ) ,
411
411
412
- // `foo.rs` as an alternative to `foo/mod.rs`
413
- ( active, non_modrs_mods, "1.24.0" , Some ( 44660 ) , Some ( Edition :: Edition2018 ) ) ,
414
-
415
412
// `extern` in paths
416
413
( active, extern_in_paths, "1.23.0" , Some ( 44660 ) , None ) ,
417
414
@@ -660,6 +657,8 @@ declare_features! (
660
657
( accepted, repr_transparent, "1.28.0" , Some ( 43036 ) , None ) ,
661
658
// Defining procedural macros in `proc-macro` crates
662
659
( 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 ) ,
663
662
// Allows use of the :vis macro fragment specifier
664
663
( accepted, macro_vis_matcher, "1.30.0" , Some ( 41022 ) , None ) ,
665
664
// Allows importing and reexporting macros with `use`,
@@ -1494,31 +1493,6 @@ impl<'a> PostExpansionVisitor<'a> {
1494
1493
}
1495
1494
}
1496
1495
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
-
1522
1496
impl < ' a > Visitor < ' a > for PostExpansionVisitor < ' a > {
1523
1497
fn visit_attribute ( & mut self , attr : & ast:: Attribute ) {
1524
1498
if !attr. span . allows_unstable ( ) {
@@ -2088,7 +2062,6 @@ pub fn check_crate(krate: &ast::Crate,
2088
2062
} ;
2089
2063
2090
2064
let visitor = & mut PostExpansionVisitor { context : & ctx } ;
2091
- visitor. whole_crate_feature_gates ( krate) ;
2092
2065
visit:: walk_crate ( visitor, krate) ;
2093
2066
}
2094
2067
0 commit comments