File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -378,7 +378,15 @@ fn map_lib_features(base_src_path: &Path,
378
378
return ;
379
379
}
380
380
381
- let mut becoming_feature: Option < ( String , Feature ) > = None ;
381
+ // This is an early exit -- all the attributes we're concerned with must contain this:
382
+ // * rustc_const_unstable(
383
+ // * unstable(
384
+ // * stable(
385
+ if !contents. contains ( "stable(" ) {
386
+ return ;
387
+ }
388
+
389
+ let mut becoming_feature: Option < ( & str , Feature ) > = None ;
382
390
for ( i, line) in contents. lines ( ) . enumerate ( ) {
383
391
macro_rules! err {
384
392
( $msg: expr) => { {
@@ -457,7 +465,7 @@ fn map_lib_features(base_src_path: &Path,
457
465
if line. contains ( ']' ) {
458
466
mf ( Ok ( ( feature_name, feature) ) , file, i + 1 ) ;
459
467
} else {
460
- becoming_feature = Some ( ( feature_name. to_owned ( ) , feature) ) ;
468
+ becoming_feature = Some ( ( feature_name, feature) ) ;
461
469
}
462
470
}
463
471
} ) ;
You can’t perform that action at this time.
0 commit comments