]> git.lizzy.rs Git - rust.git/commitdiff
require that header lines begin with `//`
authorNiko Matsakis <niko@alum.mit.edu>
Tue, 1 Mar 2016 15:43:09 +0000 (10:43 -0500)
committerNiko Matsakis <niko@alum.mit.edu>
Tue, 1 Mar 2016 15:43:09 +0000 (10:43 -0500)
src/compiletest/header.rs

index 6efe6e608e8ad9cd83188462a2134caaffc48c9b..d8d0c383d8e0cc7f9a464159c60a76ff41e88e39 100644 (file)
@@ -252,11 +252,12 @@ fn iter_header(testfile: &Path, it: &mut FnMut(&str) -> bool) -> bool {
         // module or function. This doesn't seem to be an optimization
         // with a warm page cache. Maybe with a cold one.
         let ln = ln.unwrap();
+        let ln = ln.trim();
         if ln.starts_with("fn") ||
                 ln.starts_with("mod") {
             return true;
-        } else {
-            if !(it(ln.trim())) {
+        } else if ln.starts_with("//") {
+            if !it(&ln[2..]) {
                 return false;
             }
         }