@@ -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
@@ -406,9 +406,6 @@ declare_features! (
406
406
// Resolve absolute paths as paths from other crates
407
407
( active, extern_absolute_paths, "1.24.0" , Some ( 44660 ) , Some ( Edition :: Edition2018 ) ) ,
408
408
409
- // `foo.rs` as an alternative to `foo/mod.rs`
410
- ( active, non_modrs_mods, "1.24.0" , Some ( 44660 ) , Some ( Edition :: Edition2018 ) ) ,
411
-
412
409
// `extern` in paths
413
410
( active, extern_in_paths, "1.23.0" , Some ( 44660 ) , None ) ,
414
411
@@ -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`,
@@ -1498,31 +1497,6 @@ impl<'a> PostExpansionVisitor<'a> {
1498
1497
}
1499
1498
}
1500
1499
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
-
1526
1500
impl < ' a > Visitor < ' a > for PostExpansionVisitor < ' a > {
1527
1501
fn visit_attribute ( & mut self , attr : & ast:: Attribute ) {
1528
1502
if !attr. span . allows_unstable ( ) {
@@ -2092,7 +2066,6 @@ pub fn check_crate(krate: &ast::Crate,
2092
2066
} ;
2093
2067
2094
2068
let visitor = & mut PostExpansionVisitor { context : & ctx } ;
2095
- visitor. whole_crate_feature_gates ( krate) ;
2096
2069
visit:: walk_crate ( visitor, krate) ;
2097
2070
}
2098
2071
0 commit comments