Skip to content

Commit 24f0851

Browse files
committed
require that header lines begin with //
1 parent 0a52494 commit 24f0851

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/compiletest/header.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,12 @@ fn iter_header(testfile: &Path, it: &mut FnMut(&str) -> bool) -> bool {
252252
// module or function. This doesn't seem to be an optimization
253253
// with a warm page cache. Maybe with a cold one.
254254
let ln = ln.unwrap();
255+
let ln = ln.trim();
255256
if ln.starts_with("fn") ||
256257
ln.starts_with("mod") {
257258
return true;
258-
} else {
259-
if !(it(ln.trim())) {
259+
} else if ln.starts_with("//") {
260+
if !it(&ln[2..]) {
260261
return false;
261262
}
262263
}

0 commit comments

Comments
 (0)