Skip to content

Commit ad7c965

Browse files
committed
Rust: Correct extraction errors query to output only errors.
1 parent f30a642 commit ad7c965

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

rust/ql/lib/codeql/rust/Diagnostics.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ class Diagnostic extends @diagnostic {
4848
string toString() { result = this.getMessage() }
4949
}
5050

51-
/** A diagnostic relating to a particular error in extracting a file. */
51+
/** A diagnostic that is error severity. */
5252
class ExtractionError extends Diagnostic {
53-
ExtractionError() { this.getTag() = "parse_error" }
53+
ExtractionError() { this.getSeverity() = 40 }
5454
}
5555

5656
/** A diagnostic that is warning severity. */

rust/ql/src/queries/diagnostics/ExtractionErrors.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import codeql.rust.Diagnostics
99
import codeql.files.FileSystem
1010

11-
/** Gets the SARIF severity to associate an error. */
11+
/** Gets the SARIF severity to associate with an error. */
1212
int getSeverity() { result = 2 }
1313

1414
from ExtractionError error, File f
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +0,0 @@
1-
| does_not_compile.rs:2:6:2:5 | expected SEMICOLON | Extraction failed in does_not_compile.rs with error expected SEMICOLON | 2 |
2-
| does_not_compile.rs:2:9:2:8 | expected SEMICOLON | Extraction failed in does_not_compile.rs with error expected SEMICOLON | 2 |
3-
| does_not_compile.rs:2:13:2:12 | expected SEMICOLON | Extraction failed in does_not_compile.rs with error expected SEMICOLON | 2 |
4-
| does_not_compile.rs:2:21:2:20 | expected SEMICOLON | Extraction failed in does_not_compile.rs with error expected SEMICOLON | 2 |
5-
| does_not_compile.rs:2:26:2:25 | expected SEMICOLON | Extraction failed in does_not_compile.rs with error expected SEMICOLON | 2 |
6-
| does_not_compile.rs:2:32:2:31 | expected field name or number | Extraction failed in does_not_compile.rs with error expected field name or number | 2 |

0 commit comments

Comments
 (0)