about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2016-03-01 10:43:09 -0500
committerNiko Matsakis <niko@alum.mit.edu>2016-03-01 10:43:09 -0500
commit24f0851e670530b48ba0c098044a7fb235847501 (patch)
tree38fdbbdfad2277e07a71992e80504aa125a40a90
parent0a52494f7e259f49a3be176dc6fb151c755d6686 (diff)
downloadrust-24f0851e670530b48ba0c098044a7fb235847501.tar.gz
rust-24f0851e670530b48ba0c098044a7fb235847501.zip
require that header lines begin with `//`
-rw-r--r--src/compiletest/header.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiletest/header.rs b/src/compiletest/header.rs
index 6efe6e608e8..d8d0c383d8e 100644
--- a/src/compiletest/header.rs
+++ b/src/compiletest/header.rs
@@ -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;
             }
         }