File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,9 @@ pub fn check(path: &Path, bad: &mut bool) {
124
124
return ;
125
125
}
126
126
127
+ let filen_underscore = filename. replace ( "-" , "_" ) . replace ( ".rs" , "" ) ;
128
+ test_filen_gate ( & filen_underscore, & mut features) ;
129
+
127
130
contents. truncate ( 0 ) ;
128
131
t ! ( t!( File :: open( & file) , & file) . read_to_string( & mut contents) ) ;
129
132
@@ -214,6 +217,19 @@ fn find_attr_val<'a>(line: &'a str, attr: &str) -> Option<&'a str> {
214
217
. map ( |( i, j) | & line[ i..j] )
215
218
}
216
219
220
+ fn test_filen_gate ( filen_underscore : & str ,
221
+ features : & mut HashMap < String , Feature > ) -> bool {
222
+ if filen_underscore. starts_with ( "feature_gate" ) {
223
+ for ( n, f) in features. iter_mut ( ) {
224
+ if filen_underscore == format ! ( "feature_gate_{}" , n) {
225
+ f. has_gate_test = true ;
226
+ return true ;
227
+ }
228
+ }
229
+ }
230
+ return false ;
231
+ }
232
+
217
233
fn collect_lang_features ( path : & Path ) -> HashMap < String , Feature > {
218
234
let mut contents = String :: new ( ) ;
219
235
t ! ( t!( File :: open( path) ) . read_to_string( & mut contents) ) ;
You can’t perform that action at this time.
0 commit comments