diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs index 52102e939f7ec..abfb89641bf92 100644 --- a/src/tools/compiletest/src/header.rs +++ b/src/tools/compiletest/src/header.rs @@ -973,7 +973,8 @@ fn iter_header( directive: original_directive_line, }); continue; - } else { + // Too prone to false positives to handle Makefile `#` directives...1 + } else if testfile.extension().is_some_and(|e| e == "rs") { *poisoned = true; eprintln!( "error: detected unknown compiletest test directive `{}` in {}:{}", @@ -997,7 +998,7 @@ fn iter_header( directive: original_directive_line, }); continue; - } else { + } else if testfile.extension().is_some_and(|e| e == "rs") { *poisoned = true; eprintln!( "error: detected unknown compiletest test directive `{}` in {}:{}",