From 612b9237da553762c57c0aa902ef20d6bb25ffdc Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Tue, 2 Jun 2026 16:36:01 +0100 Subject: [PATCH] Rust: Undo hiding some warnings in the extraction consistency check query. --- rust/ql/consistency-queries/ExtractionConsistency.ql | 4 +--- .../CONSISTENCY/ExtractionConsistency.expected | 2 ++ .../diagnostics/CONSISTENCY/ExtractionConsistency.expected | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/rust/ql/consistency-queries/ExtractionConsistency.ql b/rust/ql/consistency-queries/ExtractionConsistency.ql index e07ed64df07..26ce4c31ecc 100644 --- a/rust/ql/consistency-queries/ExtractionConsistency.ql +++ b/rust/ql/consistency-queries/ExtractionConsistency.ql @@ -12,7 +12,5 @@ query predicate extractionError(ExtractionError ee) { } query predicate extractionWarning(ExtractionWarning ew) { - (not exists(ew.getLocation()) or ew.getLocation().fromSource()) and - // macro expansion failures are expected for macros like compile_error! and panic! - not ew.getMessage().matches("macro expansion failed for%") + (not exists(ew.getLocation()) or ew.getLocation().fromSource()) } diff --git a/rust/ql/test/extractor-tests/macro-expansion/CONSISTENCY/ExtractionConsistency.expected b/rust/ql/test/extractor-tests/macro-expansion/CONSISTENCY/ExtractionConsistency.expected index e69de29bb2d..5c472b07a14 100644 --- a/rust/ql/test/extractor-tests/macro-expansion/CONSISTENCY/ExtractionConsistency.expected +++ b/rust/ql/test/extractor-tests/macro-expansion/CONSISTENCY/ExtractionConsistency.expected @@ -0,0 +1,2 @@ +extractionWarning +| macro_expansion.rs:56:9:56:31 | macro expansion failed for 'concat' | diff --git a/rust/ql/test/query-tests/diagnostics/CONSISTENCY/ExtractionConsistency.expected b/rust/ql/test/query-tests/diagnostics/CONSISTENCY/ExtractionConsistency.expected index 5b4796faa8c..82c29ac7f2b 100644 --- a/rust/ql/test/query-tests/diagnostics/CONSISTENCY/ExtractionConsistency.expected +++ b/rust/ql/test/query-tests/diagnostics/CONSISTENCY/ExtractionConsistency.expected @@ -5,3 +5,4 @@ extractionWarning | does_not_compile.rs:2:21:2:20 | expected SEMICOLON | | does_not_compile.rs:2:26:2:25 | expected SEMICOLON | | error.rs:2:5:2:17 | An error! | +| my_macro.rs:17:9:17:27 | macro expansion failed for 'myUndefinedMacro' |