File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 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,
378378 return ;
379379 }
380380
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 ;
382390 for ( i, line) in contents. lines ( ) . enumerate ( ) {
383391 macro_rules! err {
384392 ( $msg: expr) => { {
@@ -457,7 +465,7 @@ fn map_lib_features(base_src_path: &Path,
457465 if line. contains ( ']' ) {
458466 mf ( Ok ( ( feature_name, feature) ) , file, i + 1 ) ;
459467 } else {
460- becoming_feature = Some ( ( feature_name. to_owned ( ) , feature) ) ;
468+ becoming_feature = Some ( ( feature_name, feature) ) ;
461469 }
462470 }
463471 } ) ;
You can’t perform that action at this time.
0 commit comments