File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -13,14 +13,16 @@ pub fn check(path: &Path, bad: &mut bool) {
1313 & mut |entry, contents| {
1414 let subpath = entry. path ( ) ;
1515 if let Some ( "rs" ) = subpath. extension ( ) . and_then ( |e| e. to_str ( ) ) {
16- let contents = contents. trim ( ) ;
17- if !contents. starts_with ( "//" ) && contents. contains ( "#[test]" ) {
18- tidy_error ! (
19- bad,
20- "`{}` contains `#[test]`; libcore tests must be placed inside \
21- `src/libcore/tests/`",
22- subpath. display( )
23- ) ;
16+ for line in contents. lines ( ) {
17+ let line = line. trim ( ) ;
18+ if !line. starts_with ( "//" ) && line. contains ( "#[test]" ) {
19+ tidy_error ! (
20+ bad,
21+ "`{}` contains `#[test]`; libcore tests must be placed inside \
22+ `src/libcore/tests/`",
23+ subpath. display( )
24+ ) ;
25+ }
2426 }
2527 }
2628 } ,
You can’t perform that action at this time.
0 commit comments