From 112e7c95fa32f9c0d2931c9948b6db57465d6d82 Mon Sep 17 00:00:00 2001 From: Rasmus Lerchedahl Petersen Date: Tue, 24 Sep 2024 20:58:59 +0200 Subject: [PATCH 01/79] Python: all dict constructor args are relevant --- python/ql/lib/semmle/python/frameworks/Stdlib.qll | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/ql/lib/semmle/python/frameworks/Stdlib.qll b/python/ql/lib/semmle/python/frameworks/Stdlib.qll index 3c23b3929911..ca8b10d8578a 100644 --- a/python/ql/lib/semmle/python/frameworks/Stdlib.qll +++ b/python/ql/lib/semmle/python/frameworks/Stdlib.qll @@ -4219,7 +4219,7 @@ module StdlibPrivate { override predicate propagatesFlow(string input, string output, boolean preservesValue) { exists(DataFlow::DictionaryElementContent dc, string key | key = dc.getKey() | - input = "Argument[0].DictionaryElement[" + key + "]" and + input = "Argument[0..].DictionaryElement[" + key + "]" and output = "ReturnValue.DictionaryElement[" + key + "]" and preservesValue = true ) @@ -4230,7 +4230,7 @@ module StdlibPrivate { preservesValue = true ) or - input = "Argument[0]" and + input = "Argument[0..]" and output = "ReturnValue" and preservesValue = false } From 7da2845cad4dfbbdd90cc84d3c394b7734feb1c4 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:30:45 +0100 Subject: [PATCH 02/79] Rust: Uncomment two lines from the test that should now behave deterministically. --- rust/ql/test/query-tests/diagnostics/LinesOfCode.expected | 2 +- .../test/query-tests/diagnostics/LinesOfUserCode.expected | 2 +- .../query-tests/diagnostics/LinesOfUserCodeInFiles.expected | 2 +- rust/ql/test/query-tests/diagnostics/SummaryStats.expected | 6 +++--- rust/ql/test/query-tests/diagnostics/main.rs | 2 +- rust/ql/test/query-tests/diagnostics/my_macro.rs | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rust/ql/test/query-tests/diagnostics/LinesOfCode.expected b/rust/ql/test/query-tests/diagnostics/LinesOfCode.expected index 035a74975be8..d6a21ebb49cf 100644 --- a/rust/ql/test/query-tests/diagnostics/LinesOfCode.expected +++ b/rust/ql/test/query-tests/diagnostics/LinesOfCode.expected @@ -1 +1 @@ -| 48 | +| 49 | diff --git a/rust/ql/test/query-tests/diagnostics/LinesOfUserCode.expected b/rust/ql/test/query-tests/diagnostics/LinesOfUserCode.expected index 035a74975be8..d6a21ebb49cf 100644 --- a/rust/ql/test/query-tests/diagnostics/LinesOfUserCode.expected +++ b/rust/ql/test/query-tests/diagnostics/LinesOfUserCode.expected @@ -1 +1 @@ -| 48 | +| 49 | diff --git a/rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected b/rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected index 2be3f73088ca..dde3c7fe35a7 100644 --- a/rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected +++ b/rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected @@ -1,6 +1,6 @@ | my_struct.rs:0:0:0:0 | my_struct.rs | 21 | +| main.rs:0:0:0:0 | main.rs | 8 | | my_macro.rs:0:0:0:0 | my_macro.rs | 8 | -| main.rs:0:0:0:0 | main.rs | 7 | | lib.rs:0:0:0:0 | lib.rs | 6 | | does_not_compile.rs:0:0:0:0 | does_not_compile.rs | 3 | | error.rs:0:0:0:0 | error.rs | 3 | diff --git a/rust/ql/test/query-tests/diagnostics/SummaryStats.expected b/rust/ql/test/query-tests/diagnostics/SummaryStats.expected index 145a18cae05d..f92218d10d21 100644 --- a/rust/ql/test/query-tests/diagnostics/SummaryStats.expected +++ b/rust/ql/test/query-tests/diagnostics/SummaryStats.expected @@ -1,5 +1,5 @@ -| Elements extracted | 204 | +| Elements extracted | 211 | | Elements unextracted | 0 | | Files extracted | 6 | -| Lines of code extracted | 48 | -| Lines of user code extracted | 48 | +| Lines of code extracted | 49 | +| Lines of user code extracted | 49 | diff --git a/rust/ql/test/query-tests/diagnostics/main.rs b/rust/ql/test/query-tests/diagnostics/main.rs index 790547c0ff9d..6e0ddf695a3a 100644 --- a/rust/ql/test/query-tests/diagnostics/main.rs +++ b/rust/ql/test/query-tests/diagnostics/main.rs @@ -11,7 +11,7 @@ mod my_macro; // another comment fn main() { // another comment - //println!("Hello, world!"); // currently causes consistency issues + println!("Hello, world!"); my_struct::my_func(); my_macro::my_func(); diff --git a/rust/ql/test/query-tests/diagnostics/my_macro.rs b/rust/ql/test/query-tests/diagnostics/my_macro.rs index 0f85877c3c60..d8a0cc2812bd 100644 --- a/rust/ql/test/query-tests/diagnostics/my_macro.rs +++ b/rust/ql/test/query-tests/diagnostics/my_macro.rs @@ -7,7 +7,7 @@ macro_rules! myMacro { () => { - //println!("Hello, world!"); // currently causes consistency issues + println!("Hello, world!"); }; } From f8ce11b3a7d55ffeb656767239b81d0a19efb8f8 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:42:08 +0100 Subject: [PATCH 03/79] Rust: Improve File.getNumberOfLinesOfCode(). --- rust/ql/lib/codeql/files/FileSystem.qll | 5 ++++- rust/ql/test/query-tests/diagnostics/LinesOfCode.expected | 2 +- .../ql/test/query-tests/diagnostics/LinesOfUserCode.expected | 2 +- .../query-tests/diagnostics/LinesOfUserCodeInFiles.expected | 2 +- rust/ql/test/query-tests/diagnostics/SummaryStats.expected | 4 ++-- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/rust/ql/lib/codeql/files/FileSystem.qll b/rust/ql/lib/codeql/files/FileSystem.qll index f6926609d685..e4ff5aa0f7ed 100644 --- a/rust/ql/lib/codeql/files/FileSystem.qll +++ b/rust/ql/lib/codeql/files/FileSystem.qll @@ -2,6 +2,7 @@ private import codeql.Locations private import codeql.util.FileSystem +private import codeql.rust.elements.Module private import codeql.rust.elements.SourceFile private import codeql.rust.elements.AstNode @@ -44,7 +45,9 @@ class File extends Container, Impl::File { result = count(int line | exists(AstNode node, Location loc | - not node instanceof SourceFile and loc = node.getLocation() + not node instanceof Module and + not node instanceof SourceFile and + loc = node.getLocation() | node.getFile() = this and line = [loc.getStartLine(), loc.getEndLine()] and diff --git a/rust/ql/test/query-tests/diagnostics/LinesOfCode.expected b/rust/ql/test/query-tests/diagnostics/LinesOfCode.expected index d6a21ebb49cf..035a74975be8 100644 --- a/rust/ql/test/query-tests/diagnostics/LinesOfCode.expected +++ b/rust/ql/test/query-tests/diagnostics/LinesOfCode.expected @@ -1 +1 @@ -| 49 | +| 48 | diff --git a/rust/ql/test/query-tests/diagnostics/LinesOfUserCode.expected b/rust/ql/test/query-tests/diagnostics/LinesOfUserCode.expected index d6a21ebb49cf..035a74975be8 100644 --- a/rust/ql/test/query-tests/diagnostics/LinesOfUserCode.expected +++ b/rust/ql/test/query-tests/diagnostics/LinesOfUserCode.expected @@ -1 +1 @@ -| 49 | +| 48 | diff --git a/rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected b/rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected index dde3c7fe35a7..2be3f73088ca 100644 --- a/rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected +++ b/rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected @@ -1,6 +1,6 @@ | my_struct.rs:0:0:0:0 | my_struct.rs | 21 | -| main.rs:0:0:0:0 | main.rs | 8 | | my_macro.rs:0:0:0:0 | my_macro.rs | 8 | +| main.rs:0:0:0:0 | main.rs | 7 | | lib.rs:0:0:0:0 | lib.rs | 6 | | does_not_compile.rs:0:0:0:0 | does_not_compile.rs | 3 | | error.rs:0:0:0:0 | error.rs | 3 | diff --git a/rust/ql/test/query-tests/diagnostics/SummaryStats.expected b/rust/ql/test/query-tests/diagnostics/SummaryStats.expected index f92218d10d21..766ca8332fac 100644 --- a/rust/ql/test/query-tests/diagnostics/SummaryStats.expected +++ b/rust/ql/test/query-tests/diagnostics/SummaryStats.expected @@ -1,5 +1,5 @@ | Elements extracted | 211 | | Elements unextracted | 0 | | Files extracted | 6 | -| Lines of code extracted | 49 | -| Lines of user code extracted | 49 | +| Lines of code extracted | 48 | +| Lines of user code extracted | 48 | From caca4950e64097a18085e4928da940ad454e2ab1 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 26 Sep 2024 11:10:03 +0100 Subject: [PATCH 04/79] Rust: Revert the change to FileSystem.qll. --- rust/ql/lib/codeql/files/FileSystem.qll | 2 -- rust/ql/test/query-tests/diagnostics/LinesOfCode.expected | 2 +- rust/ql/test/query-tests/diagnostics/LinesOfUserCode.expected | 2 +- .../query-tests/diagnostics/LinesOfUserCodeInFiles.expected | 2 +- rust/ql/test/query-tests/diagnostics/SummaryStats.expected | 4 ++-- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/rust/ql/lib/codeql/files/FileSystem.qll b/rust/ql/lib/codeql/files/FileSystem.qll index e4ff5aa0f7ed..0b9351800ab6 100644 --- a/rust/ql/lib/codeql/files/FileSystem.qll +++ b/rust/ql/lib/codeql/files/FileSystem.qll @@ -2,7 +2,6 @@ private import codeql.Locations private import codeql.util.FileSystem -private import codeql.rust.elements.Module private import codeql.rust.elements.SourceFile private import codeql.rust.elements.AstNode @@ -45,7 +44,6 @@ class File extends Container, Impl::File { result = count(int line | exists(AstNode node, Location loc | - not node instanceof Module and not node instanceof SourceFile and loc = node.getLocation() | diff --git a/rust/ql/test/query-tests/diagnostics/LinesOfCode.expected b/rust/ql/test/query-tests/diagnostics/LinesOfCode.expected index 035a74975be8..d6a21ebb49cf 100644 --- a/rust/ql/test/query-tests/diagnostics/LinesOfCode.expected +++ b/rust/ql/test/query-tests/diagnostics/LinesOfCode.expected @@ -1 +1 @@ -| 48 | +| 49 | diff --git a/rust/ql/test/query-tests/diagnostics/LinesOfUserCode.expected b/rust/ql/test/query-tests/diagnostics/LinesOfUserCode.expected index 035a74975be8..d6a21ebb49cf 100644 --- a/rust/ql/test/query-tests/diagnostics/LinesOfUserCode.expected +++ b/rust/ql/test/query-tests/diagnostics/LinesOfUserCode.expected @@ -1 +1 @@ -| 48 | +| 49 | diff --git a/rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected b/rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected index 2be3f73088ca..dde3c7fe35a7 100644 --- a/rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected +++ b/rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected @@ -1,6 +1,6 @@ | my_struct.rs:0:0:0:0 | my_struct.rs | 21 | +| main.rs:0:0:0:0 | main.rs | 8 | | my_macro.rs:0:0:0:0 | my_macro.rs | 8 | -| main.rs:0:0:0:0 | main.rs | 7 | | lib.rs:0:0:0:0 | lib.rs | 6 | | does_not_compile.rs:0:0:0:0 | does_not_compile.rs | 3 | | error.rs:0:0:0:0 | error.rs | 3 | diff --git a/rust/ql/test/query-tests/diagnostics/SummaryStats.expected b/rust/ql/test/query-tests/diagnostics/SummaryStats.expected index 766ca8332fac..f92218d10d21 100644 --- a/rust/ql/test/query-tests/diagnostics/SummaryStats.expected +++ b/rust/ql/test/query-tests/diagnostics/SummaryStats.expected @@ -1,5 +1,5 @@ | Elements extracted | 211 | | Elements unextracted | 0 | | Files extracted | 6 | -| Lines of code extracted | 48 | -| Lines of user code extracted | 48 | +| Lines of code extracted | 49 | +| Lines of user code extracted | 49 | From 9357762e06ffec5e188319f3d2ea86dba5048295 Mon Sep 17 00:00:00 2001 From: Rasmus Lerchedahl Petersen Date: Tue, 1 Oct 2024 00:03:04 +0200 Subject: [PATCH 05/79] Python: remove superflous code This is handled by parameter-argument matching --- .../semmle/python/dataflow/new/internal/DataFlowDispatch.qll | 4 ---- 1 file changed, 4 deletions(-) diff --git a/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowDispatch.qll b/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowDispatch.qll index 28c1c652df46..88a6ed903146 100644 --- a/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowDispatch.qll +++ b/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowDispatch.qll @@ -372,10 +372,6 @@ abstract class DataFlowFunction extends DataFlowCallable, TFunction { result.getParameter() = func.getArg(index + this.positionalOffset()) ) or - exists(int index1, int index2 | ppos.isPositionalLowerBound(index1) and index2 >= index1 | - result.getParameter() = func.getArg(index2 + this.positionalOffset()) - ) - or exists(string name | ppos.isKeyword(name) | result.getParameter() = func.getArgByName(name)) or // `*args` From 1d6626c82151357893106ff277c4aeb4f35ea6c8 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Fri, 27 Sep 2024 15:02:37 +0200 Subject: [PATCH 06/79] Rust: Implement `IdentPat.toString()` --- rust/ql/.generated.list | 1 - rust/ql/.gitattributes | 1 - .../rust/elements/internal/IdentPatImpl.qll | 6 ++- .../generated/IdentPat/IdentPat.expected | 4 +- .../IdentPat/IdentPat_getName.expected | 4 +- .../IdentPat/IdentPat_getPat.expected | 2 +- .../generated/LetStmt/LetStmt_getPat.expected | 8 ++-- .../SlicePat/SlicePat_getPat.expected | 6 +-- .../TuplePat/TuplePat_getField.expected | 10 ++-- .../ql/test/extractor-tests/utf8/ast.expected | 2 +- .../CONSISTENCY/CfgConsistency.expected | 2 +- .../library-tests/controlflow/Cfg.expected | 46 +++++++++---------- 12 files changed, 46 insertions(+), 46 deletions(-) diff --git a/rust/ql/.generated.list b/rust/ql/.generated.list index eb997e2eeffc..2c4bb309f4c0 100644 --- a/rust/ql/.generated.list +++ b/rust/ql/.generated.list @@ -239,7 +239,6 @@ lib/codeql/rust/elements/internal/GenericParamImpl.qll f435f80d7f275803c1311d362 lib/codeql/rust/elements/internal/GenericParamListConstructor.qll 7221146d1724e0add3a8e70e0e46670142589eb7143425e1871ac4358a8c8bdb 2fbb7576444d6b2da6164245e2660d592d276ae2c1ca9f2bda5656b1c5c0a73a lib/codeql/rust/elements/internal/GenericParamListImpl.qll 524aa0949df6d4d2cb9bee6226650f63a6f181d7644933fa265673b281074885 27b0210e5eaa2040bc8a093e35e1394befb6994b25369544738d0447ef269a9c lib/codeql/rust/elements/internal/IdentPatConstructor.qll 09792f5a070996b65f095dc6b1b9e0fb096a56648eed26c0643c59f82377cab0 0bb1a9fcdc62b5197aef3dd6e0ea4d679dde10d5be54b57b5209727ba66e078b -lib/codeql/rust/elements/internal/IdentPatImpl.qll 10b2758419b48d34013d0e1ea55006a72ea351e5298c9cde4d988f510d4094eb 63bdb210d7bcab42888b4f44688966a33951061573b0a9a734b5b262cbfa2cd8 lib/codeql/rust/elements/internal/IfExprConstructor.qll 03088b54c8fa623f93a5b5a7eb896f680e8b0e9025488157a02c48aaebc6ad56 906f916c3690d0721a31dd31b302dcdcec4233bb507683007d82cf10793a648f lib/codeql/rust/elements/internal/IfExprImpl.qll 96dc5be0a650a74f96e0c2214eb58f1af5278ad1695ad790b660fdecb6738c14 06a292fcc459297ef3a0ef5c75c887f993ccd6350eb3fb0d2493e5b7c7199b6b lib/codeql/rust/elements/internal/ImplConstructor.qll 24edccca59f70d812d1458b412a45310ddc096d095332f6e3258903c54c1bb44 7eb673b3ab33a0873ee5ce189105425066b376821cce0fc9eb8ace22995f0bc7 diff --git a/rust/ql/.gitattributes b/rust/ql/.gitattributes index b3526b1ec22f..932ff725a476 100644 --- a/rust/ql/.gitattributes +++ b/rust/ql/.gitattributes @@ -241,7 +241,6 @@ /lib/codeql/rust/elements/internal/GenericParamListConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/GenericParamListImpl.qll linguist-generated /lib/codeql/rust/elements/internal/IdentPatConstructor.qll linguist-generated -/lib/codeql/rust/elements/internal/IdentPatImpl.qll linguist-generated /lib/codeql/rust/elements/internal/IfExprConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/IfExprImpl.qll linguist-generated /lib/codeql/rust/elements/internal/ImplConstructor.qll linguist-generated diff --git a/rust/ql/lib/codeql/rust/elements/internal/IdentPatImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/IdentPatImpl.qll index 6f90f3d6d032..0c6092074774 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/IdentPatImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/IdentPatImpl.qll @@ -1,4 +1,3 @@ -// generated by codegen, remove this comment if you wish to edit this file /** * This module provides a hand-modifiable wrapper around the generated class `IdentPat`. * @@ -12,6 +11,7 @@ private import codeql.rust.elements.internal.generated.IdentPat * be referenced directly. */ module Impl { + // the following QLdoc is generated: if you need to edit it, do it in the schema file /** * A binding pattern. For example: * ```rust @@ -27,5 +27,7 @@ module Impl { * }; * ``` */ - class IdentPat extends Generated::IdentPat { } + class IdentPat extends Generated::IdentPat { + override string toString() { result = this.getName().getText() } + } } diff --git a/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat.expected b/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat.expected index 53a4c59d3986..5f7d899ccab9 100644 --- a/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat.expected +++ b/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat.expected @@ -1,2 +1,2 @@ -| gen_ident_pat.rs:6:22:6:22 | IdentPat | getNumberOfAttrs: | 0 | hasName: | yes | hasPat: | no | -| gen_ident_pat.rs:10:9:10:25 | IdentPat | getNumberOfAttrs: | 0 | hasName: | yes | hasPat: | yes | +| gen_ident_pat.rs:6:22:6:22 | y | getNumberOfAttrs: | 0 | hasName: | yes | hasPat: | no | +| gen_ident_pat.rs:10:9:10:25 | y | getNumberOfAttrs: | 0 | hasName: | yes | hasPat: | yes | diff --git a/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat_getName.expected b/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat_getName.expected index 2a49521ead99..45273e9c8a41 100644 --- a/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat_getName.expected +++ b/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat_getName.expected @@ -1,2 +1,2 @@ -| gen_ident_pat.rs:6:22:6:22 | IdentPat | gen_ident_pat.rs:6:22:6:22 | Name | -| gen_ident_pat.rs:10:9:10:25 | IdentPat | gen_ident_pat.rs:10:9:10:9 | Name | +| gen_ident_pat.rs:6:22:6:22 | y | gen_ident_pat.rs:6:22:6:22 | Name | +| gen_ident_pat.rs:10:9:10:25 | y | gen_ident_pat.rs:10:9:10:9 | Name | diff --git a/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat_getPat.expected b/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat_getPat.expected index 705456753b9c..2e2f0d9228e0 100644 --- a/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat_getPat.expected +++ b/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat_getPat.expected @@ -1 +1 @@ -| gen_ident_pat.rs:10:9:10:25 | IdentPat | gen_ident_pat.rs:10:11:10:25 | TupleStructPat | +| gen_ident_pat.rs:10:9:10:25 | y | gen_ident_pat.rs:10:11:10:25 | TupleStructPat | diff --git a/rust/ql/test/extractor-tests/generated/LetStmt/LetStmt_getPat.expected b/rust/ql/test/extractor-tests/generated/LetStmt/LetStmt_getPat.expected index 37462e8cfb64..93810df10e36 100644 --- a/rust/ql/test/extractor-tests/generated/LetStmt/LetStmt_getPat.expected +++ b/rust/ql/test/extractor-tests/generated/LetStmt/LetStmt_getPat.expected @@ -1,6 +1,6 @@ -| gen_let_stmt.rs:5:5:5:15 | LetStmt | gen_let_stmt.rs:5:9:5:9 | IdentPat | -| gen_let_stmt.rs:6:5:6:20 | LetStmt | gen_let_stmt.rs:6:9:6:9 | IdentPat | -| gen_let_stmt.rs:7:5:7:15 | LetStmt | gen_let_stmt.rs:7:9:7:9 | IdentPat | -| gen_let_stmt.rs:8:5:8:10 | LetStmt | gen_let_stmt.rs:8:9:8:9 | IdentPat | +| gen_let_stmt.rs:5:5:5:15 | LetStmt | gen_let_stmt.rs:5:9:5:9 | x | +| gen_let_stmt.rs:6:5:6:20 | LetStmt | gen_let_stmt.rs:6:9:6:9 | x | +| gen_let_stmt.rs:7:5:7:15 | LetStmt | gen_let_stmt.rs:7:9:7:9 | x | +| gen_let_stmt.rs:8:5:8:10 | LetStmt | gen_let_stmt.rs:8:9:8:9 | x | | gen_let_stmt.rs:9:5:9:24 | LetStmt | gen_let_stmt.rs:9:9:9:14 | TuplePat | | gen_let_stmt.rs:10:5:12:6 | LetStmt | gen_let_stmt.rs:10:9:10:15 | TupleStructPat | diff --git a/rust/ql/test/extractor-tests/generated/SlicePat/SlicePat_getPat.expected b/rust/ql/test/extractor-tests/generated/SlicePat/SlicePat_getPat.expected index 7c5355875f33..e874d3a22ee4 100644 --- a/rust/ql/test/extractor-tests/generated/SlicePat/SlicePat_getPat.expected +++ b/rust/ql/test/extractor-tests/generated/SlicePat/SlicePat_getPat.expected @@ -6,8 +6,8 @@ | gen_slice_pat.rs:7:9:7:18 | SlicePat | 0 | gen_slice_pat.rs:7:10:7:10 | LiteralPat | | gen_slice_pat.rs:7:9:7:18 | SlicePat | 1 | gen_slice_pat.rs:7:13:7:13 | LiteralPat | | gen_slice_pat.rs:7:9:7:18 | SlicePat | 2 | gen_slice_pat.rs:7:16:7:17 | RestPat | -| gen_slice_pat.rs:8:9:8:24 | SlicePat | 0 | gen_slice_pat.rs:8:10:8:10 | IdentPat | -| gen_slice_pat.rs:8:9:8:24 | SlicePat | 1 | gen_slice_pat.rs:8:13:8:13 | IdentPat | +| gen_slice_pat.rs:8:9:8:24 | SlicePat | 0 | gen_slice_pat.rs:8:10:8:10 | x | +| gen_slice_pat.rs:8:9:8:24 | SlicePat | 1 | gen_slice_pat.rs:8:13:8:13 | y | | gen_slice_pat.rs:8:9:8:24 | SlicePat | 2 | gen_slice_pat.rs:8:16:8:17 | RestPat | -| gen_slice_pat.rs:8:9:8:24 | SlicePat | 3 | gen_slice_pat.rs:8:20:8:20 | IdentPat | +| gen_slice_pat.rs:8:9:8:24 | SlicePat | 3 | gen_slice_pat.rs:8:20:8:20 | z | | gen_slice_pat.rs:8:9:8:24 | SlicePat | 4 | gen_slice_pat.rs:8:23:8:23 | LiteralPat | diff --git a/rust/ql/test/extractor-tests/generated/TuplePat/TuplePat_getField.expected b/rust/ql/test/extractor-tests/generated/TuplePat/TuplePat_getField.expected index 8f42a4e1393e..59d028b43ca9 100644 --- a/rust/ql/test/extractor-tests/generated/TuplePat/TuplePat_getField.expected +++ b/rust/ql/test/extractor-tests/generated/TuplePat/TuplePat_getField.expected @@ -1,6 +1,6 @@ -| gen_tuple_pat.rs:5:9:5:14 | TuplePat | 0 | gen_tuple_pat.rs:5:10:5:10 | IdentPat | -| gen_tuple_pat.rs:5:9:5:14 | TuplePat | 1 | gen_tuple_pat.rs:5:13:5:13 | IdentPat | -| gen_tuple_pat.rs:6:9:6:22 | TuplePat | 0 | gen_tuple_pat.rs:6:10:6:10 | IdentPat | -| gen_tuple_pat.rs:6:9:6:22 | TuplePat | 1 | gen_tuple_pat.rs:6:13:6:13 | IdentPat | +| gen_tuple_pat.rs:5:9:5:14 | TuplePat | 0 | gen_tuple_pat.rs:5:10:5:10 | x | +| gen_tuple_pat.rs:5:9:5:14 | TuplePat | 1 | gen_tuple_pat.rs:5:13:5:13 | y | +| gen_tuple_pat.rs:6:9:6:22 | TuplePat | 0 | gen_tuple_pat.rs:6:10:6:10 | a | +| gen_tuple_pat.rs:6:9:6:22 | TuplePat | 1 | gen_tuple_pat.rs:6:13:6:13 | b | | gen_tuple_pat.rs:6:9:6:22 | TuplePat | 2 | gen_tuple_pat.rs:6:16:6:17 | RestPat | -| gen_tuple_pat.rs:6:9:6:22 | TuplePat | 3 | gen_tuple_pat.rs:6:21:6:21 | IdentPat | +| gen_tuple_pat.rs:6:9:6:22 | TuplePat | 3 | gen_tuple_pat.rs:6:21:6:21 | z | diff --git a/rust/ql/test/extractor-tests/utf8/ast.expected b/rust/ql/test/extractor-tests/utf8/ast.expected index 2ebf1fb7f03d..5f353287fbb1 100644 --- a/rust/ql/test/extractor-tests/utf8/ast.expected +++ b/rust/ql/test/extractor-tests/utf8/ast.expected @@ -34,6 +34,6 @@ | utf8-identifiers.rs:10:15:12:1 | BlockExpr | | utf8-identifiers.rs:10:15:12:1 | StmtList | | utf8-identifiers.rs:11:5:11:24 | LetStmt | -| utf8-identifiers.rs:11:9:11:9 | IdentPat | | utf8-identifiers.rs:11:9:11:9 | Name | +| utf8-identifiers.rs:11:9:11:9 | \u03b1 | | utf8-identifiers.rs:11:14:11:23 | 0.00001f64 | diff --git a/rust/ql/test/library-tests/controlflow/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/library-tests/controlflow/CONSISTENCY/CfgConsistency.expected index a997162e6cdc..ec8ec04bf3ea 100644 --- a/rust/ql/test/library-tests/controlflow/CONSISTENCY/CfgConsistency.expected +++ b/rust/ql/test/library-tests/controlflow/CONSISTENCY/CfgConsistency.expected @@ -1,5 +1,5 @@ deadEnd -| test.rs:55:13:55:17 | IdentPat | +| test.rs:55:13:55:17 | b | | test.rs:224:28:224:33 | ... < ... | | test.rs:239:30:239:48 | BlockExpr | scopeNoFirst diff --git a/rust/ql/test/library-tests/controlflow/Cfg.expected b/rust/ql/test/library-tests/controlflow/Cfg.expected index 43cc44ea2cbe..52715de2a267 100644 --- a/rust/ql/test/library-tests/controlflow/Cfg.expected +++ b/rust/ql/test/library-tests/controlflow/Cfg.expected @@ -14,8 +14,8 @@ | test.rs:8:5:24:5 | enter test_break_and_continue | test.rs:9:9:9:22 | LetStmt | | | test.rs:8:5:24:5 | exit test_break_and_continue (normal) | test.rs:8:5:24:5 | exit test_break_and_continue | | | test.rs:9:9:9:22 | LetStmt | test.rs:9:21:9:21 | PathExpr | | -| test.rs:9:13:9:17 | IdentPat | test.rs:10:9:22:9 | ExprStmt | match, no-match | -| test.rs:9:21:9:21 | PathExpr | test.rs:9:13:9:17 | IdentPat | | +| test.rs:9:13:9:17 | i | test.rs:10:9:22:9 | ExprStmt | match, no-match | +| test.rs:9:21:9:21 | PathExpr | test.rs:9:13:9:17 | i | | | test.rs:10:9:22:9 | ExprStmt | test.rs:11:13:11:24 | ExprStmt | | | test.rs:10:9:22:9 | LoopExpr | test.rs:23:9:23:20 | ExprStmt | | | test.rs:10:14:22:9 | BlockExpr | test.rs:11:13:11:24 | ExprStmt | | @@ -99,13 +99,13 @@ | test.rs:49:17:49:32 | ExprStmt | test.rs:49:17:49:31 | ContinueExpr | | | test.rs:54:5:60:5 | enter test_while | test.rs:55:9:55:25 | LetStmt | | | test.rs:55:9:55:25 | LetStmt | test.rs:55:21:55:24 | true | | -| test.rs:55:21:55:24 | true | test.rs:55:13:55:17 | IdentPat | | +| test.rs:55:21:55:24 | true | test.rs:55:13:55:17 | b | | | test.rs:69:1:72:1 | enter test_nested_function | test.rs:70:5:70:28 | LetStmt | | | test.rs:69:1:72:1 | exit test_nested_function (normal) | test.rs:69:1:72:1 | exit test_nested_function | | | test.rs:69:40:72:1 | BlockExpr | test.rs:69:1:72:1 | exit test_nested_function (normal) | | | test.rs:70:5:70:28 | LetStmt | test.rs:70:19:70:27 | ClosureExpr | | -| test.rs:70:9:70:15 | IdentPat | test.rs:71:5:71:11 | PathExpr | match, no-match | -| test.rs:70:19:70:27 | ClosureExpr | test.rs:70:9:70:15 | IdentPat | | +| test.rs:70:9:70:15 | add_one | test.rs:71:5:71:11 | PathExpr | match, no-match | +| test.rs:70:19:70:27 | ClosureExpr | test.rs:70:9:70:15 | add_one | | | test.rs:70:19:70:27 | enter ClosureExpr | test.rs:70:23:70:23 | PathExpr | | | test.rs:70:19:70:27 | exit ClosureExpr (normal) | test.rs:70:19:70:27 | exit ClosureExpr | | | test.rs:70:23:70:23 | PathExpr | test.rs:70:27:70:27 | 1 | | @@ -212,8 +212,8 @@ | test.rs:129:5:136:5 | exit test_if_assignment (normal) | test.rs:129:5:136:5 | exit test_if_assignment | | | test.rs:129:42:136:5 | BlockExpr | test.rs:129:5:136:5 | exit test_if_assignment (normal) | | | test.rs:130:9:130:26 | LetStmt | test.rs:130:21:130:25 | false | | -| test.rs:130:13:130:17 | IdentPat | test.rs:131:12:131:12 | PathExpr | match, no-match | -| test.rs:130:21:130:25 | false | test.rs:130:13:130:17 | IdentPat | | +| test.rs:130:13:130:17 | x | test.rs:131:12:131:12 | PathExpr | match, no-match | +| test.rs:130:21:130:25 | false | test.rs:130:13:130:17 | x | | | test.rs:131:9:135:9 | IfExpr | test.rs:129:42:136:5 | BlockExpr | | | test.rs:131:12:131:12 | PathExpr | test.rs:131:16:131:19 | true | | | test.rs:131:12:131:19 | ... = ... | test.rs:132:13:132:13 | 1 | true | @@ -288,50 +288,50 @@ | test.rs:177:5:180:5 | exit test_and_operator (normal) | test.rs:177:5:180:5 | exit test_and_operator | | | test.rs:177:61:180:5 | BlockExpr | test.rs:177:5:180:5 | exit test_and_operator (normal) | | | test.rs:178:9:178:28 | LetStmt | test.rs:178:17:178:27 | ... && ... | | -| test.rs:178:13:178:13 | IdentPat | test.rs:179:9:179:9 | PathExpr | match, no-match | -| test.rs:178:17:178:17 | PathExpr | test.rs:178:13:178:13 | IdentPat | false | +| test.rs:178:13:178:13 | d | test.rs:179:9:179:9 | PathExpr | match, no-match | +| test.rs:178:17:178:17 | PathExpr | test.rs:178:13:178:13 | d | false | | test.rs:178:17:178:17 | PathExpr | test.rs:178:22:178:22 | PathExpr | true | | test.rs:178:17:178:22 | ... && ... | test.rs:178:17:178:17 | PathExpr | | | test.rs:178:17:178:27 | ... && ... | test.rs:178:17:178:22 | ... && ... | | -| test.rs:178:22:178:22 | PathExpr | test.rs:178:13:178:13 | IdentPat | false | +| test.rs:178:22:178:22 | PathExpr | test.rs:178:13:178:13 | d | false | | test.rs:178:22:178:22 | PathExpr | test.rs:178:27:178:27 | PathExpr | true | -| test.rs:178:27:178:27 | PathExpr | test.rs:178:13:178:13 | IdentPat | | +| test.rs:178:27:178:27 | PathExpr | test.rs:178:13:178:13 | d | | | test.rs:179:9:179:9 | PathExpr | test.rs:177:61:180:5 | BlockExpr | | | test.rs:182:5:185:5 | enter test_or_operator | test.rs:183:9:183:28 | LetStmt | | | test.rs:182:5:185:5 | exit test_or_operator (normal) | test.rs:182:5:185:5 | exit test_or_operator | | | test.rs:182:60:185:5 | BlockExpr | test.rs:182:5:185:5 | exit test_or_operator (normal) | | | test.rs:183:9:183:28 | LetStmt | test.rs:183:17:183:27 | ... \|\| ... | | -| test.rs:183:13:183:13 | IdentPat | test.rs:184:9:184:9 | PathExpr | match, no-match | -| test.rs:183:17:183:17 | PathExpr | test.rs:183:13:183:13 | IdentPat | true | +| test.rs:183:13:183:13 | d | test.rs:184:9:184:9 | PathExpr | match, no-match | +| test.rs:183:17:183:17 | PathExpr | test.rs:183:13:183:13 | d | true | | test.rs:183:17:183:17 | PathExpr | test.rs:183:22:183:22 | PathExpr | false | | test.rs:183:17:183:22 | ... \|\| ... | test.rs:183:17:183:17 | PathExpr | | | test.rs:183:17:183:27 | ... \|\| ... | test.rs:183:17:183:22 | ... \|\| ... | | -| test.rs:183:22:183:22 | PathExpr | test.rs:183:13:183:13 | IdentPat | true | +| test.rs:183:22:183:22 | PathExpr | test.rs:183:13:183:13 | d | true | | test.rs:183:22:183:22 | PathExpr | test.rs:183:27:183:27 | PathExpr | false | -| test.rs:183:27:183:27 | PathExpr | test.rs:183:13:183:13 | IdentPat | | +| test.rs:183:27:183:27 | PathExpr | test.rs:183:13:183:13 | d | | | test.rs:184:9:184:9 | PathExpr | test.rs:182:60:185:5 | BlockExpr | | | test.rs:187:5:190:5 | enter test_or_operator_2 | test.rs:188:9:188:36 | LetStmt | | | test.rs:187:5:190:5 | exit test_or_operator_2 (normal) | test.rs:187:5:190:5 | exit test_or_operator_2 | | | test.rs:187:61:190:5 | BlockExpr | test.rs:187:5:190:5 | exit test_or_operator_2 (normal) | | | test.rs:188:9:188:36 | LetStmt | test.rs:188:17:188:35 | ... \|\| ... | | -| test.rs:188:13:188:13 | IdentPat | test.rs:189:9:189:9 | PathExpr | match, no-match | -| test.rs:188:17:188:17 | PathExpr | test.rs:188:13:188:13 | IdentPat | true | +| test.rs:188:13:188:13 | d | test.rs:189:9:189:9 | PathExpr | match, no-match | +| test.rs:188:17:188:17 | PathExpr | test.rs:188:13:188:13 | d | true | | test.rs:188:17:188:17 | PathExpr | test.rs:188:23:188:23 | PathExpr | false | | test.rs:188:17:188:30 | ... \|\| ... | test.rs:188:17:188:17 | PathExpr | | | test.rs:188:17:188:35 | ... \|\| ... | test.rs:188:17:188:30 | ... \|\| ... | | -| test.rs:188:22:188:30 | ParenExpr | test.rs:188:13:188:13 | IdentPat | true | +| test.rs:188:22:188:30 | ParenExpr | test.rs:188:13:188:13 | d | true | | test.rs:188:22:188:30 | ParenExpr | test.rs:188:35:188:35 | PathExpr | false | | test.rs:188:23:188:23 | PathExpr | test.rs:188:28:188:29 | 28 | | | test.rs:188:23:188:29 | ... == ... | test.rs:188:22:188:30 | ParenExpr | | | test.rs:188:28:188:29 | 28 | test.rs:188:23:188:29 | ... == ... | | -| test.rs:188:35:188:35 | PathExpr | test.rs:188:13:188:13 | IdentPat | | +| test.rs:188:35:188:35 | PathExpr | test.rs:188:13:188:13 | d | | | test.rs:189:9:189:9 | PathExpr | test.rs:187:61:190:5 | BlockExpr | | | test.rs:192:5:195:5 | enter test_not_operator | test.rs:193:9:193:19 | LetStmt | | | test.rs:192:5:195:5 | exit test_not_operator (normal) | test.rs:192:5:195:5 | exit test_not_operator | | | test.rs:192:43:195:5 | BlockExpr | test.rs:192:5:195:5 | exit test_not_operator (normal) | | | test.rs:193:9:193:19 | LetStmt | test.rs:193:18:193:18 | PathExpr | | -| test.rs:193:13:193:13 | IdentPat | test.rs:194:9:194:9 | PathExpr | match, no-match | -| test.rs:193:17:193:18 | ! ... | test.rs:193:13:193:13 | IdentPat | | +| test.rs:193:13:193:13 | d | test.rs:194:9:194:9 | PathExpr | match, no-match | +| test.rs:193:17:193:18 | ! ... | test.rs:193:13:193:13 | d | | | test.rs:193:18:193:18 | PathExpr | test.rs:193:17:193:18 | ! ... | | | test.rs:194:9:194:9 | PathExpr | test.rs:192:43:195:5 | BlockExpr | | | test.rs:197:5:203:5 | enter test_if_and_operator | test.rs:198:12:198:22 | ... && ... | | @@ -416,8 +416,8 @@ | test.rs:251:1:264:1 | exit labelled_block (normal) | test.rs:251:1:264:1 | exit labelled_block | | | test.rs:251:28:264:1 | BlockExpr | test.rs:251:1:264:1 | exit labelled_block (normal) | | | test.rs:252:5:263:6 | LetStmt | test.rs:253:9:253:19 | ExprStmt | | -| test.rs:252:9:252:14 | IdentPat | test.rs:251:28:264:1 | BlockExpr | match, no-match | -| test.rs:252:18:263:5 | BlockExpr | test.rs:252:9:252:14 | IdentPat | | +| test.rs:252:9:252:14 | result | test.rs:251:28:264:1 | BlockExpr | match, no-match | +| test.rs:252:18:263:5 | BlockExpr | test.rs:252:9:252:14 | result | | | test.rs:253:9:253:16 | PathExpr | test.rs:253:9:253:18 | CallExpr | | | test.rs:253:9:253:18 | CallExpr | test.rs:254:9:256:9 | ExprStmt | | | test.rs:253:9:253:19 | ExprStmt | test.rs:253:9:253:16 | PathExpr | | From a282efc43e7a004c48c280ebdd9fced583e63f30 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Tue, 1 Oct 2024 09:09:14 +0200 Subject: [PATCH 07/79] Rust: Add inline test expectations library --- rust/ql/.generated.list | 1 - rust/ql/.gitattributes | 1 - .../codeql/rust/elements/internal/CommentImpl.qll | 11 +++++++++-- rust/ql/test/utils/InlineExpectationsTest.qll | 8 ++++++++ .../utils/internal/InlineExpectationsTestImpl.qll | 15 +++++++++++++++ 5 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 rust/ql/test/utils/InlineExpectationsTest.qll create mode 100644 rust/ql/test/utils/internal/InlineExpectationsTestImpl.qll diff --git a/rust/ql/.generated.list b/rust/ql/.generated.list index 2c4bb309f4c0..18337b8a6d78 100644 --- a/rust/ql/.generated.list +++ b/rust/ql/.generated.list @@ -193,7 +193,6 @@ lib/codeql/rust/elements/internal/ClosureBinderImpl.qll 58c6b17d34d678802ce3484f lib/codeql/rust/elements/internal/ClosureExprConstructor.qll a348229d2b25c7ebd43b58461830b7915e92d31ae83436ec831e0c4873f6218a 70a1d2ac33db3ac4da5826b0e8628f2f29a8f9cdfd8e4fd0e488d90ce0031a38 lib/codeql/rust/elements/internal/ClosureExprImpl.qll 5ae3d211273b3effc3bff9f06bcef480f8264084e0509e69b8ff29bc29f47b05 ff562bc8d15ecb76ada3111c7c74dd990a0e80f41a32477f5f2f7db9e8f71102 lib/codeql/rust/elements/internal/CommentConstructor.qll 0b4a6a976d667bf7595500dfb91b9cfc87460a501837ba5382d9a8d8321d7736 7d02d8c94a319dc48e7978d5270e33fc5c308d443768ff96b618236d250123f1 -lib/codeql/rust/elements/internal/CommentImpl.qll c1b7f2fca9cfb7e611b25486ca5f06c4996f4436b72ed3a76e27a6409af4ec01 36f7d7c6d2dadda4d3423afc4f23bdaf275978b6f3d9ca71bf145afc92858f9c lib/codeql/rust/elements/internal/ConstArgConstructor.qll f63021dc1ca2276786da3a981d06c18d7a360b5e75c08bca5d1afece4f7c4a83 487a870cbf5ed6554d671a8e159edd9261d853eba2d28ce2bd459759f47f11f2 lib/codeql/rust/elements/internal/ConstArgImpl.qll 234fe6533c208a1731cdb423aa3a28909bd7e042dbc28bbedfd4f62e42b6f21e c576a49006f7a10483041fc07f2f0d089710ac61840be61a2e71140db709f9c6 lib/codeql/rust/elements/internal/ConstBlockPatConstructor.qll ddb4a0045635d477e87360ecafec0ba90ddcffc6e62996eb6e7edd5a5d65b860 442061d0497a615b3f008b990f5e3c4f045110f76500eff81a7f44ffd1319acf diff --git a/rust/ql/.gitattributes b/rust/ql/.gitattributes index 932ff725a476..8e15852654c4 100644 --- a/rust/ql/.gitattributes +++ b/rust/ql/.gitattributes @@ -195,7 +195,6 @@ /lib/codeql/rust/elements/internal/ClosureExprConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/ClosureExprImpl.qll linguist-generated /lib/codeql/rust/elements/internal/CommentConstructor.qll linguist-generated -/lib/codeql/rust/elements/internal/CommentImpl.qll linguist-generated /lib/codeql/rust/elements/internal/ConstArgConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/ConstArgImpl.qll linguist-generated /lib/codeql/rust/elements/internal/ConstBlockPatConstructor.qll linguist-generated diff --git a/rust/ql/lib/codeql/rust/elements/internal/CommentImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/CommentImpl.qll index 0e5b68b0f358..32a4f415ab7c 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/CommentImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/CommentImpl.qll @@ -1,4 +1,3 @@ -// generated by codegen, remove this comment if you wish to edit this file /** * This module provides a hand-modifiable wrapper around the generated class `Comment`. * @@ -12,6 +11,7 @@ private import codeql.rust.elements.internal.generated.Comment * be referenced directly. */ module Impl { + // the following QLdoc is generated: if you need to edit it, do it in the schema file /** * A comment. For example: * ```rust @@ -19,5 +19,12 @@ module Impl { * /// This is a doc comment * ``` */ - class Comment extends Generated::Comment { } + class Comment extends Generated::Comment { + /** + * Gets the text of this comment, excluding the comment marker. + */ + string getCommentText() { + exists(string s | s = this.getText() | result = s.regexpCapture("///?\\s*(.*)", 1)) + } + } } diff --git a/rust/ql/test/utils/InlineExpectationsTest.qll b/rust/ql/test/utils/InlineExpectationsTest.qll new file mode 100644 index 000000000000..840e04ccbe01 --- /dev/null +++ b/rust/ql/test/utils/InlineExpectationsTest.qll @@ -0,0 +1,8 @@ +/** + * Inline expectation tests for Rust. + * See `shared/util/codeql/util/test/InlineExpectationsTest.qll` + */ + +private import codeql.util.test.InlineExpectationsTest +private import internal.InlineExpectationsTestImpl +import Make diff --git a/rust/ql/test/utils/internal/InlineExpectationsTestImpl.qll b/rust/ql/test/utils/internal/InlineExpectationsTestImpl.qll new file mode 100644 index 000000000000..74b8a39431de --- /dev/null +++ b/rust/ql/test/utils/internal/InlineExpectationsTestImpl.qll @@ -0,0 +1,15 @@ +private import rust as R +private import R +private import codeql.util.test.InlineExpectationsTest + +module Impl implements InlineExpectationsTestSig { + /** + * A class representing line comments in C# used by the InlineExpectations core code + */ + class ExpectationComment extends R::Comment { + /** Gets the contents of the given comment, _without_ the preceding comment marker (`//`). */ + string getContents() { result = this.getCommentText() } + } + + class Location = R::Location; +} From bd68986fa4669251b440e6a6e7f22b0f0485fbd8 Mon Sep 17 00:00:00 2001 From: Rasmus Lerchedahl Petersen Date: Tue, 1 Oct 2024 10:01:22 +0200 Subject: [PATCH 08/79] Python: add test showing `dict` can take multiple arguments --- .../test/library-tests/dataflow/coverage/test_builtins.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python/ql/test/library-tests/dataflow/coverage/test_builtins.py b/python/ql/test/library-tests/dataflow/coverage/test_builtins.py index 245923370765..2de6adeb20bf 100644 --- a/python/ql/test/library-tests/dataflow/coverage/test_builtins.py +++ b/python/ql/test/library-tests/dataflow/coverage/test_builtins.py @@ -142,6 +142,13 @@ def test_dict_from_dict(): SINK(d2["k"]) #$ flow="SOURCE, l:-2 -> d2['k']" SINK_F(d2["k1"]) +def test_dict_from_multiple_args(): + d = dict([("k", SOURCE), ("k1", NONSOURCE)], k2 = SOURCE, k3 = NONSOURCE) + SINK(d["k"]) #$ MISSING: flow="SOURCE, l:-1 -> d['k']" + SINK_F(d["k1"]) + SINK(d["k2"]) #$ flow="SOURCE, l:-3 -> d['k2']" + SINK_F(d["k3"]) + ## Container methods ### List From b0efffd8f05e7418eb24ff9f935383eb072449f3 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Fri, 27 Sep 2024 15:03:35 +0200 Subject: [PATCH 09/79] Rust: AST support for variables --- rust/ql/lib/codeql/rust/elements/Variable.qll | 9 + .../rust/elements/internal/VariableImpl.qll | 340 ++++++++++++++++++ rust/ql/lib/rust.qll | 1 + .../LetExpr/LetExpr_getExpr.expected | 2 +- .../MatchArm/MatchArm_getExpr.expected | 2 +- .../MatchExpr/MatchExpr_getExpr.expected | 4 +- .../library-tests/controlflow/Cfg.expected | 208 +++++------ .../CONSISTENCY/CfgConsistency.expected | 5 + .../variables/variables.expected | 144 ++++++++ .../test/library-tests/variables/variables.ql | 41 +++ .../test/library-tests/variables/variables.rs | 325 +++++++++++++++++ 11 files changed, 973 insertions(+), 108 deletions(-) create mode 100644 rust/ql/lib/codeql/rust/elements/Variable.qll create mode 100644 rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll create mode 100644 rust/ql/test/library-tests/variables/CONSISTENCY/CfgConsistency.expected create mode 100644 rust/ql/test/library-tests/variables/variables.expected create mode 100644 rust/ql/test/library-tests/variables/variables.ql create mode 100644 rust/ql/test/library-tests/variables/variables.rs diff --git a/rust/ql/lib/codeql/rust/elements/Variable.qll b/rust/ql/lib/codeql/rust/elements/Variable.qll new file mode 100644 index 000000000000..76c2d9f19f72 --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/Variable.qll @@ -0,0 +1,9 @@ +/** + * This module provides classes related to variables. + */ + +private import internal.VariableImpl + +final class Variable = Impl::Variable; + +final class VariableAccess = Impl::VariableAccess; diff --git a/rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll new file mode 100644 index 000000000000..9ddf1d9755a1 --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll @@ -0,0 +1,340 @@ +private import rust +private import codeql.rust.elements.internal.generated.ParentChild +private import codeql.rust.elements.internal.PathExprImpl::Impl as PathExprImpl + +module Impl { + /** + * A variable scope. Either a block `{ ... }`, the guard/rhs + * of a match arm, or the body of a closure. + */ + abstract class VariableScope extends AstNode { } + + class BlockExprScope extends VariableScope, BlockExpr { } + + abstract class MatchArmScope extends VariableScope { + MatchArm arm; + + bindingset[arm] + MatchArmScope() { exists(arm) } + + Pat getPat() { result = arm.getPat() } + } + + class MatchArmExprScope extends MatchArmScope { + MatchArmExprScope() { this = arm.getExpr() } + } + + class MatchArmGuardScope extends MatchArmScope { + MatchArmGuardScope() { this = arm.getGuard() } + } + + class ClosureBodyScope extends VariableScope { + ClosureBodyScope() { this = any(ClosureExpr ce).getBody() } + } + + private Pat getImmediatePatParent(AstNode n) { + result = getImmediateParent(n) + or + result.(RecordPat).getRecordPatFieldList().getAField().getPat() = n + } + + private Pat getAPatAncestor(Pat p) { + (p instanceof IdentPat or p instanceof OrPat) and + exists(Pat p0 | result = getImmediatePatParent(p0) | + p0 = p + or + p0 = getAPatAncestor(p) and + not p0 instanceof OrPat + ) + } + + /** Gets the immediately enclosing `|` pattern of `p`, if any */ + private OrPat getEnclosingOrPat(Pat p) { result = getAPatAncestor(p) } + + /** Gets the outermost enclosing `|` pattern parent of `p`, if any. */ + private OrPat getOutermostEnclosingOrPat(IdentPat p) { + result = getEnclosingOrPat+(p) and + not exists(getEnclosingOrPat(result)) + } + + /** + * Holds if `p` declares a variable named `name` at `definingNode`. Normally, + * `definingNode = p`, except in cases like + * + * ```rust + * match either { + * Either::Left(x) | Either::Right(x) => println!(x), + * } + * ``` + * + * where `definingNode` is the entire `Either::Left(x) | Either::Right(x)` + * pattern. + */ + private predicate variableDecl(AstNode definingNode, IdentPat p, string name) { + ( + definingNode = getOutermostEnclosingOrPat(p) + or + not exists(getOutermostEnclosingOrPat(p)) and + definingNode = p.getName() + ) and + name = p.getName().getText() + } + + /** A variable. */ + class Variable extends MkVariable { + private AstNode definingNode; + private string name; + + Variable() { this = MkVariable(definingNode, name) } + + /** Gets the name of this variable. */ + string getName() { result = name } + + /** Gets the location of this variable. */ + Location getLocation() { result = definingNode.getLocation() } + + /** Gets a textual representation of this variable. */ + string toString() { result = this.getName() } + + /** Gets an access to this variable. */ + VariableAccess getAnAccess() { result.getVariable() = this } + } + + /** A path expression that may access a local variable. */ + private class VariableAccessCand extends PathExpr { + string name_; + + VariableAccessCand() { + exists(Path p, PathSegment ps | + p = this.getPath() and + not p.hasQualifier() and + ps = p.getPart() and + not ps.hasGenericArgList() and + not ps.hasParamList() and + not ps.hasPathType() and + not ps.hasReturnTypeSyntax() and + name_ = ps.getNameRef().getText() + ) + } + + string getName() { result = name_ } + } + + private AstNode getAnAncestorInVariableScope(AstNode n) { + ( + n instanceof Pat or + n instanceof VariableAccessCand or + n instanceof LetStmt or + n instanceof VariableScope + ) and + exists(AstNode n0 | result = getImmediateParent(n0) | + n0 = n + or + n0 = getAnAncestorInVariableScope(n) and + not n0 instanceof VariableScope + ) + } + + /** Gets the immediately enclosing variable scope of `n`. */ + private VariableScope getEnclosingScope(AstNode n) { result = getAnAncestorInVariableScope(n) } + + private Pat getAVariablePatAncestor(Variable v) { + exists(AstNode definingNode, string name | + v = MkVariable(definingNode, name) and + variableDecl(definingNode, result, name) + ) + or + exists(Pat mid | + mid = getAVariablePatAncestor(v) and + result = getImmediatePatParent(mid) + ) + } + + /** + * Holds if `v` is named `name` and is declared inside variable scope + * `scope`, and `v` is bound starting from `(line, column)`. + */ + private predicate variableDeclInScope( + Variable v, VariableScope scope, string name, int line, int column + ) { + name = v.getName() and + exists(Pat pat | pat = getAVariablePatAncestor(v) | + scope = + any(MatchArmScope arm | + arm.getPat() = pat and + arm.getLocation().hasLocationInfo(_, line, column, _, _) + ) + or + exists(Function f | + f.getParamList().getAParam().getPat() = pat and + scope = f.getBody() and + scope.getLocation().hasLocationInfo(_, line, column, _, _) + ) + or + exists(LetStmt let | + let.getPat() = pat and + scope = getEnclosingScope(let) and + // for `let` statements, variables are bound _after_ the statement, i.e. + // not in the RHS + let.getLocation().hasLocationInfo(_, _, _, line, column) + ) + or + exists(IfExpr ie, LetExpr let | + let.getPat() = pat and + ie.getCondition() = let and + scope = ie.getThen() and + scope.getLocation().hasLocationInfo(_, line, column, _, _) + ) + or + exists(ForExpr fe | + fe.getPat() = pat and + scope = fe.getLoopBody() and + scope.getLocation().hasLocationInfo(_, line, column, _, _) + ) + or + exists(ClosureExpr ce | + ce.getParamList().getAParam().getPat() = pat and + scope = ce.getBody() and + scope.getLocation().hasLocationInfo(_, line, column, _, _) + ) + ) + } + + /** + * Holds if `cand` may access a variable named `name` at + * `(startline, startcolumn, endline, endcolumn)` in the variable scope + * `scope`. + * + * `nestLevel` is the number of nested scopes that need to be traversed + * to reach `scope` from `cand`. + */ + private predicate variableAccessCandInScope( + VariableAccessCand cand, VariableScope scope, string name, int nestLevel, int startline, + int startcolumn, int endline, int endcolumn + ) { + name = cand.getName() and + scope = [cand.(VariableScope), getEnclosingScope(cand)] and + cand.getLocation().hasLocationInfo(_, startline, startcolumn, endline, endcolumn) and + nestLevel = 0 + or + exists(VariableScope inner | + variableAccessCandInScope(cand, inner, name, nestLevel - 1, _, _, _, _) and + scope = getEnclosingScope(inner) and + // Use the location of the inner scope as the location of the access, instead of the + // actual access location. This allows us to collapse multiple accesses in inner + // scopes to a single entity + scope.getLocation().hasLocationInfo(_, startline, startcolumn, endline, endcolumn) + ) + } + + private newtype TVariableOrAccessCand = + TVariableOrAccessCandVariable(Variable v) or + TVariableOrAccessCandVariableAccessCand(VariableAccessCand va) + + private class VariableOrAccessCand extends TVariableOrAccessCand { + Variable asVariable() { this = TVariableOrAccessCandVariable(result) } + + VariableAccessCand asVariableAccessCand() { + this = TVariableOrAccessCandVariableAccessCand(result) + } + + string toString() { + result = this.asVariable().toString() or result = this.asVariableAccessCand().toString() + } + + Location getLocation() { + result = this.asVariable().getLocation() or result = this.asVariableAccessCand().getLocation() + } + + pragma[nomagic] + predicate rankBy( + string name, VariableScope scope, int startline, int startcolumn, int endline, int endcolumn + ) { + variableDeclInScope(this.asVariable(), scope, name, startline, startcolumn) and + endline = -1 and + endcolumn = -1 + or + variableAccessCandInScope(this.asVariableAccessCand(), scope, name, _, startline, startcolumn, + endline, endcolumn) + } + } + + /** + * Gets the rank of `v` amongst all other declarations or access candidates + * to a variable named `name` in the variable scope `scope`. + */ + private int rankVariableOrAccess(VariableScope scope, string name, VariableOrAccessCand v) { + v = + rank[result + 1](VariableOrAccessCand v0, int startline, int startcolumn, int endline, + int endcolumn | + v0.rankBy(name, scope, startline, startcolumn, endline, endcolumn) + | + v0 order by startline, startcolumn, endline, endcolumn + ) + } + + /** + * Holds if `v` can reach rank `rnk` in the variable scope `scope`. This is needed to + * take shadowing into account, for example in + * + * ```rust + * let x = 0; // rank 0 + * use(x); // rank 1 + * let x = ""; // rank 2 + * use(x); // rank 3 + * ``` + * + * the declaration at rank 0 can only reach the access at rank 1, while the declaration + * at rank 2 can only reach the access at rank 3. + */ + private predicate variableReachesRank(VariableScope scope, string name, Variable v, int rnk) { + rnk = rankVariableOrAccess(scope, name, TVariableOrAccessCandVariable(v)) + or + variableReachesRank(scope, name, v, rnk - 1) and + rnk = rankVariableOrAccess(scope, name, TVariableOrAccessCandVariableAccessCand(_)) + } + + private predicate variableReachesCand( + VariableScope scope, string name, Variable v, VariableAccessCand cand, int nestLevel + ) { + exists(int rnk | + variableReachesRank(scope, name, v, rnk) and + rnk = rankVariableOrAccess(scope, name, TVariableOrAccessCandVariableAccessCand(cand)) and + variableAccessCandInScope(cand, scope, name, nestLevel, _, _, _, _) + ) + } + + /** A variable access. */ + class VariableAccess extends PathExprImpl::PathExpr instanceof VariableAccessCand { + private string name; + private Variable v; + + VariableAccess() { variableAccess(_, name, v, this) } + + /** Gets the variable being accessed. */ + Variable getVariable() { result = v } + + override string toString() { result = name } + + override string getAPrimaryQlClass() { result = "VariableAccess" } + } + + cached + private module Cached { + cached + newtype TVariable = + MkVariable(AstNode definingNode, string name) { variableDecl(definingNode, _, name) } + + cached + predicate variableAccess(VariableScope scope, string name, Variable v, VariableAccessCand cand) { + v = + min(Variable v0, int nestLevel | + variableReachesCand(scope, name, v0, cand, nestLevel) + | + v0 order by nestLevel + ) + } + } + + private import Cached +} diff --git a/rust/ql/lib/rust.qll b/rust/ql/lib/rust.qll index 72d2bd5498d2..7723400c41b6 100644 --- a/rust/ql/lib/rust.qll +++ b/rust/ql/lib/rust.qll @@ -4,3 +4,4 @@ import codeql.rust.elements import codeql.Locations import codeql.files.FileSystem import codeql.rust.elements.LogicalOperation +import codeql.rust.elements.Variable diff --git a/rust/ql/test/extractor-tests/generated/LetExpr/LetExpr_getExpr.expected b/rust/ql/test/extractor-tests/generated/LetExpr/LetExpr_getExpr.expected index 66fab8ec8099..f90fa5862299 100644 --- a/rust/ql/test/extractor-tests/generated/LetExpr/LetExpr_getExpr.expected +++ b/rust/ql/test/extractor-tests/generated/LetExpr/LetExpr_getExpr.expected @@ -1 +1 @@ -| gen_let_expr.rs:5:8:5:31 | LetExpr | gen_let_expr.rs:5:22:5:31 | PathExpr | +| gen_let_expr.rs:5:8:5:31 | LetExpr | gen_let_expr.rs:5:22:5:31 | maybe_some | diff --git a/rust/ql/test/extractor-tests/generated/MatchArm/MatchArm_getExpr.expected b/rust/ql/test/extractor-tests/generated/MatchArm/MatchArm_getExpr.expected index ea9eaff95307..493ea8d9bb03 100644 --- a/rust/ql/test/extractor-tests/generated/MatchArm/MatchArm_getExpr.expected +++ b/rust/ql/test/extractor-tests/generated/MatchArm/MatchArm_getExpr.expected @@ -1,4 +1,4 @@ -| gen_match_arm.rs:6:9:6:29 | MatchArm | gen_match_arm.rs:6:28:6:28 | PathExpr | +| gen_match_arm.rs:6:9:6:29 | MatchArm | gen_match_arm.rs:6:28:6:28 | y | | gen_match_arm.rs:7:9:7:26 | MatchArm | gen_match_arm.rs:7:25:7:25 | 0 | | gen_match_arm.rs:10:9:10:35 | MatchArm | gen_match_arm.rs:10:30:10:34 | ... / ... | | gen_match_arm.rs:11:9:11:15 | MatchArm | gen_match_arm.rs:11:14:11:14 | 0 | diff --git a/rust/ql/test/extractor-tests/generated/MatchExpr/MatchExpr_getExpr.expected b/rust/ql/test/extractor-tests/generated/MatchExpr/MatchExpr_getExpr.expected index 631592c910d6..924eb3f807fa 100644 --- a/rust/ql/test/extractor-tests/generated/MatchExpr/MatchExpr_getExpr.expected +++ b/rust/ql/test/extractor-tests/generated/MatchExpr/MatchExpr_getExpr.expected @@ -1,2 +1,2 @@ -| gen_match_expr.rs:5:5:8:5 | MatchExpr | gen_match_expr.rs:5:11:5:11 | PathExpr | -| gen_match_expr.rs:9:5:12:5 | MatchExpr | gen_match_expr.rs:9:11:9:11 | PathExpr | +| gen_match_expr.rs:5:5:8:5 | MatchExpr | gen_match_expr.rs:5:11:5:11 | x | +| gen_match_expr.rs:9:5:12:5 | MatchExpr | gen_match_expr.rs:9:11:9:11 | x | diff --git a/rust/ql/test/library-tests/controlflow/Cfg.expected b/rust/ql/test/library-tests/controlflow/Cfg.expected index 52715de2a267..d0ab3bd10d63 100644 --- a/rust/ql/test/library-tests/controlflow/Cfg.expected +++ b/rust/ql/test/library-tests/controlflow/Cfg.expected @@ -13,9 +13,9 @@ | test.rs:3:21:3:22 | 42 | test.rs:3:5:3:23 | CallExpr | | | test.rs:8:5:24:5 | enter test_break_and_continue | test.rs:9:9:9:22 | LetStmt | | | test.rs:8:5:24:5 | exit test_break_and_continue (normal) | test.rs:8:5:24:5 | exit test_break_and_continue | | -| test.rs:9:9:9:22 | LetStmt | test.rs:9:21:9:21 | PathExpr | | +| test.rs:9:9:9:22 | LetStmt | test.rs:9:21:9:21 | n | | | test.rs:9:13:9:17 | i | test.rs:10:9:22:9 | ExprStmt | match, no-match | -| test.rs:9:21:9:21 | PathExpr | test.rs:9:13:9:17 | i | | +| test.rs:9:21:9:21 | n | test.rs:9:13:9:17 | i | | | test.rs:10:9:22:9 | ExprStmt | test.rs:11:13:11:24 | ExprStmt | | | test.rs:10:9:22:9 | LoopExpr | test.rs:23:9:23:20 | ExprStmt | | | test.rs:10:14:22:9 | BlockExpr | test.rs:11:13:11:24 | ExprStmt | | @@ -67,15 +67,15 @@ | test.rs:27:9:36:9 | LoopExpr | test.rs:37:9:37:12 | true | | | test.rs:27:22:36:9 | BlockExpr | test.rs:29:17:33:17 | ExprStmt | | | test.rs:28:13:35:13 | LoopExpr | test.rs:27:22:36:9 | BlockExpr | | -| test.rs:29:17:33:17 | ExprStmt | test.rs:29:20:29:20 | PathExpr | | +| test.rs:29:17:33:17 | ExprStmt | test.rs:29:20:29:20 | b | | | test.rs:29:17:33:17 | IfExpr | test.rs:34:17:34:29 | ExprStmt | | -| test.rs:29:20:29:20 | PathExpr | test.rs:30:21:30:26 | ExprStmt | true | -| test.rs:29:20:29:20 | PathExpr | test.rs:31:27:31:27 | PathExpr | false | +| test.rs:29:20:29:20 | b | test.rs:30:21:30:26 | ExprStmt | true | +| test.rs:29:20:29:20 | b | test.rs:31:27:31:27 | b | false | | test.rs:30:21:30:25 | BreakExpr | test.rs:28:13:35:13 | LoopExpr | break | | test.rs:30:21:30:26 | ExprStmt | test.rs:30:21:30:25 | BreakExpr | | | test.rs:31:24:33:17 | IfExpr | test.rs:29:17:33:17 | IfExpr | | -| test.rs:31:27:31:27 | PathExpr | test.rs:31:24:33:17 | IfExpr | false | -| test.rs:31:27:31:27 | PathExpr | test.rs:32:21:32:33 | ExprStmt | true | +| test.rs:31:27:31:27 | b | test.rs:31:24:33:17 | IfExpr | false | +| test.rs:31:27:31:27 | b | test.rs:32:21:32:33 | ExprStmt | true | | test.rs:32:21:32:32 | BreakExpr | test.rs:27:9:36:9 | LoopExpr | break('outer) | | test.rs:32:21:32:33 | ExprStmt | test.rs:32:21:32:32 | BreakExpr | | | test.rs:34:17:34:28 | BreakExpr | test.rs:28:13:35:13 | LoopExpr | break('inner) | @@ -84,15 +84,15 @@ | test.rs:40:5:52:5 | enter test_continue_with_labels | test.rs:42:13:42:14 | ExprStmt | | | test.rs:42:13:42:13 | 1 | test.rs:44:17:48:17 | ExprStmt | | | test.rs:42:13:42:14 | ExprStmt | test.rs:42:13:42:13 | 1 | | -| test.rs:44:17:48:17 | ExprStmt | test.rs:44:20:44:20 | PathExpr | | +| test.rs:44:17:48:17 | ExprStmt | test.rs:44:20:44:20 | b | | | test.rs:44:17:48:17 | IfExpr | test.rs:49:17:49:32 | ExprStmt | | -| test.rs:44:20:44:20 | PathExpr | test.rs:45:21:45:29 | ExprStmt | true | -| test.rs:44:20:44:20 | PathExpr | test.rs:46:27:46:27 | PathExpr | false | +| test.rs:44:20:44:20 | b | test.rs:45:21:45:29 | ExprStmt | true | +| test.rs:44:20:44:20 | b | test.rs:46:27:46:27 | b | false | | test.rs:45:21:45:28 | ContinueExpr | test.rs:44:17:48:17 | ExprStmt | continue | | test.rs:45:21:45:29 | ExprStmt | test.rs:45:21:45:28 | ContinueExpr | | | test.rs:46:24:48:17 | IfExpr | test.rs:44:17:48:17 | IfExpr | | -| test.rs:46:27:46:27 | PathExpr | test.rs:46:24:48:17 | IfExpr | false | -| test.rs:46:27:46:27 | PathExpr | test.rs:47:21:47:36 | ExprStmt | true | +| test.rs:46:27:46:27 | b | test.rs:46:24:48:17 | IfExpr | false | +| test.rs:46:27:46:27 | b | test.rs:47:21:47:36 | ExprStmt | true | | test.rs:47:21:47:35 | ContinueExpr | test.rs:42:13:42:14 | ExprStmt | continue('outer) | | test.rs:47:21:47:36 | ExprStmt | test.rs:47:21:47:35 | ContinueExpr | | | test.rs:49:17:49:31 | ContinueExpr | test.rs:44:17:48:17 | ExprStmt | continue('inner) | @@ -104,30 +104,30 @@ | test.rs:69:1:72:1 | exit test_nested_function (normal) | test.rs:69:1:72:1 | exit test_nested_function | | | test.rs:69:40:72:1 | BlockExpr | test.rs:69:1:72:1 | exit test_nested_function (normal) | | | test.rs:70:5:70:28 | LetStmt | test.rs:70:19:70:27 | ClosureExpr | | -| test.rs:70:9:70:15 | add_one | test.rs:71:5:71:11 | PathExpr | match, no-match | +| test.rs:70:9:70:15 | add_one | test.rs:71:5:71:11 | add_one | match, no-match | | test.rs:70:19:70:27 | ClosureExpr | test.rs:70:9:70:15 | add_one | | -| test.rs:70:19:70:27 | enter ClosureExpr | test.rs:70:23:70:23 | PathExpr | | +| test.rs:70:19:70:27 | enter ClosureExpr | test.rs:70:23:70:23 | i | | | test.rs:70:19:70:27 | exit ClosureExpr (normal) | test.rs:70:19:70:27 | exit ClosureExpr | | -| test.rs:70:23:70:23 | PathExpr | test.rs:70:27:70:27 | 1 | | +| test.rs:70:23:70:23 | i | test.rs:70:27:70:27 | 1 | | | test.rs:70:23:70:27 | ... + ... | test.rs:70:19:70:27 | exit ClosureExpr (normal) | | | test.rs:70:27:70:27 | 1 | test.rs:70:23:70:27 | ... + ... | | -| test.rs:71:5:71:11 | PathExpr | test.rs:71:13:71:19 | PathExpr | | +| test.rs:71:5:71:11 | add_one | test.rs:71:13:71:19 | add_one | | | test.rs:71:5:71:23 | CallExpr | test.rs:69:40:72:1 | BlockExpr | | -| test.rs:71:13:71:19 | PathExpr | test.rs:71:21:71:21 | PathExpr | | +| test.rs:71:13:71:19 | add_one | test.rs:71:21:71:21 | n | | | test.rs:71:13:71:22 | CallExpr | test.rs:71:5:71:23 | CallExpr | | -| test.rs:71:21:71:21 | PathExpr | test.rs:71:13:71:22 | CallExpr | | -| test.rs:76:5:82:5 | enter test_if_else | test.rs:77:12:77:12 | PathExpr | | +| test.rs:71:21:71:21 | n | test.rs:71:13:71:22 | CallExpr | | +| test.rs:76:5:82:5 | enter test_if_else | test.rs:77:12:77:12 | n | | | test.rs:76:5:82:5 | exit test_if_else (normal) | test.rs:76:5:82:5 | exit test_if_else | | | test.rs:76:36:82:5 | BlockExpr | test.rs:76:5:82:5 | exit test_if_else (normal) | | | test.rs:77:9:81:9 | IfExpr | test.rs:76:36:82:5 | BlockExpr | | -| test.rs:77:12:77:12 | PathExpr | test.rs:77:17:77:17 | 0 | | +| test.rs:77:12:77:12 | n | test.rs:77:17:77:17 | 0 | | | test.rs:77:12:77:17 | ... <= ... | test.rs:78:13:78:13 | 0 | true | -| test.rs:77:12:77:17 | ... <= ... | test.rs:80:13:80:13 | PathExpr | false | +| test.rs:77:12:77:17 | ... <= ... | test.rs:80:13:80:13 | n | false | | test.rs:77:17:77:17 | 0 | test.rs:77:12:77:17 | ... <= ... | | | test.rs:77:19:79:9 | BlockExpr | test.rs:77:9:81:9 | IfExpr | | | test.rs:78:13:78:13 | 0 | test.rs:77:19:79:9 | BlockExpr | | | test.rs:79:16:81:9 | BlockExpr | test.rs:77:9:81:9 | IfExpr | | -| test.rs:80:13:80:13 | PathExpr | test.rs:80:17:80:17 | 1 | | +| test.rs:80:13:80:13 | n | test.rs:80:17:80:17 | 1 | | | test.rs:80:13:80:17 | ... - ... | test.rs:79:16:81:9 | BlockExpr | | | test.rs:80:17:80:17 | 1 | test.rs:80:13:80:17 | ... - ... | | | test.rs:84:5:90:5 | enter test_if_let_else | test.rs:85:12:85:26 | LetExpr | | @@ -135,10 +135,10 @@ | test.rs:84:48:90:5 | BlockExpr | test.rs:84:5:90:5 | exit test_if_let_else (normal) | | | test.rs:85:9:89:9 | IfExpr | test.rs:84:48:90:5 | BlockExpr | | | test.rs:85:12:85:26 | LetExpr | test.rs:85:16:85:22 | TupleStructPat | | -| test.rs:85:16:85:22 | TupleStructPat | test.rs:86:13:86:13 | PathExpr | match | +| test.rs:85:16:85:22 | TupleStructPat | test.rs:86:13:86:13 | n | match | | test.rs:85:16:85:22 | TupleStructPat | test.rs:88:13:88:13 | 0 | no-match | | test.rs:85:28:87:9 | BlockExpr | test.rs:85:9:89:9 | IfExpr | | -| test.rs:86:13:86:13 | PathExpr | test.rs:85:28:87:9 | BlockExpr | | +| test.rs:86:13:86:13 | n | test.rs:85:28:87:9 | BlockExpr | | | test.rs:87:16:89:9 | BlockExpr | test.rs:85:9:89:9 | IfExpr | | | test.rs:88:13:88:13 | 0 | test.rs:87:16:89:9 | BlockExpr | | | test.rs:92:5:97:5 | enter test_if_let | test.rs:93:9:95:9 | ExprStmt | | @@ -148,9 +148,9 @@ | test.rs:93:9:95:9 | IfExpr | test.rs:96:9:96:9 | 0 | | | test.rs:93:12:93:26 | LetExpr | test.rs:93:16:93:22 | TupleStructPat | | | test.rs:93:16:93:22 | TupleStructPat | test.rs:93:9:95:9 | IfExpr | no-match | -| test.rs:93:16:93:22 | TupleStructPat | test.rs:94:13:94:13 | PathExpr | match | +| test.rs:93:16:93:22 | TupleStructPat | test.rs:94:13:94:13 | n | match | | test.rs:93:28:95:9 | BlockExpr | test.rs:93:9:95:9 | IfExpr | | -| test.rs:94:13:94:13 | PathExpr | test.rs:93:28:95:9 | BlockExpr | | +| test.rs:94:13:94:13 | n | test.rs:93:28:95:9 | BlockExpr | | | test.rs:96:9:96:9 | 0 | test.rs:92:43:97:5 | BlockExpr | | | test.rs:99:5:105:5 | enter test_nested_if | test.rs:100:16:100:16 | PathExpr | | | test.rs:99:5:105:5 | exit test_nested_if (normal) | test.rs:99:5:105:5 | exit test_nested_if | | @@ -160,30 +160,30 @@ | test.rs:100:12:100:49 | ParenExpr | test.rs:103:13:103:13 | 0 | false | | test.rs:100:13:100:48 | IfExpr | test.rs:100:12:100:49 | ParenExpr | | | test.rs:100:16:100:16 | PathExpr | test.rs:100:20:100:20 | 0 | | -| test.rs:100:16:100:20 | ... < ... | test.rs:100:24:100:24 | PathExpr | true | -| test.rs:100:16:100:20 | ... < ... | test.rs:100:41:100:41 | PathExpr | false | +| test.rs:100:16:100:20 | ... < ... | test.rs:100:24:100:24 | a | true | +| test.rs:100:16:100:20 | ... < ... | test.rs:100:41:100:41 | a | false | | test.rs:100:20:100:20 | 0 | test.rs:100:16:100:20 | ... < ... | | | test.rs:100:22:100:32 | BlockExpr | test.rs:100:13:100:48 | IfExpr | | -| test.rs:100:24:100:24 | PathExpr | test.rs:100:29:100:30 | 10 | | +| test.rs:100:24:100:24 | a | test.rs:100:29:100:30 | 10 | | | test.rs:100:24:100:30 | ... < ... | test.rs:100:22:100:32 | BlockExpr | | | test.rs:100:28:100:30 | - ... | test.rs:100:24:100:30 | ... < ... | | | test.rs:100:29:100:30 | 10 | test.rs:100:28:100:30 | - ... | | | test.rs:100:39:100:48 | BlockExpr | test.rs:100:13:100:48 | IfExpr | | -| test.rs:100:41:100:41 | PathExpr | test.rs:100:45:100:46 | 10 | | +| test.rs:100:41:100:41 | a | test.rs:100:45:100:46 | 10 | | | test.rs:100:41:100:46 | ... > ... | test.rs:100:39:100:48 | BlockExpr | | | test.rs:100:45:100:46 | 10 | test.rs:100:41:100:46 | ... > ... | | | test.rs:100:51:102:9 | BlockExpr | test.rs:100:9:104:9 | IfExpr | | | test.rs:101:13:101:13 | 1 | test.rs:100:51:102:9 | BlockExpr | | | test.rs:102:16:104:9 | BlockExpr | test.rs:100:9:104:9 | IfExpr | | | test.rs:103:13:103:13 | 0 | test.rs:102:16:104:9 | BlockExpr | | -| test.rs:107:5:116:5 | enter test_nested_if_match | test.rs:108:19:108:19 | PathExpr | | +| test.rs:107:5:116:5 | enter test_nested_if_match | test.rs:108:19:108:19 | a | | | test.rs:107:5:116:5 | exit test_nested_if_match (normal) | test.rs:107:5:116:5 | exit test_nested_if_match | | | test.rs:107:44:116:5 | BlockExpr | test.rs:107:5:116:5 | exit test_nested_if_match (normal) | | | test.rs:108:9:115:9 | IfExpr | test.rs:107:44:116:5 | BlockExpr | | | test.rs:108:12:111:10 | ParenExpr | test.rs:112:13:112:13 | 1 | true | | test.rs:108:12:111:10 | ParenExpr | test.rs:114:13:114:13 | 0 | false | | test.rs:108:13:111:9 | MatchExpr | test.rs:108:12:111:10 | ParenExpr | | -| test.rs:108:19:108:19 | PathExpr | test.rs:109:13:109:13 | LiteralPat | | +| test.rs:108:19:108:19 | a | test.rs:109:13:109:13 | LiteralPat | | | test.rs:109:13:109:13 | LiteralPat | test.rs:109:18:109:21 | true | match | | test.rs:109:13:109:13 | LiteralPat | test.rs:110:13:110:13 | WildcardPat | no-match | | test.rs:109:18:109:21 | true | test.rs:108:13:111:9 | MatchExpr | | @@ -199,9 +199,9 @@ | test.rs:119:9:126:9 | IfExpr | test.rs:118:44:127:5 | BlockExpr | | | test.rs:119:12:122:9 | BlockExpr | test.rs:123:13:123:13 | 1 | true | | test.rs:119:12:122:9 | BlockExpr | test.rs:125:13:125:13 | 0 | false | -| test.rs:120:13:120:14 | TupleExpr | test.rs:121:13:121:13 | PathExpr | | +| test.rs:120:13:120:14 | TupleExpr | test.rs:121:13:121:13 | a | | | test.rs:120:13:120:15 | ExprStmt | test.rs:120:13:120:14 | TupleExpr | | -| test.rs:121:13:121:13 | PathExpr | test.rs:121:17:121:17 | 0 | | +| test.rs:121:13:121:13 | a | test.rs:121:17:121:17 | 0 | | | test.rs:121:13:121:17 | ... > ... | test.rs:119:12:122:9 | BlockExpr | false, true | | test.rs:121:17:121:17 | 0 | test.rs:121:13:121:17 | ... > ... | | | test.rs:122:11:124:9 | BlockExpr | test.rs:119:9:126:9 | IfExpr | | @@ -212,10 +212,10 @@ | test.rs:129:5:136:5 | exit test_if_assignment (normal) | test.rs:129:5:136:5 | exit test_if_assignment | | | test.rs:129:42:136:5 | BlockExpr | test.rs:129:5:136:5 | exit test_if_assignment (normal) | | | test.rs:130:9:130:26 | LetStmt | test.rs:130:21:130:25 | false | | -| test.rs:130:13:130:17 | x | test.rs:131:12:131:12 | PathExpr | match, no-match | +| test.rs:130:13:130:17 | x | test.rs:131:12:131:12 | x | match, no-match | | test.rs:130:21:130:25 | false | test.rs:130:13:130:17 | x | | | test.rs:131:9:135:9 | IfExpr | test.rs:129:42:136:5 | BlockExpr | | -| test.rs:131:12:131:12 | PathExpr | test.rs:131:16:131:19 | true | | +| test.rs:131:12:131:12 | x | test.rs:131:16:131:19 | true | | | test.rs:131:12:131:19 | ... = ... | test.rs:132:13:132:13 | 1 | true | | test.rs:131:12:131:19 | ... = ... | test.rs:134:13:134:13 | 0 | false | | test.rs:131:16:131:19 | true | test.rs:131:12:131:19 | ... = ... | | @@ -232,19 +232,19 @@ | test.rs:139:13:144:9 | LoopExpr | test.rs:139:12:144:10 | ParenExpr | | | test.rs:139:18:144:9 | BlockExpr | test.rs:140:13:142:14 | ExprStmt | | | test.rs:140:13:142:13 | IfExpr | test.rs:143:13:143:19 | ExprStmt | | -| test.rs:140:13:142:14 | ExprStmt | test.rs:140:16:140:16 | PathExpr | | -| test.rs:140:16:140:16 | PathExpr | test.rs:140:20:140:20 | 0 | | +| test.rs:140:13:142:14 | ExprStmt | test.rs:140:16:140:16 | a | | +| test.rs:140:16:140:16 | a | test.rs:140:20:140:20 | 0 | | | test.rs:140:16:140:20 | ... > ... | test.rs:140:13:142:13 | IfExpr | false | | test.rs:140:16:140:20 | ... > ... | test.rs:141:17:141:29 | ExprStmt | true | | test.rs:140:20:140:20 | 0 | test.rs:140:16:140:20 | ... > ... | | | test.rs:141:17:141:28 | BreakExpr | test.rs:139:13:144:9 | LoopExpr | break | -| test.rs:141:17:141:29 | ExprStmt | test.rs:141:23:141:23 | PathExpr | | -| test.rs:141:23:141:23 | PathExpr | test.rs:141:27:141:28 | 10 | | +| test.rs:141:17:141:29 | ExprStmt | test.rs:141:23:141:23 | a | | +| test.rs:141:23:141:23 | a | test.rs:141:27:141:28 | 10 | | | test.rs:141:23:141:28 | ... > ... | test.rs:141:17:141:28 | BreakExpr | | | test.rs:141:27:141:28 | 10 | test.rs:141:23:141:28 | ... > ... | | -| test.rs:143:13:143:13 | PathExpr | test.rs:143:17:143:18 | 10 | | +| test.rs:143:13:143:13 | a | test.rs:143:17:143:18 | 10 | | | test.rs:143:13:143:18 | ... < ... | test.rs:139:18:144:9 | BlockExpr | | -| test.rs:143:13:143:19 | ExprStmt | test.rs:143:13:143:13 | PathExpr | | +| test.rs:143:13:143:19 | ExprStmt | test.rs:143:13:143:13 | a | | | test.rs:143:17:143:18 | 10 | test.rs:143:13:143:18 | ... < ... | | | test.rs:144:12:146:9 | BlockExpr | test.rs:139:9:148:9 | IfExpr | | | test.rs:145:13:145:13 | 1 | test.rs:144:12:146:9 | BlockExpr | | @@ -259,19 +259,19 @@ | test.rs:152:13:157:9 | LoopExpr | test.rs:152:12:157:10 | ParenExpr | | | test.rs:152:26:157:9 | BlockExpr | test.rs:153:13:155:14 | ExprStmt | | | test.rs:153:13:155:13 | IfExpr | test.rs:156:13:156:19 | ExprStmt | | -| test.rs:153:13:155:14 | ExprStmt | test.rs:153:16:153:16 | PathExpr | | -| test.rs:153:16:153:16 | PathExpr | test.rs:153:20:153:20 | 0 | | +| test.rs:153:13:155:14 | ExprStmt | test.rs:153:16:153:16 | a | | +| test.rs:153:16:153:16 | a | test.rs:153:20:153:20 | 0 | | | test.rs:153:16:153:20 | ... > ... | test.rs:153:13:155:13 | IfExpr | false | | test.rs:153:16:153:20 | ... > ... | test.rs:154:17:154:36 | ExprStmt | true | | test.rs:153:20:153:20 | 0 | test.rs:153:16:153:20 | ... > ... | | | test.rs:154:17:154:35 | BreakExpr | test.rs:152:13:157:9 | LoopExpr | break('label) | -| test.rs:154:17:154:36 | ExprStmt | test.rs:154:30:154:30 | PathExpr | | -| test.rs:154:30:154:30 | PathExpr | test.rs:154:34:154:35 | 10 | | +| test.rs:154:17:154:36 | ExprStmt | test.rs:154:30:154:30 | a | | +| test.rs:154:30:154:30 | a | test.rs:154:34:154:35 | 10 | | | test.rs:154:30:154:35 | ... > ... | test.rs:154:17:154:35 | BreakExpr | | | test.rs:154:34:154:35 | 10 | test.rs:154:30:154:35 | ... > ... | | -| test.rs:156:13:156:13 | PathExpr | test.rs:156:17:156:18 | 10 | | +| test.rs:156:13:156:13 | a | test.rs:156:17:156:18 | 10 | | | test.rs:156:13:156:18 | ... < ... | test.rs:152:26:157:9 | BlockExpr | | -| test.rs:156:13:156:19 | ExprStmt | test.rs:156:13:156:13 | PathExpr | | +| test.rs:156:13:156:19 | ExprStmt | test.rs:156:13:156:13 | a | | | test.rs:156:17:156:18 | 10 | test.rs:156:13:156:18 | ... < ... | | | test.rs:157:12:159:9 | BlockExpr | test.rs:152:9:161:9 | IfExpr | | | test.rs:158:13:158:13 | 1 | test.rs:157:12:159:9 | BlockExpr | | @@ -280,72 +280,72 @@ | test.rs:164:5:172:5 | enter test_labelled_block | test.rs:166:13:166:31 | ExprStmt | | | test.rs:164:5:172:5 | exit test_labelled_block (normal) | test.rs:164:5:172:5 | exit test_labelled_block | | | test.rs:166:13:166:30 | BreakExpr | test.rs:164:5:172:5 | exit test_labelled_block (normal) | break('block) | -| test.rs:166:13:166:31 | ExprStmt | test.rs:166:26:166:26 | PathExpr | | -| test.rs:166:26:166:26 | PathExpr | test.rs:166:30:166:30 | 0 | | +| test.rs:166:13:166:31 | ExprStmt | test.rs:166:26:166:26 | a | | +| test.rs:166:26:166:26 | a | test.rs:166:30:166:30 | 0 | | | test.rs:166:26:166:30 | ... > ... | test.rs:166:13:166:30 | BreakExpr | | | test.rs:166:30:166:30 | 0 | test.rs:166:26:166:30 | ... > ... | | | test.rs:177:5:180:5 | enter test_and_operator | test.rs:178:9:178:28 | LetStmt | | | test.rs:177:5:180:5 | exit test_and_operator (normal) | test.rs:177:5:180:5 | exit test_and_operator | | | test.rs:177:61:180:5 | BlockExpr | test.rs:177:5:180:5 | exit test_and_operator (normal) | | | test.rs:178:9:178:28 | LetStmt | test.rs:178:17:178:27 | ... && ... | | -| test.rs:178:13:178:13 | d | test.rs:179:9:179:9 | PathExpr | match, no-match | -| test.rs:178:17:178:17 | PathExpr | test.rs:178:13:178:13 | d | false | -| test.rs:178:17:178:17 | PathExpr | test.rs:178:22:178:22 | PathExpr | true | -| test.rs:178:17:178:22 | ... && ... | test.rs:178:17:178:17 | PathExpr | | +| test.rs:178:13:178:13 | d | test.rs:179:9:179:9 | d | match, no-match | +| test.rs:178:17:178:17 | a | test.rs:178:13:178:13 | d | false | +| test.rs:178:17:178:17 | a | test.rs:178:22:178:22 | b | true | +| test.rs:178:17:178:22 | ... && ... | test.rs:178:17:178:17 | a | | | test.rs:178:17:178:27 | ... && ... | test.rs:178:17:178:22 | ... && ... | | -| test.rs:178:22:178:22 | PathExpr | test.rs:178:13:178:13 | d | false | -| test.rs:178:22:178:22 | PathExpr | test.rs:178:27:178:27 | PathExpr | true | -| test.rs:178:27:178:27 | PathExpr | test.rs:178:13:178:13 | d | | -| test.rs:179:9:179:9 | PathExpr | test.rs:177:61:180:5 | BlockExpr | | +| test.rs:178:22:178:22 | b | test.rs:178:13:178:13 | d | false | +| test.rs:178:22:178:22 | b | test.rs:178:27:178:27 | c | true | +| test.rs:178:27:178:27 | c | test.rs:178:13:178:13 | d | | +| test.rs:179:9:179:9 | d | test.rs:177:61:180:5 | BlockExpr | | | test.rs:182:5:185:5 | enter test_or_operator | test.rs:183:9:183:28 | LetStmt | | | test.rs:182:5:185:5 | exit test_or_operator (normal) | test.rs:182:5:185:5 | exit test_or_operator | | | test.rs:182:60:185:5 | BlockExpr | test.rs:182:5:185:5 | exit test_or_operator (normal) | | | test.rs:183:9:183:28 | LetStmt | test.rs:183:17:183:27 | ... \|\| ... | | -| test.rs:183:13:183:13 | d | test.rs:184:9:184:9 | PathExpr | match, no-match | -| test.rs:183:17:183:17 | PathExpr | test.rs:183:13:183:13 | d | true | -| test.rs:183:17:183:17 | PathExpr | test.rs:183:22:183:22 | PathExpr | false | -| test.rs:183:17:183:22 | ... \|\| ... | test.rs:183:17:183:17 | PathExpr | | +| test.rs:183:13:183:13 | d | test.rs:184:9:184:9 | d | match, no-match | +| test.rs:183:17:183:17 | a | test.rs:183:13:183:13 | d | true | +| test.rs:183:17:183:17 | a | test.rs:183:22:183:22 | b | false | +| test.rs:183:17:183:22 | ... \|\| ... | test.rs:183:17:183:17 | a | | | test.rs:183:17:183:27 | ... \|\| ... | test.rs:183:17:183:22 | ... \|\| ... | | -| test.rs:183:22:183:22 | PathExpr | test.rs:183:13:183:13 | d | true | -| test.rs:183:22:183:22 | PathExpr | test.rs:183:27:183:27 | PathExpr | false | -| test.rs:183:27:183:27 | PathExpr | test.rs:183:13:183:13 | d | | -| test.rs:184:9:184:9 | PathExpr | test.rs:182:60:185:5 | BlockExpr | | +| test.rs:183:22:183:22 | b | test.rs:183:13:183:13 | d | true | +| test.rs:183:22:183:22 | b | test.rs:183:27:183:27 | c | false | +| test.rs:183:27:183:27 | c | test.rs:183:13:183:13 | d | | +| test.rs:184:9:184:9 | d | test.rs:182:60:185:5 | BlockExpr | | | test.rs:187:5:190:5 | enter test_or_operator_2 | test.rs:188:9:188:36 | LetStmt | | | test.rs:187:5:190:5 | exit test_or_operator_2 (normal) | test.rs:187:5:190:5 | exit test_or_operator_2 | | | test.rs:187:61:190:5 | BlockExpr | test.rs:187:5:190:5 | exit test_or_operator_2 (normal) | | | test.rs:188:9:188:36 | LetStmt | test.rs:188:17:188:35 | ... \|\| ... | | -| test.rs:188:13:188:13 | d | test.rs:189:9:189:9 | PathExpr | match, no-match | -| test.rs:188:17:188:17 | PathExpr | test.rs:188:13:188:13 | d | true | -| test.rs:188:17:188:17 | PathExpr | test.rs:188:23:188:23 | PathExpr | false | -| test.rs:188:17:188:30 | ... \|\| ... | test.rs:188:17:188:17 | PathExpr | | +| test.rs:188:13:188:13 | d | test.rs:189:9:189:9 | d | match, no-match | +| test.rs:188:17:188:17 | a | test.rs:188:13:188:13 | d | true | +| test.rs:188:17:188:17 | a | test.rs:188:23:188:23 | b | false | +| test.rs:188:17:188:30 | ... \|\| ... | test.rs:188:17:188:17 | a | | | test.rs:188:17:188:35 | ... \|\| ... | test.rs:188:17:188:30 | ... \|\| ... | | | test.rs:188:22:188:30 | ParenExpr | test.rs:188:13:188:13 | d | true | -| test.rs:188:22:188:30 | ParenExpr | test.rs:188:35:188:35 | PathExpr | false | -| test.rs:188:23:188:23 | PathExpr | test.rs:188:28:188:29 | 28 | | +| test.rs:188:22:188:30 | ParenExpr | test.rs:188:35:188:35 | c | false | +| test.rs:188:23:188:23 | b | test.rs:188:28:188:29 | 28 | | | test.rs:188:23:188:29 | ... == ... | test.rs:188:22:188:30 | ParenExpr | | | test.rs:188:28:188:29 | 28 | test.rs:188:23:188:29 | ... == ... | | -| test.rs:188:35:188:35 | PathExpr | test.rs:188:13:188:13 | d | | -| test.rs:189:9:189:9 | PathExpr | test.rs:187:61:190:5 | BlockExpr | | +| test.rs:188:35:188:35 | c | test.rs:188:13:188:13 | d | | +| test.rs:189:9:189:9 | d | test.rs:187:61:190:5 | BlockExpr | | | test.rs:192:5:195:5 | enter test_not_operator | test.rs:193:9:193:19 | LetStmt | | | test.rs:192:5:195:5 | exit test_not_operator (normal) | test.rs:192:5:195:5 | exit test_not_operator | | | test.rs:192:43:195:5 | BlockExpr | test.rs:192:5:195:5 | exit test_not_operator (normal) | | -| test.rs:193:9:193:19 | LetStmt | test.rs:193:18:193:18 | PathExpr | | -| test.rs:193:13:193:13 | d | test.rs:194:9:194:9 | PathExpr | match, no-match | +| test.rs:193:9:193:19 | LetStmt | test.rs:193:18:193:18 | a | | +| test.rs:193:13:193:13 | d | test.rs:194:9:194:9 | d | match, no-match | | test.rs:193:17:193:18 | ! ... | test.rs:193:13:193:13 | d | | -| test.rs:193:18:193:18 | PathExpr | test.rs:193:17:193:18 | ! ... | | -| test.rs:194:9:194:9 | PathExpr | test.rs:192:43:195:5 | BlockExpr | | +| test.rs:193:18:193:18 | a | test.rs:193:17:193:18 | ! ... | | +| test.rs:194:9:194:9 | d | test.rs:192:43:195:5 | BlockExpr | | | test.rs:197:5:203:5 | enter test_if_and_operator | test.rs:198:12:198:22 | ... && ... | | | test.rs:197:5:203:5 | exit test_if_and_operator (normal) | test.rs:197:5:203:5 | exit test_if_and_operator | | | test.rs:197:63:203:5 | BlockExpr | test.rs:197:5:203:5 | exit test_if_and_operator (normal) | | | test.rs:198:9:202:9 | IfExpr | test.rs:197:63:203:5 | BlockExpr | | -| test.rs:198:12:198:12 | PathExpr | test.rs:198:17:198:17 | PathExpr | true | -| test.rs:198:12:198:12 | PathExpr | test.rs:201:13:201:17 | false | false | -| test.rs:198:12:198:17 | ... && ... | test.rs:198:12:198:12 | PathExpr | | +| test.rs:198:12:198:12 | a | test.rs:198:17:198:17 | b | true | +| test.rs:198:12:198:12 | a | test.rs:201:13:201:17 | false | false | +| test.rs:198:12:198:17 | ... && ... | test.rs:198:12:198:12 | a | | | test.rs:198:12:198:22 | ... && ... | test.rs:198:12:198:17 | ... && ... | | -| test.rs:198:17:198:17 | PathExpr | test.rs:198:22:198:22 | PathExpr | true | -| test.rs:198:17:198:17 | PathExpr | test.rs:201:13:201:17 | false | false | -| test.rs:198:22:198:22 | PathExpr | test.rs:199:13:199:16 | true | true | -| test.rs:198:22:198:22 | PathExpr | test.rs:201:13:201:17 | false | false | +| test.rs:198:17:198:17 | b | test.rs:198:22:198:22 | c | true | +| test.rs:198:17:198:17 | b | test.rs:201:13:201:17 | false | false | +| test.rs:198:22:198:22 | c | test.rs:199:13:199:16 | true | true | +| test.rs:198:22:198:22 | c | test.rs:201:13:201:17 | false | false | | test.rs:198:24:200:9 | BlockExpr | test.rs:198:9:202:9 | IfExpr | | | test.rs:199:13:199:16 | true | test.rs:198:24:200:9 | BlockExpr | | | test.rs:200:16:202:9 | BlockExpr | test.rs:198:9:202:9 | IfExpr | | @@ -354,41 +354,41 @@ | test.rs:205:5:211:5 | exit test_if_or_operator (normal) | test.rs:205:5:211:5 | exit test_if_or_operator | | | test.rs:205:62:211:5 | BlockExpr | test.rs:205:5:211:5 | exit test_if_or_operator (normal) | | | test.rs:206:9:210:9 | IfExpr | test.rs:205:62:211:5 | BlockExpr | | -| test.rs:206:12:206:12 | PathExpr | test.rs:206:17:206:17 | PathExpr | false | -| test.rs:206:12:206:12 | PathExpr | test.rs:207:13:207:16 | true | true | -| test.rs:206:12:206:17 | ... \|\| ... | test.rs:206:12:206:12 | PathExpr | | +| test.rs:206:12:206:12 | a | test.rs:206:17:206:17 | b | false | +| test.rs:206:12:206:12 | a | test.rs:207:13:207:16 | true | true | +| test.rs:206:12:206:17 | ... \|\| ... | test.rs:206:12:206:12 | a | | | test.rs:206:12:206:22 | ... \|\| ... | test.rs:206:12:206:17 | ... \|\| ... | | -| test.rs:206:17:206:17 | PathExpr | test.rs:206:22:206:22 | PathExpr | false | -| test.rs:206:17:206:17 | PathExpr | test.rs:207:13:207:16 | true | true | -| test.rs:206:22:206:22 | PathExpr | test.rs:207:13:207:16 | true | true | -| test.rs:206:22:206:22 | PathExpr | test.rs:209:13:209:17 | false | false | +| test.rs:206:17:206:17 | b | test.rs:206:22:206:22 | c | false | +| test.rs:206:17:206:17 | b | test.rs:207:13:207:16 | true | true | +| test.rs:206:22:206:22 | c | test.rs:207:13:207:16 | true | true | +| test.rs:206:22:206:22 | c | test.rs:209:13:209:17 | false | false | | test.rs:206:24:208:9 | BlockExpr | test.rs:206:9:210:9 | IfExpr | | | test.rs:207:13:207:16 | true | test.rs:206:24:208:9 | BlockExpr | | | test.rs:208:16:210:9 | BlockExpr | test.rs:206:9:210:9 | IfExpr | | | test.rs:209:13:209:17 | false | test.rs:208:16:210:9 | BlockExpr | | -| test.rs:213:5:219:5 | enter test_if_not_operator | test.rs:214:13:214:13 | PathExpr | | +| test.rs:213:5:219:5 | enter test_if_not_operator | test.rs:214:13:214:13 | a | | | test.rs:213:5:219:5 | exit test_if_not_operator (normal) | test.rs:213:5:219:5 | exit test_if_not_operator | | | test.rs:213:46:219:5 | BlockExpr | test.rs:213:5:219:5 | exit test_if_not_operator (normal) | | | test.rs:214:9:218:9 | IfExpr | test.rs:213:46:219:5 | BlockExpr | | | test.rs:214:12:214:13 | ! ... | test.rs:215:13:215:16 | true | true | | test.rs:214:12:214:13 | ! ... | test.rs:217:13:217:17 | false | false | -| test.rs:214:13:214:13 | PathExpr | test.rs:214:12:214:13 | ! ... | false, true | +| test.rs:214:13:214:13 | a | test.rs:214:12:214:13 | ! ... | false, true | | test.rs:214:15:216:9 | BlockExpr | test.rs:214:9:218:9 | IfExpr | | | test.rs:215:13:215:16 | true | test.rs:214:15:216:9 | BlockExpr | | | test.rs:216:16:218:9 | BlockExpr | test.rs:214:9:218:9 | IfExpr | | | test.rs:217:13:217:17 | false | test.rs:216:16:218:9 | BlockExpr | | -| test.rs:222:1:228:1 | enter test_match | test.rs:223:11:223:21 | PathExpr | | +| test.rs:222:1:228:1 | enter test_match | test.rs:223:11:223:21 | maybe_digit | | | test.rs:222:1:228:1 | exit test_match (normal) | test.rs:222:1:228:1 | exit test_match | | | test.rs:222:48:228:1 | BlockExpr | test.rs:222:1:228:1 | exit test_match (normal) | | | test.rs:223:5:227:5 | MatchExpr | test.rs:222:48:228:1 | BlockExpr | | -| test.rs:223:11:223:21 | PathExpr | test.rs:224:9:224:23 | TupleStructPat | | -| test.rs:224:9:224:23 | TupleStructPat | test.rs:224:28:224:28 | PathExpr | match | +| test.rs:223:11:223:21 | maybe_digit | test.rs:224:9:224:23 | TupleStructPat | | +| test.rs:224:9:224:23 | TupleStructPat | test.rs:224:28:224:28 | x | match | | test.rs:224:9:224:23 | TupleStructPat | test.rs:225:9:225:23 | TupleStructPat | no-match | -| test.rs:224:28:224:28 | PathExpr | test.rs:224:32:224:33 | 10 | | +| test.rs:224:28:224:28 | x | test.rs:224:32:224:33 | 10 | | | test.rs:224:32:224:33 | 10 | test.rs:224:28:224:33 | ... < ... | | -| test.rs:225:9:225:23 | TupleStructPat | test.rs:225:28:225:28 | PathExpr | match | +| test.rs:225:9:225:23 | TupleStructPat | test.rs:225:28:225:28 | x | match | | test.rs:225:9:225:23 | TupleStructPat | test.rs:226:9:226:20 | PathPat | no-match | -| test.rs:225:28:225:28 | PathExpr | test.rs:223:5:227:5 | MatchExpr | | +| test.rs:225:28:225:28 | x | test.rs:223:5:227:5 | MatchExpr | | | test.rs:226:9:226:20 | PathPat | test.rs:226:25:226:25 | 5 | match | | test.rs:226:25:226:25 | 5 | test.rs:223:5:227:5 | MatchExpr | | | test.rs:231:5:236:5 | enter test_infinite_loop | test.rs:232:9:234:9 | ExprStmt | | @@ -398,12 +398,12 @@ | test.rs:238:5:241:5 | enter test_let_match | test.rs:239:9:239:49 | LetStmt | | | test.rs:238:5:241:5 | exit test_let_match (normal) | test.rs:238:5:241:5 | exit test_let_match | | | test.rs:238:39:241:5 | BlockExpr | test.rs:238:5:241:5 | exit test_let_match (normal) | | -| test.rs:239:9:239:49 | LetStmt | test.rs:239:23:239:23 | PathExpr | | +| test.rs:239:9:239:49 | LetStmt | test.rs:239:23:239:23 | a | | | test.rs:239:13:239:19 | TupleStructPat | test.rs:239:32:239:46 | "Expected some" | no-match | -| test.rs:239:13:239:19 | TupleStructPat | test.rs:240:9:240:9 | PathExpr | match | -| test.rs:239:23:239:23 | PathExpr | test.rs:239:13:239:19 | TupleStructPat | | +| test.rs:239:13:239:19 | TupleStructPat | test.rs:240:9:240:9 | n | match | +| test.rs:239:23:239:23 | a | test.rs:239:13:239:19 | TupleStructPat | | | test.rs:239:32:239:46 | "Expected some" | test.rs:239:30:239:48 | BlockExpr | | -| test.rs:240:9:240:9 | PathExpr | test.rs:238:39:241:5 | BlockExpr | | +| test.rs:240:9:240:9 | n | test.rs:238:39:241:5 | BlockExpr | | | test.rs:244:1:249:1 | enter dead_code | test.rs:245:5:247:5 | ExprStmt | | | test.rs:244:1:249:1 | exit dead_code (normal) | test.rs:244:1:249:1 | exit dead_code | | | test.rs:245:5:247:5 | ExprStmt | test.rs:245:9:245:12 | true | | diff --git a/rust/ql/test/library-tests/variables/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/library-tests/variables/CONSISTENCY/CfgConsistency.expected new file mode 100644 index 000000000000..56ae06526e76 --- /dev/null +++ b/rust/ql/test/library-tests/variables/CONSISTENCY/CfgConsistency.expected @@ -0,0 +1,5 @@ +deadEnd +| variables.rs:2:5:2:22 | ExprStmt | +| variables.rs:6:5:6:22 | ExprStmt | +| variables.rs:200:16:200:21 | ... > ... | +| variables.rs:295:5:295:42 | LetStmt | diff --git a/rust/ql/test/library-tests/variables/variables.expected b/rust/ql/test/library-tests/variables/variables.expected new file mode 100644 index 000000000000..18ee16a3da9c --- /dev/null +++ b/rust/ql/test/library-tests/variables/variables.expected @@ -0,0 +1,144 @@ +testFailures +failures +variable +| variables.rs:1:14:1:14 | s | +| variables.rs:5:14:5:14 | i | +| variables.rs:10:9:10:10 | x1 | +| variables.rs:15:13:15:14 | x2 | +| variables.rs:22:9:22:10 | x3 | +| variables.rs:24:9:24:10 | x3 | +| variables.rs:30:9:30:10 | x4 | +| variables.rs:33:13:33:14 | x4 | +| variables.rs:47:13:47:14 | a1 | +| variables.rs:48:13:48:14 | b1 | +| variables.rs:51:13:51:13 | x | +| variables.rs:52:13:52:13 | y | +| variables.rs:62:9:62:10 | p1 | +| variables.rs:64:12:64:13 | a2 | +| variables.rs:65:12:65:13 | b2 | +| variables.rs:72:9:72:10 | s1 | +| variables.rs:74:21:74:22 | s2 | +| variables.rs:81:14:81:15 | x5 | +| variables.rs:89:9:89:10 | x6 | +| variables.rs:90:9:90:10 | y1 | +| variables.rs:94:14:94:15 | y1 | +| variables.rs:99:9:99:12 | None | +| variables.rs:106:9:106:15 | numbers | +| variables.rs:110:13:110:17 | first | +| variables.rs:111:13:111:17 | third | +| variables.rs:112:13:112:17 | fifth | +| variables.rs:122:13:122:17 | first | +| variables.rs:124:13:124:16 | last | +| variables.rs:133:9:133:10 | p2 | +| variables.rs:137:16:137:17 | x7 | +| variables.rs:147:9:147:11 | msg | +| variables.rs:151:17:151:27 | id_variable | +| variables.rs:156:26:156:27 | id | +| variables.rs:167:9:167:14 | either | +| variables.rs:169:9:169:44 | a3 | +| variables.rs:181:9:181:10 | tv | +| variables.rs:183:9:183:81 | a4 | +| variables.rs:187:9:187:83 | a5 | +| variables.rs:191:9:191:83 | a6 | +| variables.rs:197:9:197:14 | either | +| variables.rs:199:9:199:44 | a7 | +| variables.rs:207:9:207:14 | either | +| variables.rs:210:13:210:13 | e | +| variables.rs:211:14:211:51 | a11 | +| variables.rs:214:33:214:35 | a12 | +| variables.rs:224:5:224:6 | a8 | +| variables.rs:226:9:226:10 | b3 | +| variables.rs:227:9:227:10 | c1 | +| variables.rs:235:6:235:41 | a9 | +| variables.rs:242:13:242:15 | a10 | +| variables.rs:243:13:243:14 | b4 | +| variables.rs:244:13:244:14 | c2 | +| variables.rs:265:13:265:15 | a10 | +| variables.rs:266:13:266:14 | b4 | +| variables.rs:278:9:278:23 | example_closure | +| variables.rs:279:10:279:10 | x | +| variables.rs:281:9:281:10 | n1 | +| variables.rs:286:9:286:26 | immutable_variable | +| variables.rs:287:10:287:10 | x | +| variables.rs:289:9:289:10 | n2 | +| variables.rs:295:9:295:9 | v | +| variables.rs:297:9:297:12 | text | +variableAccess +| variables.rs:11:15:11:16 | x1 | variables.rs:10:9:10:10 | x1 | +| variables.rs:16:15:16:16 | x2 | variables.rs:15:13:15:14 | x2 | +| variables.rs:17:5:17:6 | x2 | variables.rs:15:13:15:14 | x2 | +| variables.rs:18:15:18:16 | x2 | variables.rs:15:13:15:14 | x2 | +| variables.rs:23:15:23:16 | x3 | variables.rs:22:9:22:10 | x3 | +| variables.rs:25:9:25:10 | x3 | variables.rs:22:9:22:10 | x3 | +| variables.rs:26:15:26:16 | x3 | variables.rs:24:9:24:10 | x3 | +| variables.rs:31:15:31:16 | x4 | variables.rs:30:9:30:10 | x4 | +| variables.rs:34:19:34:20 | x4 | variables.rs:33:13:33:14 | x4 | +| variables.rs:36:15:36:16 | x4 | variables.rs:30:9:30:10 | x4 | +| variables.rs:55:15:55:16 | a1 | variables.rs:47:13:47:14 | a1 | +| variables.rs:56:15:56:16 | b1 | variables.rs:48:13:48:14 | b1 | +| variables.rs:57:15:57:15 | x | variables.rs:51:13:51:13 | x | +| variables.rs:58:15:58:15 | y | variables.rs:52:13:52:13 | y | +| variables.rs:66:9:66:10 | p1 | variables.rs:62:9:62:10 | p1 | +| variables.rs:67:15:67:16 | a2 | variables.rs:64:12:64:13 | a2 | +| variables.rs:68:15:68:16 | b2 | variables.rs:65:12:65:13 | b2 | +| variables.rs:75:11:75:12 | s1 | variables.rs:72:9:72:10 | s1 | +| variables.rs:76:19:76:20 | s2 | variables.rs:74:21:74:22 | s2 | +| variables.rs:85:15:85:16 | x5 | variables.rs:81:14:81:15 | x5 | +| variables.rs:92:11:92:12 | x6 | variables.rs:89:9:89:10 | x6 | +| variables.rs:97:23:97:24 | y1 | variables.rs:94:14:94:15 | y1 | +| variables.rs:102:15:102:16 | y1 | variables.rs:90:9:90:10 | y1 | +| variables.rs:108:11:108:17 | numbers | variables.rs:106:9:106:15 | numbers | +| variables.rs:114:23:114:27 | first | variables.rs:110:13:110:17 | first | +| variables.rs:115:23:115:27 | third | variables.rs:111:13:111:17 | third | +| variables.rs:116:23:116:27 | fifth | variables.rs:112:13:112:17 | fifth | +| variables.rs:120:11:120:17 | numbers | variables.rs:106:9:106:15 | numbers | +| variables.rs:126:23:126:27 | first | variables.rs:122:13:122:17 | first | +| variables.rs:127:23:127:26 | last | variables.rs:124:13:124:16 | last | +| variables.rs:135:11:135:12 | p2 | variables.rs:133:9:133:10 | p2 | +| variables.rs:138:24:138:25 | x7 | variables.rs:137:16:137:17 | x7 | +| variables.rs:149:11:149:13 | msg | variables.rs:147:9:147:11 | msg | +| variables.rs:152:24:152:34 | id_variable | variables.rs:151:17:151:27 | id_variable | +| variables.rs:157:23:157:24 | id | variables.rs:156:26:156:27 | id | +| variables.rs:168:11:168:16 | either | variables.rs:167:9:167:14 | either | +| variables.rs:170:26:170:27 | a3 | variables.rs:169:9:169:44 | a3 | +| variables.rs:182:11:182:12 | tv | variables.rs:181:9:181:10 | tv | +| variables.rs:184:26:184:27 | a4 | variables.rs:183:9:183:81 | a4 | +| variables.rs:186:11:186:12 | tv | variables.rs:181:9:181:10 | tv | +| variables.rs:188:26:188:27 | a5 | variables.rs:187:9:187:83 | a5 | +| variables.rs:190:11:190:12 | tv | variables.rs:181:9:181:10 | tv | +| variables.rs:192:26:192:27 | a6 | variables.rs:191:9:191:83 | a6 | +| variables.rs:198:11:198:16 | either | variables.rs:197:9:197:14 | either | +| variables.rs:200:16:200:17 | a7 | variables.rs:199:9:199:44 | a7 | +| variables.rs:201:26:201:27 | a7 | variables.rs:199:9:199:44 | a7 | +| variables.rs:209:11:209:16 | either | variables.rs:207:9:207:14 | either | +| variables.rs:213:23:213:25 | a11 | variables.rs:211:14:211:51 | a11 | +| variables.rs:215:15:215:15 | e | variables.rs:210:13:210:13 | e | +| variables.rs:216:28:216:30 | a12 | variables.rs:214:33:214:35 | a12 | +| variables.rs:229:15:229:16 | a8 | variables.rs:224:5:224:6 | a8 | +| variables.rs:230:15:230:16 | b3 | variables.rs:226:9:226:10 | b3 | +| variables.rs:231:15:231:16 | c1 | variables.rs:227:9:227:10 | c1 | +| variables.rs:237:15:237:16 | a9 | variables.rs:235:6:235:41 | a9 | +| variables.rs:246:15:246:17 | a10 | variables.rs:242:13:242:15 | a10 | +| variables.rs:247:15:247:16 | b4 | variables.rs:243:13:243:14 | b4 | +| variables.rs:248:15:248:16 | c2 | variables.rs:244:13:244:14 | c2 | +| variables.rs:251:9:251:10 | c2 | variables.rs:244:13:244:14 | c2 | +| variables.rs:252:9:252:10 | b4 | variables.rs:243:13:243:14 | b4 | +| variables.rs:253:9:253:11 | a10 | variables.rs:242:13:242:15 | a10 | +| variables.rs:255:9:255:11 | a10 | variables.rs:242:13:242:15 | a10 | +| variables.rs:256:9:256:10 | b4 | variables.rs:243:13:243:14 | b4 | +| variables.rs:257:9:257:10 | c2 | variables.rs:244:13:244:14 | c2 | +| variables.rs:259:15:259:17 | a10 | variables.rs:242:13:242:15 | a10 | +| variables.rs:260:15:260:16 | b4 | variables.rs:243:13:243:14 | b4 | +| variables.rs:261:15:261:16 | c2 | variables.rs:244:13:244:14 | c2 | +| variables.rs:268:23:268:25 | a10 | variables.rs:265:13:265:15 | a10 | +| variables.rs:269:23:269:24 | b4 | variables.rs:266:13:266:14 | b4 | +| variables.rs:273:15:273:17 | a10 | variables.rs:242:13:242:15 | a10 | +| variables.rs:274:15:274:16 | b4 | variables.rs:243:13:243:14 | b4 | +| variables.rs:280:9:280:9 | x | variables.rs:279:10:279:10 | x | +| variables.rs:282:9:282:23 | example_closure | variables.rs:278:9:278:23 | example_closure | +| variables.rs:283:15:283:16 | n1 | variables.rs:281:9:281:10 | n1 | +| variables.rs:288:9:288:9 | x | variables.rs:287:10:287:10 | x | +| variables.rs:290:9:290:26 | immutable_variable | variables.rs:286:9:286:26 | immutable_variable | +| variables.rs:291:15:291:16 | n2 | variables.rs:289:9:289:10 | n2 | +| variables.rs:298:12:298:12 | v | variables.rs:295:9:295:9 | v | +| variables.rs:299:19:299:22 | text | variables.rs:297:9:297:12 | text | diff --git a/rust/ql/test/library-tests/variables/variables.ql b/rust/ql/test/library-tests/variables/variables.ql new file mode 100644 index 000000000000..b96f6ceabcae --- /dev/null +++ b/rust/ql/test/library-tests/variables/variables.ql @@ -0,0 +1,41 @@ +import rust +import utils.InlineExpectationsTest + +query predicate variable(Variable v) { any() } + +query predicate variableAccess(VariableAccess va, Variable v) { v = va.getVariable() } + +module VariableAccessTest implements TestSig { + string getARelevantTag() { result = "access" } + + private predicate declAt(Variable v, string filepath, int line) { + v.getLocation().hasLocationInfo(filepath, _, _, line, _) + } + + private predicate commmentAt(string text, string filepath, int line) { + exists(Comment c | + c.getLocation().hasLocationInfo(filepath, line, _, _, _) and + c.getCommentText() = text + ) + } + + private predicate decl(Variable v, string value) { + exists(string filepath, int line | declAt(v, filepath, line) | + commmentAt(value, filepath, line) + or + not commmentAt(_, filepath, line) and + value = v.getName() + ) + } + + predicate hasActualResult(Location location, string element, string tag, string value) { + exists(VariableAccess va | + location = va.getLocation() and + element = va.toString() and + tag = "access" and + decl(va.getVariable(), value) + ) + } +} + +import MakeTest diff --git a/rust/ql/test/library-tests/variables/variables.rs b/rust/ql/test/library-tests/variables/variables.rs new file mode 100644 index 000000000000..f9d3e89938c3 --- /dev/null +++ b/rust/ql/test/library-tests/variables/variables.rs @@ -0,0 +1,325 @@ +fn print_str(s: &str) { + println!("{}", s); +} + +fn print_i64(i: i64) { + println!("{}", i); +} + +fn immutable_variable() { + let x1 = "a"; // x1 + print_str(x1); // $ access=x1 +} + +fn mutable_variable() { + let mut x2 = 4; // x2 + print_i64(x2); // $ access=x2 + x2 = 5; // $ access=x2 + print_i64(x2); // $ access=x2 +} + +fn variable_shadow1() { + let x3 = 1; // x3_1 + print_i64(x3); // $ access=x3_1 + let x3 = // x3_2 + x3 + 1; // $ access=x3_1 + print_i64(x3); // $ access=x3_2 +} + +fn variable_shadow2() { + let x4 = "a"; // x4_1 + print_str(x4); // $ access=x4_1 + { + let x4 = "b"; // x4_2 + print_str(x4); // $ access=x4_2 + } + print_str(x4); // $ access=x4_1 +} + +struct Point<'a> { + x: &'a str, + y: &'a str, +} + +fn let_pattern1() { + let ( + ( + a1, // a1 + b1, // b1 + ), + Point { + x, // x + y, // y + }, + ) = (("a", "b"), Point { x: "x", y: "y" }); + print_str(a1); // $ access=a1 + print_str(b1); // $ access=b1 + print_str(x); // $ access=x + print_str(y); // $ access=y +} + +fn let_pattern2() { + let p1 = Point { x: "a", y: "b" }; // p1 + let Point { + x: a2, // a2 + y: b2, // b2 + } = p1; // $ access=p1 + print_str(a2); // $ access=a2 + print_str(b2); // $ access=b2 +} + +fn let_pattern3() { + let s1 = Some(String::from("Hello!")); // s1 + + if let Some(ref s2) // s2 + = s1 { // $ access=s1 + print_str(s2); // $ access=s2 + } +} + +fn let_pattern4() { + let Some(x5): Option<&str> = Some("x5") else { + // x5 + todo!() + }; + print_str(x5); // $ access=x5 +} + +fn match_pattern1() { + let x6 = Some(5); // x6 + let y1 = 10; // y1_1 + + match x6 { // $ access=x6 + Some(50) => print_str("Got 50"), + Some(y1) // y1_2 + => + { + print_i64(y1)// $ access=y1_2 + } + None => print_str("NONE"), + } + + print_i64(y1); // $ access=y1_1 +} + +fn match_pattern2() { + let numbers = (2, 4, 8, 16, 32); // numbers + + match numbers { // $ access=numbers + ( + first, _, // first + third, _, // third + fifth // fifth + ) => { + print_i64(first); // $ access=first + print_i64(third); // $ access=third + print_i64(fifth); // $ access=fifth + } + } + + match numbers { // $ access=numbers + ( + first, // first + .., + last // last + ) => { + print_i64(first); // $ access=first + print_i64(last); // $ access=last + } + } +} + +fn match_pattern3() { + let p2 = Point { x: "x", y: "y" }; // p2 + + match p2 { // $ access=p2 + Point { + x: x7, .. // x7 + } => print_str(x7), // $ access=x7 + } +} + +enum Message { + Hello { id: i64 }, +} + +fn match_pattern4() { + let msg = Message::Hello { id: 0 }; // msg + + match msg { // $ access=msg + Message::Hello { + id: id_variable @ 3..=7, // id_variable + } => print_i64(id_variable), // $ access=id_variable + Message::Hello { id: 10..=12 } => { + println!("Found an id in another range") + } + Message::Hello { id } => // id + print_i64(id), // $ access=id + } +} + +enum Either { + Left(i64), + Right(i64), +} + +fn match_pattern5() { + let either = Either::Left(32); // either + match either { // $ access=either + Either::Left(a3) | Either::Right(a3) // a3 + => print_i64(a3), // $ access=a3 + } +} + +enum ThreeValued { + First(i64), + Second(i64), + Third(i64), +} + +fn match_pattern6() { + let tv = ThreeValued::Second(62); // tv + match tv { // $ access=tv + ThreeValued::First(a4) | ThreeValued::Second(a4) | ThreeValued::Third(a4) // a4 + => print_i64(a4), // $ access=a4 + } + match tv { // $ access=tv + (ThreeValued::First(a5) | ThreeValued::Second(a5)) | ThreeValued::Third(a5) // a5 + => print_i64(a5), // $ access=a5 + } + match tv { // $ access=tv + ThreeValued::First(a6) | (ThreeValued::Second(a6) | ThreeValued::Third(a6)) // a6 + => print_i64(a6), // $ access=a6 + } +} + +fn match_pattern7() { + let either = Either::Left(32); // either + match either { // $ access=either + Either::Left(a7) | Either::Right(a7) // a7 + if a7 > 0 // $ access=a7 + => print_i64(a7), // $ access=a7 + _ => (), + } +} + +fn match_pattern8() { + let either = Either::Left(32); // either + + match either { // $ access=either + ref e @ // e + (Either::Left(a11) | Either::Right(a11)) // a11 + => { + print_i64(a11); // $ access=a11 + if let Either::Left(a12) // a12 + = e { // $ access=e + print_i64(*a12); // $ access=a12 + } + } + _ => (), + } +} + +fn param_pattern1( + a8: &str, // a8 + ( + b3, // b3 + c1, // c1 + ): (&str, &str)) -> () { + print_str(a8); // $ access=a8 + print_str(b3); // $ access=b3 + print_str(c1); // $ access=c1 +} + +fn param_pattern2( + (Either::Left(a9) | Either::Right(a9)): Either // a9 +) -> () { + print_i64(a9); // $ access=a9 +} + +fn destruct_assignment() { + let ( + mut a10, // a10 + mut b4, // b4 + mut c2 // c2 + ) = (1, 2, 3); + print_i64(a10); // $ access=a10 + print_i64(b4); // $ access=b4 + print_i64(c2); // $ access=c2 + + ( + c2, // $ access=c2 + b4, // $ access=b4 + a10 // $ access=a10 + ) = ( + a10, // $ access=a10 + b4, // $ access=b4 + c2 // $ access=c2 + ); + print_i64(a10); // $ access=a10 + print_i64(b4); // $ access=b4 + print_i64(c2); // $ access=c2 + + match (4, 5) { + ( + a10, // a10_2 + b4 // b4 + ) => { + print_i64(a10); // $ access=a10_2 + print_i64(b4); // $ access=b4 + } + } + + print_i64(a10); // $ access=a10 + print_i64(b4); // $ access=b4 +} + +fn closure_variable() { + let example_closure = // example_closure + |x: i64| // x_1 + x; // $ access=x_1 + let n1 = // n1 + example_closure(5); // $ access=example_closure + print_i64(n1); // $ access=n1 + + immutable_variable(); + let immutable_variable = + |x: i64| // x_2 + x; // $ access=x_2 + let n2 = // n2 + immutable_variable(6); // $ access=immutable_variable + print_i64(n2); // $ access=n2 +} + +fn for_variable() { + let v = &["apples", "cake", "coffee"]; // v + + for text // text + in v { // $ access=v + print_str(text); // $ access=text + } +} + +fn main() { + immutable_variable(); + mutable_variable(); + variable_shadow1(); + variable_shadow2(); + let_pattern1(); + let_pattern2(); + let_pattern3(); + let_pattern4(); + match_pattern1(); + match_pattern2(); + match_pattern3(); + match_pattern4(); + match_pattern5(); + match_pattern6(); + match_pattern7(); + match_pattern8(); + param_pattern1("a", ("b", "c")); + param_pattern2(Either::Left(45)); + destruct_assignment(); + closure_variable(); + for_variable(); +} From 60abea17e62bef99989fede63c15804217e3a9f3 Mon Sep 17 00:00:00 2001 From: Calum Grant Date: Mon, 16 Sep 2024 15:10:17 +0100 Subject: [PATCH 10/79] C++: Test for cpp/uninitialized-local --- .../semmle/tests/UninitializedLocal.expected | 4 ++++ .../Security/CWE/CWE-457/semmle/tests/errors.cpp | 15 +++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/errors.cpp diff --git a/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/UninitializedLocal.expected b/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/UninitializedLocal.expected index a8b3c7782e7c..385105e6e19b 100644 --- a/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/UninitializedLocal.expected +++ b/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/UninitializedLocal.expected @@ -1,5 +1,7 @@ edges nodes +| errors.cpp:4:7:4:7 | definition of x | semmle.label | definition of x | +| errors.cpp:13:7:13:7 | definition of x | semmle.label | definition of x | | test.cpp:11:6:11:8 | definition of foo | semmle.label | definition of foo | | test.cpp:111:6:111:8 | definition of foo | semmle.label | definition of foo | | test.cpp:226:7:226:7 | definition of x | semmle.label | definition of x | @@ -14,6 +16,8 @@ nodes | test.cpp:472:6:472:6 | definition of x | semmle.label | definition of x | | test.cpp:479:6:479:6 | definition of x | semmle.label | definition of x | #select +| errors.cpp:6:10:6:10 | x | errors.cpp:4:7:4:7 | definition of x | errors.cpp:4:7:4:7 | definition of x | The variable $@ may not be initialized at this access. | errors.cpp:4:7:4:7 | x | x | +| errors.cpp:14:18:14:18 | x | errors.cpp:13:7:13:7 | definition of x | errors.cpp:13:7:13:7 | definition of x | The variable $@ may not be initialized at this access. | errors.cpp:13:7:13:7 | x | x | | test.cpp:12:6:12:8 | foo | test.cpp:11:6:11:8 | definition of foo | test.cpp:11:6:11:8 | definition of foo | The variable $@ may not be initialized at this access. | test.cpp:11:6:11:8 | foo | foo | | test.cpp:113:6:113:8 | foo | test.cpp:111:6:111:8 | definition of foo | test.cpp:111:6:111:8 | definition of foo | The variable $@ may not be initialized at this access. | test.cpp:111:6:111:8 | foo | foo | | test.cpp:227:3:227:3 | x | test.cpp:226:7:226:7 | definition of x | test.cpp:226:7:226:7 | definition of x | The variable $@ may not be initialized at this access. | test.cpp:226:7:226:7 | x | x | diff --git a/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/errors.cpp b/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/errors.cpp new file mode 100644 index 000000000000..07bb61f943ed --- /dev/null +++ b/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/errors.cpp @@ -0,0 +1,15 @@ +// semmle-extractor-options: --expect_errors + +int f1() { + int x; + initialize(&x); // error expression - initialize() is not defined + return x; // GOOD - assume x is initialized +} + +void * operator new(unsigned long, bool); +void operator delete(void*, bool); + +int f2() { + int x; + new(true) int (x); // BAD, ignore implicit error expression +} From 62509a10c293d1fb9cbdf21837e6fe4e1e46b11c Mon Sep 17 00:00:00 2001 From: yoff Date: Tue, 1 Oct 2024 11:39:12 +0200 Subject: [PATCH 11/79] Update python/ql/test/library-tests/dataflow/coverage/test_builtins.py Co-authored-by: Rasmus Wriedt Larsen --- python/ql/test/library-tests/dataflow/coverage/test_builtins.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/ql/test/library-tests/dataflow/coverage/test_builtins.py b/python/ql/test/library-tests/dataflow/coverage/test_builtins.py index 2de6adeb20bf..29afa9bfdb25 100644 --- a/python/ql/test/library-tests/dataflow/coverage/test_builtins.py +++ b/python/ql/test/library-tests/dataflow/coverage/test_builtins.py @@ -142,6 +142,7 @@ def test_dict_from_dict(): SINK(d2["k"]) #$ flow="SOURCE, l:-2 -> d2['k']" SINK_F(d2["k1"]) +@expects(4) def test_dict_from_multiple_args(): d = dict([("k", SOURCE), ("k1", NONSOURCE)], k2 = SOURCE, k3 = NONSOURCE) SINK(d["k"]) #$ MISSING: flow="SOURCE, l:-1 -> d['k']" From 4b5aa1497ba86cdfb652d7b6a0c1eb40a9ed322d Mon Sep 17 00:00:00 2001 From: Calum Grant Date: Tue, 1 Oct 2024 11:00:44 +0100 Subject: [PATCH 12/79] C++: Implement Function::hasErrors() --- cpp/ql/lib/semmle/code/cpp/Function.qll | 8 ++++++++ cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll | 7 +++++++ .../Likely Bugs/Memory Management/UninitializedLocal.ql | 3 ++- .../CWE/CWE-457/semmle/tests/UninitializedLocal.expected | 1 - 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/cpp/ql/lib/semmle/code/cpp/Function.qll b/cpp/ql/lib/semmle/code/cpp/Function.qll index 0648c6260ce5..1234791576b1 100644 --- a/cpp/ql/lib/semmle/code/cpp/Function.qll +++ b/cpp/ql/lib/semmle/code/cpp/Function.qll @@ -500,6 +500,14 @@ class Function extends Declaration, ControlFlowNode, AccessHolder, @function { * Gets the nearest enclosing AccessHolder. */ override AccessHolder getEnclosingAccessHolder() { result = this.getDeclaringType() } + + /** + * Holds if this function has extraction errors that create an `ErrorExpr`. + */ + predicate hasErrors() { + // Exclude allocator call arguments because they are are always extracted as `ErrorExpr`. + exists(ErrorExpr e | e.getEnclosingFunction() = this and not e.isFirstAllocatorCallArgument()) + } } pragma[noinline] diff --git a/cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll b/cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll index 91b57049a54e..7faef545c0e4 100644 --- a/cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll +++ b/cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll @@ -744,6 +744,13 @@ class ErrorExpr extends Expr, @errorexpr { override string toString() { result = "" } override string getAPrimaryQlClass() { result = "ErrorExpr" } + + /** + * Holds if this error expression is the first argument to a `new` allocation call. + */ + predicate isFirstAllocatorCallArgument() { + this = any(NewOrNewArrayExpr new).getAllocatorCall().getArgument(0) + } } /** diff --git a/cpp/ql/src/Likely Bugs/Memory Management/UninitializedLocal.ql b/cpp/ql/src/Likely Bugs/Memory Management/UninitializedLocal.ql index 35bee25c9f5f..226cbfd322b9 100644 --- a/cpp/ql/src/Likely Bugs/Memory Management/UninitializedLocal.ql +++ b/cpp/ql/src/Likely Bugs/Memory Management/UninitializedLocal.ql @@ -89,5 +89,6 @@ from where conf.hasFlowPath(source, sink) and isSinkImpl(sink.getInstruction(), va) and - v = va.getTarget() + v = va.getTarget() and + not v.getFunction().hasErrors() select va, source, sink, "The variable $@ may not be initialized at this access.", v, v.getName() diff --git a/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/UninitializedLocal.expected b/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/UninitializedLocal.expected index 385105e6e19b..30896607a18d 100644 --- a/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/UninitializedLocal.expected +++ b/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/UninitializedLocal.expected @@ -16,7 +16,6 @@ nodes | test.cpp:472:6:472:6 | definition of x | semmle.label | definition of x | | test.cpp:479:6:479:6 | definition of x | semmle.label | definition of x | #select -| errors.cpp:6:10:6:10 | x | errors.cpp:4:7:4:7 | definition of x | errors.cpp:4:7:4:7 | definition of x | The variable $@ may not be initialized at this access. | errors.cpp:4:7:4:7 | x | x | | errors.cpp:14:18:14:18 | x | errors.cpp:13:7:13:7 | definition of x | errors.cpp:13:7:13:7 | definition of x | The variable $@ may not be initialized at this access. | errors.cpp:13:7:13:7 | x | x | | test.cpp:12:6:12:8 | foo | test.cpp:11:6:11:8 | definition of foo | test.cpp:11:6:11:8 | definition of foo | The variable $@ may not be initialized at this access. | test.cpp:11:6:11:8 | foo | foo | | test.cpp:113:6:113:8 | foo | test.cpp:111:6:111:8 | definition of foo | test.cpp:111:6:111:8 | definition of foo | The variable $@ may not be initialized at this access. | test.cpp:111:6:111:8 | foo | foo | From 59a77d70c0d90eb9e78f068bea92e594b41501d7 Mon Sep 17 00:00:00 2001 From: Calum Grant Date: Tue, 1 Oct 2024 11:01:23 +0100 Subject: [PATCH 13/79] C++: Use Function::hasErrors in queries --- cpp/ql/src/Best Practices/Unused Entities/UnusedLocals.ql | 2 +- .../Likely Bugs/Memory Management/ReturnStackAllocatedMemory.ql | 2 +- .../Likely Bugs/Memory Management/UsingExpiredStackAddress.ql | 2 +- cpp/ql/src/jsf/4.13 Functions/AV Rule 114.ql | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cpp/ql/src/Best Practices/Unused Entities/UnusedLocals.ql b/cpp/ql/src/Best Practices/Unused Entities/UnusedLocals.ql index 1d02474bfbb7..f824ecf53e76 100644 --- a/cpp/ql/src/Best Practices/Unused Entities/UnusedLocals.ql +++ b/cpp/ql/src/Best Practices/Unused Entities/UnusedLocals.ql @@ -57,5 +57,5 @@ where not declarationHasSideEffects(v) and not exists(AsmStmt s | f = s.getEnclosingFunction()) and not v.getAnAttribute().getName() = "unused" and - not any(ErrorExpr e).getEnclosingFunction() = f // unextracted expr may use `v` + not f.hasErrors() select v, "Variable " + v.getName() + " is not used." diff --git a/cpp/ql/src/Likely Bugs/Memory Management/ReturnStackAllocatedMemory.ql b/cpp/ql/src/Likely Bugs/Memory Management/ReturnStackAllocatedMemory.ql index 16679d67fd2e..02678beaf124 100644 --- a/cpp/ql/src/Likely Bugs/Memory Management/ReturnStackAllocatedMemory.ql +++ b/cpp/ql/src/Likely Bugs/Memory Management/ReturnStackAllocatedMemory.ql @@ -29,7 +29,7 @@ class ReturnStackAllocatedMemoryConfig extends MustFlowConfiguration { override predicate isSource(Instruction source) { exists(Function func | // Rule out FPs caused by extraction errors. - not any(ErrorExpr e).getEnclosingFunction() = func and + not func.hasErrors() and not intentionallyReturnsStackPointer(func) and func = source.getEnclosingFunction() | diff --git a/cpp/ql/src/Likely Bugs/Memory Management/UsingExpiredStackAddress.ql b/cpp/ql/src/Likely Bugs/Memory Management/UsingExpiredStackAddress.ql index 678cb95a7214..0df59b5f01db 100644 --- a/cpp/ql/src/Likely Bugs/Memory Management/UsingExpiredStackAddress.ql +++ b/cpp/ql/src/Likely Bugs/Memory Management/UsingExpiredStackAddress.ql @@ -24,7 +24,7 @@ predicate instructionHasVariable(VariableAddressInstruction vai, StackVariable v // Pointer-to-member types aren't properly handled in the dbscheme. not vai.getResultType() instanceof PointerToMemberType and // Rule out FPs caused by extraction errors. - not any(ErrorExpr e).getEnclosingFunction() = f + not f.hasErrors() } /** diff --git a/cpp/ql/src/jsf/4.13 Functions/AV Rule 114.ql b/cpp/ql/src/jsf/4.13 Functions/AV Rule 114.ql index ac5db25ea6b5..9027c064ac67 100644 --- a/cpp/ql/src/jsf/4.13 Functions/AV Rule 114.ql +++ b/cpp/ql/src/jsf/4.13 Functions/AV Rule 114.ql @@ -49,7 +49,7 @@ predicate functionsMissingReturnStmt(Function f, ControlFlowNode blame) { predicate functionImperfectlyExtracted(Function f) { exists(CompilerError e | f.getBlock().getLocation().subsumes(e.getLocation())) or - exists(ErrorExpr ee | ee.getEnclosingFunction() = f) + f.hasErrors() or count(f.getType()) > 1 or From 4712ae1cfc5073be85a102753a540e573da54803 Mon Sep 17 00:00:00 2001 From: Calum Grant Date: Tue, 1 Oct 2024 11:01:51 +0100 Subject: [PATCH 14/79] C++: Use refactored isFirstAllocatorCallArgument() --- .../cpp/ir/implementation/raw/internal/TranslatedElement.qll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedElement.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedElement.qll index 0f9bc370f7a5..1047dc2b8a7b 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedElement.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedElement.qll @@ -151,7 +151,7 @@ private predicate ignoreExprOnly(Expr expr) { // The extractor deliberately emits an `ErrorExpr` as the first argument to // the allocator call, if any, of a `NewOrNewArrayExpr`. That `ErrorExpr` // should not be translated. - exists(NewOrNewArrayExpr new | expr = new.getAllocatorCall().getArgument(0)) + expr.(ErrorExpr).isFirstAllocatorCallArgument() or not translateFunction(getEnclosingFunction(expr)) and not Raw::varHasIRFunc(getEnclosingVariable(expr)) From fe00c8819d373a5ab46ac6c7e6cc735f8665304d Mon Sep 17 00:00:00 2001 From: Calum Grant Date: Tue, 1 Oct 2024 11:26:47 +0100 Subject: [PATCH 15/79] C++: Fix formatting --- cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll b/cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll index 7faef545c0e4..4eaf83e2c03f 100644 --- a/cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll +++ b/cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll @@ -748,7 +748,7 @@ class ErrorExpr extends Expr, @errorexpr { /** * Holds if this error expression is the first argument to a `new` allocation call. */ - predicate isFirstAllocatorCallArgument() { + predicate isFirstAllocatorCallArgument() { this = any(NewOrNewArrayExpr new).getAllocatorCall().getArgument(0) } } From a172063e6a88c7841c4df65eed23e69494b04e53 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Tue, 1 Oct 2024 13:37:56 +0200 Subject: [PATCH 16/79] Rust: Document `VariableOrAccessCand` --- .../rust/elements/internal/VariableImpl.qll | 47 +++++++++++++++++++ .../internal/InlineExpectationsTestImpl.qll | 3 -- 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll index 9ddf1d9755a1..58c9a4fb6ebf 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll @@ -231,6 +231,53 @@ module Impl { TVariableOrAccessCandVariable(Variable v) or TVariableOrAccessCandVariableAccessCand(VariableAccessCand va) + /** + * A variable declaration or variable access candidate. + * + * In order to determine whether a candidate is an actual variable access, + * we rank declarations and candidates by their position in source code. + * + * The ranking must take variable names into account, but also variable scopes; + * below a comment `rank(scope, name, i)` means that the declaration/access on + * the given line has rank `i` amongst all declarations/accesses inside variable + * scope `scope`, for variable name `name`: + * + * ```rust + * fn f() { // scope0 + * let x = 0; // rank(scope0, "x", 0) + * use(x); // rank(scope0, "x", 1) + * let x = // rank(scope0, "x", 3) + * x + 1; // rank(scope0, "x", 2) + * let y = // rank(scope0, "y", 0) + * x; // rank(scope0, "x", 4) + * + * { // scope1 + * use(x); // rank(scope1, "x", 0), rank(scope0, "x", 4) + * use(y); // rank(scope1, "y", 0), rank(scope0, "y", 1) + * let x = 2; // rank(scope1, "x", 1) + * use(x); // rank(scope1, "x", 2), rank(scope0, "x", 4) + * } + * } + * ``` + * + * Variable declarations are only ranked in the scope that they bind into, while + * accesses candidates propagate outwards through scopes, as they may access + * declarations from outer scopes. + * + * For an access candidate with ranks `{ rank(scope_i, name, rnk_i) | i in I }` and + * declarations `d in D` with ranks `rnk(scope_d, name, rnk_d)`, the target is + * calculated as + * ``` + * max_{i in I} ( + * max_{d in D | scope_d = scope_i and rnk_d < rnk_i} ( + * d + * ) + * ) + * ``` + * + * i.e., its the nearest declaration before the access in the same (or outer) scope + * as the access. + */ private class VariableOrAccessCand extends TVariableOrAccessCand { Variable asVariable() { this = TVariableOrAccessCandVariable(result) } diff --git a/rust/ql/test/utils/internal/InlineExpectationsTestImpl.qll b/rust/ql/test/utils/internal/InlineExpectationsTestImpl.qll index 74b8a39431de..2e851f529512 100644 --- a/rust/ql/test/utils/internal/InlineExpectationsTestImpl.qll +++ b/rust/ql/test/utils/internal/InlineExpectationsTestImpl.qll @@ -3,9 +3,6 @@ private import R private import codeql.util.test.InlineExpectationsTest module Impl implements InlineExpectationsTestSig { - /** - * A class representing line comments in C# used by the InlineExpectations core code - */ class ExpectationComment extends R::Comment { /** Gets the contents of the given comment, _without_ the preceding comment marker (`//`). */ string getContents() { result = this.getCommentText() } From 91e26d0f4473626cdea80840f55717252cc4aaab Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Tue, 1 Oct 2024 13:45:58 +0200 Subject: [PATCH 17/79] Rust: Add another variable test --- .../CONSISTENCY/CfgConsistency.expected | 2 +- .../variables/variables.expected | 94 ++++++++++--------- .../test/library-tests/variables/variables.rs | 16 ++++ 3 files changed, 66 insertions(+), 46 deletions(-) diff --git a/rust/ql/test/library-tests/variables/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/library-tests/variables/CONSISTENCY/CfgConsistency.expected index 56ae06526e76..5457cb7c9d96 100644 --- a/rust/ql/test/library-tests/variables/CONSISTENCY/CfgConsistency.expected +++ b/rust/ql/test/library-tests/variables/CONSISTENCY/CfgConsistency.expected @@ -2,4 +2,4 @@ deadEnd | variables.rs:2:5:2:22 | ExprStmt | | variables.rs:6:5:6:22 | ExprStmt | | variables.rs:200:16:200:21 | ... > ... | -| variables.rs:295:5:295:42 | LetStmt | +| variables.rs:310:5:310:42 | LetStmt | diff --git a/rust/ql/test/library-tests/variables/variables.expected b/rust/ql/test/library-tests/variables/variables.expected index 18ee16a3da9c..ba563aeab6ef 100644 --- a/rust/ql/test/library-tests/variables/variables.expected +++ b/rust/ql/test/library-tests/variables/variables.expected @@ -46,23 +46,25 @@ variable | variables.rs:210:13:210:13 | e | | variables.rs:211:14:211:51 | a11 | | variables.rs:214:33:214:35 | a12 | -| variables.rs:224:5:224:6 | a8 | -| variables.rs:226:9:226:10 | b3 | -| variables.rs:227:9:227:10 | c1 | -| variables.rs:235:6:235:41 | a9 | -| variables.rs:242:13:242:15 | a10 | -| variables.rs:243:13:243:14 | b4 | -| variables.rs:244:13:244:14 | c2 | -| variables.rs:265:13:265:15 | a10 | -| variables.rs:266:13:266:14 | b4 | -| variables.rs:278:9:278:23 | example_closure | -| variables.rs:279:10:279:10 | x | -| variables.rs:281:9:281:10 | n1 | -| variables.rs:286:9:286:26 | immutable_variable | -| variables.rs:287:10:287:10 | x | -| variables.rs:289:9:289:10 | n2 | -| variables.rs:295:9:295:9 | v | -| variables.rs:297:9:297:12 | text | +| variables.rs:231:9:231:10 | fv | +| variables.rs:233:9:233:109 | a13 | +| variables.rs:239:5:239:6 | a8 | +| variables.rs:241:9:241:10 | b3 | +| variables.rs:242:9:242:10 | c1 | +| variables.rs:250:6:250:41 | a9 | +| variables.rs:257:13:257:15 | a10 | +| variables.rs:258:13:258:14 | b4 | +| variables.rs:259:13:259:14 | c2 | +| variables.rs:280:13:280:15 | a10 | +| variables.rs:281:13:281:14 | b4 | +| variables.rs:293:9:293:23 | example_closure | +| variables.rs:294:10:294:10 | x | +| variables.rs:296:9:296:10 | n1 | +| variables.rs:301:9:301:26 | immutable_variable | +| variables.rs:302:10:302:10 | x | +| variables.rs:304:9:304:10 | n2 | +| variables.rs:310:9:310:9 | v | +| variables.rs:312:9:312:12 | text | variableAccess | variables.rs:11:15:11:16 | x1 | variables.rs:10:9:10:10 | x1 | | variables.rs:16:15:16:16 | x2 | variables.rs:15:13:15:14 | x2 | @@ -114,31 +116,33 @@ variableAccess | variables.rs:213:23:213:25 | a11 | variables.rs:211:14:211:51 | a11 | | variables.rs:215:15:215:15 | e | variables.rs:210:13:210:13 | e | | variables.rs:216:28:216:30 | a12 | variables.rs:214:33:214:35 | a12 | -| variables.rs:229:15:229:16 | a8 | variables.rs:224:5:224:6 | a8 | -| variables.rs:230:15:230:16 | b3 | variables.rs:226:9:226:10 | b3 | -| variables.rs:231:15:231:16 | c1 | variables.rs:227:9:227:10 | c1 | -| variables.rs:237:15:237:16 | a9 | variables.rs:235:6:235:41 | a9 | -| variables.rs:246:15:246:17 | a10 | variables.rs:242:13:242:15 | a10 | -| variables.rs:247:15:247:16 | b4 | variables.rs:243:13:243:14 | b4 | -| variables.rs:248:15:248:16 | c2 | variables.rs:244:13:244:14 | c2 | -| variables.rs:251:9:251:10 | c2 | variables.rs:244:13:244:14 | c2 | -| variables.rs:252:9:252:10 | b4 | variables.rs:243:13:243:14 | b4 | -| variables.rs:253:9:253:11 | a10 | variables.rs:242:13:242:15 | a10 | -| variables.rs:255:9:255:11 | a10 | variables.rs:242:13:242:15 | a10 | -| variables.rs:256:9:256:10 | b4 | variables.rs:243:13:243:14 | b4 | -| variables.rs:257:9:257:10 | c2 | variables.rs:244:13:244:14 | c2 | -| variables.rs:259:15:259:17 | a10 | variables.rs:242:13:242:15 | a10 | -| variables.rs:260:15:260:16 | b4 | variables.rs:243:13:243:14 | b4 | -| variables.rs:261:15:261:16 | c2 | variables.rs:244:13:244:14 | c2 | -| variables.rs:268:23:268:25 | a10 | variables.rs:265:13:265:15 | a10 | -| variables.rs:269:23:269:24 | b4 | variables.rs:266:13:266:14 | b4 | -| variables.rs:273:15:273:17 | a10 | variables.rs:242:13:242:15 | a10 | -| variables.rs:274:15:274:16 | b4 | variables.rs:243:13:243:14 | b4 | -| variables.rs:280:9:280:9 | x | variables.rs:279:10:279:10 | x | -| variables.rs:282:9:282:23 | example_closure | variables.rs:278:9:278:23 | example_closure | -| variables.rs:283:15:283:16 | n1 | variables.rs:281:9:281:10 | n1 | -| variables.rs:288:9:288:9 | x | variables.rs:287:10:287:10 | x | -| variables.rs:290:9:290:26 | immutable_variable | variables.rs:286:9:286:26 | immutable_variable | -| variables.rs:291:15:291:16 | n2 | variables.rs:289:9:289:10 | n2 | -| variables.rs:298:12:298:12 | v | variables.rs:295:9:295:9 | v | -| variables.rs:299:19:299:22 | text | variables.rs:297:9:297:12 | text | +| variables.rs:232:11:232:12 | fv | variables.rs:231:9:231:10 | fv | +| variables.rs:234:26:234:28 | a13 | variables.rs:233:9:233:109 | a13 | +| variables.rs:244:15:244:16 | a8 | variables.rs:239:5:239:6 | a8 | +| variables.rs:245:15:245:16 | b3 | variables.rs:241:9:241:10 | b3 | +| variables.rs:246:15:246:16 | c1 | variables.rs:242:9:242:10 | c1 | +| variables.rs:252:15:252:16 | a9 | variables.rs:250:6:250:41 | a9 | +| variables.rs:261:15:261:17 | a10 | variables.rs:257:13:257:15 | a10 | +| variables.rs:262:15:262:16 | b4 | variables.rs:258:13:258:14 | b4 | +| variables.rs:263:15:263:16 | c2 | variables.rs:259:13:259:14 | c2 | +| variables.rs:266:9:266:10 | c2 | variables.rs:259:13:259:14 | c2 | +| variables.rs:267:9:267:10 | b4 | variables.rs:258:13:258:14 | b4 | +| variables.rs:268:9:268:11 | a10 | variables.rs:257:13:257:15 | a10 | +| variables.rs:270:9:270:11 | a10 | variables.rs:257:13:257:15 | a10 | +| variables.rs:271:9:271:10 | b4 | variables.rs:258:13:258:14 | b4 | +| variables.rs:272:9:272:10 | c2 | variables.rs:259:13:259:14 | c2 | +| variables.rs:274:15:274:17 | a10 | variables.rs:257:13:257:15 | a10 | +| variables.rs:275:15:275:16 | b4 | variables.rs:258:13:258:14 | b4 | +| variables.rs:276:15:276:16 | c2 | variables.rs:259:13:259:14 | c2 | +| variables.rs:283:23:283:25 | a10 | variables.rs:280:13:280:15 | a10 | +| variables.rs:284:23:284:24 | b4 | variables.rs:281:13:281:14 | b4 | +| variables.rs:288:15:288:17 | a10 | variables.rs:257:13:257:15 | a10 | +| variables.rs:289:15:289:16 | b4 | variables.rs:258:13:258:14 | b4 | +| variables.rs:295:9:295:9 | x | variables.rs:294:10:294:10 | x | +| variables.rs:297:9:297:23 | example_closure | variables.rs:293:9:293:23 | example_closure | +| variables.rs:298:15:298:16 | n1 | variables.rs:296:9:296:10 | n1 | +| variables.rs:303:9:303:9 | x | variables.rs:302:10:302:10 | x | +| variables.rs:305:9:305:26 | immutable_variable | variables.rs:301:9:301:26 | immutable_variable | +| variables.rs:306:15:306:16 | n2 | variables.rs:304:9:304:10 | n2 | +| variables.rs:313:12:313:12 | v | variables.rs:310:9:310:9 | v | +| variables.rs:314:19:314:22 | text | variables.rs:312:9:312:12 | text | diff --git a/rust/ql/test/library-tests/variables/variables.rs b/rust/ql/test/library-tests/variables/variables.rs index f9d3e89938c3..8a0e83c9eff7 100644 --- a/rust/ql/test/library-tests/variables/variables.rs +++ b/rust/ql/test/library-tests/variables/variables.rs @@ -220,6 +220,21 @@ fn match_pattern8() { } } +enum FourValued { + First(i64), + Second(i64), + Third(i64), + Fourth(i64), +} + +fn match_pattern9() { + let fv = FourValued::Second(62); // tv + match fv { // $ access=tv + FourValued::First(a13) | (FourValued::Second(a13) | FourValued::Third(a13)) | FourValued::Fourth(a13) // a13 + => print_i64(a13), // $ access=a13 + } +} + fn param_pattern1( a8: &str, // a8 ( @@ -317,6 +332,7 @@ fn main() { match_pattern6(); match_pattern7(); match_pattern8(); + match_pattern9(); param_pattern1("a", ("b", "c")); param_pattern2(Either::Left(45)); destruct_assignment(); From 901f756c692860c48131fdeba3e2230a2ea6dabd Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Tue, 1 Oct 2024 12:36:38 +0100 Subject: [PATCH 18/79] Java: Add a test for parameter names --- .../library-tests/MemberRefExpr/parameters.expected | 10 ++++++++++ java/ql/test/library-tests/MemberRefExpr/parameters.ql | 5 +++++ 2 files changed, 15 insertions(+) create mode 100644 java/ql/test/library-tests/MemberRefExpr/parameters.expected create mode 100644 java/ql/test/library-tests/MemberRefExpr/parameters.ql diff --git a/java/ql/test/library-tests/MemberRefExpr/parameters.expected b/java/ql/test/library-tests/MemberRefExpr/parameters.expected new file mode 100644 index 000000000000..12f149b5d243 --- /dev/null +++ b/java/ql/test/library-tests/MemberRefExpr/parameters.expected @@ -0,0 +1,10 @@ +| Test.java:3:22:3:24 | o | +| Test.java:7:22:7:26 | i | +| Test.java:45:22:45:26 | s | +| Test.java:49:29:49:42 | p0 | +| Test.java:50:29:50:42 | p0 | +| Test.java:51:29:51:39 | p0 | +| Test.java:52:40:52:64 | p0 | +| Test.java:70:13:70:22 | p0 | +| Test.java:71:13:71:26 | p0 | +| Test.java:75:31:75:47 | p0 | diff --git a/java/ql/test/library-tests/MemberRefExpr/parameters.ql b/java/ql/test/library-tests/MemberRefExpr/parameters.ql new file mode 100644 index 000000000000..d4b8690b4850 --- /dev/null +++ b/java/ql/test/library-tests/MemberRefExpr/parameters.ql @@ -0,0 +1,5 @@ +import java + +from Parameter p +where p.fromSource() +select p From 323b7cb96f84c86176a82ea1b30c52062be86248 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Tue, 1 Oct 2024 12:37:34 +0100 Subject: [PATCH 19/79] Java: Follow change of implicit parameter names --- .../MemberRefExpr/parameters.expected | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/java/ql/test/library-tests/MemberRefExpr/parameters.expected b/java/ql/test/library-tests/MemberRefExpr/parameters.expected index 12f149b5d243..2981f022fef6 100644 --- a/java/ql/test/library-tests/MemberRefExpr/parameters.expected +++ b/java/ql/test/library-tests/MemberRefExpr/parameters.expected @@ -1,10 +1,10 @@ | Test.java:3:22:3:24 | o | | Test.java:7:22:7:26 | i | | Test.java:45:22:45:26 | s | -| Test.java:49:29:49:42 | p0 | -| Test.java:50:29:50:42 | p0 | -| Test.java:51:29:51:39 | p0 | -| Test.java:52:40:52:64 | p0 | -| Test.java:70:13:70:22 | p0 | -| Test.java:71:13:71:26 | p0 | -| Test.java:75:31:75:47 | p0 | +| Test.java:49:29:49:42 | this | +| Test.java:50:29:50:42 | this | +| Test.java:51:29:51:39 | this | +| Test.java:52:40:52:64 | this | +| Test.java:70:13:70:22 | length | +| Test.java:71:13:71:26 | length | +| Test.java:75:31:75:47 | this | From a9b3c0d91b4988bf27e9c0e5b7d8494043932500 Mon Sep 17 00:00:00 2001 From: Calum Grant Date: Tue, 1 Oct 2024 15:47:12 +0100 Subject: [PATCH 20/79] C++: Address review comments --- cpp/ql/lib/semmle/code/cpp/Function.qll | 7 +++++-- cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll | 7 ------- .../ir/implementation/raw/internal/TranslatedElement.qll | 2 +- .../Likely Bugs/Memory Management/UninitializedLocal.ql | 4 ++-- .../CWE/CWE-457/semmle/tests/UninitializedLocal.expected | 1 - 5 files changed, 8 insertions(+), 13 deletions(-) diff --git a/cpp/ql/lib/semmle/code/cpp/Function.qll b/cpp/ql/lib/semmle/code/cpp/Function.qll index 1234791576b1..7cfa779338f7 100644 --- a/cpp/ql/lib/semmle/code/cpp/Function.qll +++ b/cpp/ql/lib/semmle/code/cpp/Function.qll @@ -505,8 +505,11 @@ class Function extends Declaration, ControlFlowNode, AccessHolder, @function { * Holds if this function has extraction errors that create an `ErrorExpr`. */ predicate hasErrors() { - // Exclude allocator call arguments because they are are always extracted as `ErrorExpr`. - exists(ErrorExpr e | e.getEnclosingFunction() = this and not e.isFirstAllocatorCallArgument()) + exists(ErrorExpr e | + e.getEnclosingFunction() = this and + // Exclude the first allocator call argument because it is always extracted as `ErrorExpr`. + not exists(NewOrNewArrayExpr new | e = new.getAllocatorCall().getArgument(0)) + ) } } diff --git a/cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll b/cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll index 4eaf83e2c03f..91b57049a54e 100644 --- a/cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll +++ b/cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll @@ -744,13 +744,6 @@ class ErrorExpr extends Expr, @errorexpr { override string toString() { result = "" } override string getAPrimaryQlClass() { result = "ErrorExpr" } - - /** - * Holds if this error expression is the first argument to a `new` allocation call. - */ - predicate isFirstAllocatorCallArgument() { - this = any(NewOrNewArrayExpr new).getAllocatorCall().getArgument(0) - } } /** diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedElement.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedElement.qll index 1047dc2b8a7b..0f9bc370f7a5 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedElement.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedElement.qll @@ -151,7 +151,7 @@ private predicate ignoreExprOnly(Expr expr) { // The extractor deliberately emits an `ErrorExpr` as the first argument to // the allocator call, if any, of a `NewOrNewArrayExpr`. That `ErrorExpr` // should not be translated. - expr.(ErrorExpr).isFirstAllocatorCallArgument() + exists(NewOrNewArrayExpr new | expr = new.getAllocatorCall().getArgument(0)) or not translateFunction(getEnclosingFunction(expr)) and not Raw::varHasIRFunc(getEnclosingVariable(expr)) diff --git a/cpp/ql/src/Likely Bugs/Memory Management/UninitializedLocal.ql b/cpp/ql/src/Likely Bugs/Memory Management/UninitializedLocal.ql index 226cbfd322b9..763a142f1b90 100644 --- a/cpp/ql/src/Likely Bugs/Memory Management/UninitializedLocal.ql +++ b/cpp/ql/src/Likely Bugs/Memory Management/UninitializedLocal.ql @@ -65,6 +65,7 @@ predicate isSinkImpl(Instruction sink, VariableAccess va) { exists(LoadInstruction load | va = load.getUnconvertedResultExpression() and not va = commonException() and + not va.getTarget().(LocalVariable).getFunction().hasErrors() and sink = load.getSourceValue() ) } @@ -89,6 +90,5 @@ from where conf.hasFlowPath(source, sink) and isSinkImpl(sink.getInstruction(), va) and - v = va.getTarget() and - not v.getFunction().hasErrors() + v = va.getTarget() select va, source, sink, "The variable $@ may not be initialized at this access.", v, v.getName() diff --git a/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/UninitializedLocal.expected b/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/UninitializedLocal.expected index 30896607a18d..6773f5aef942 100644 --- a/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/UninitializedLocal.expected +++ b/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/UninitializedLocal.expected @@ -1,6 +1,5 @@ edges nodes -| errors.cpp:4:7:4:7 | definition of x | semmle.label | definition of x | | errors.cpp:13:7:13:7 | definition of x | semmle.label | definition of x | | test.cpp:11:6:11:8 | definition of foo | semmle.label | definition of foo | | test.cpp:111:6:111:8 | definition of foo | semmle.label | definition of foo | From 315890680cc38d86c49c37e18d104fee2cb95775 Mon Sep 17 00:00:00 2001 From: Rasmus Lerchedahl Petersen Date: Tue, 1 Oct 2024 16:48:43 +0200 Subject: [PATCH 21/79] Python: dict only has one positional argument --- python/ql/lib/semmle/python/frameworks/Stdlib.qll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/ql/lib/semmle/python/frameworks/Stdlib.qll b/python/ql/lib/semmle/python/frameworks/Stdlib.qll index ca8b10d8578a..37cb23a472db 100644 --- a/python/ql/lib/semmle/python/frameworks/Stdlib.qll +++ b/python/ql/lib/semmle/python/frameworks/Stdlib.qll @@ -4219,7 +4219,7 @@ module StdlibPrivate { override predicate propagatesFlow(string input, string output, boolean preservesValue) { exists(DataFlow::DictionaryElementContent dc, string key | key = dc.getKey() | - input = "Argument[0..].DictionaryElement[" + key + "]" and + input = "Argument[0].DictionaryElement[" + key + "]" and output = "ReturnValue.DictionaryElement[" + key + "]" and preservesValue = true ) From 9a82ea48f2708439ce6c2b56b79f907a4171cb9f Mon Sep 17 00:00:00 2001 From: Chris Smowton Date: Tue, 1 Oct 2024 15:41:17 +0100 Subject: [PATCH 22/79] Add test for cross-package references with test extraction --- go/ql/integration-tests/test-extraction/src/go.mod | 2 +- .../test-extraction/src/pkg1/def.go | 7 +++++++ .../test-extraction/src/pkg1/def_test.go | 5 +++++ .../test-extraction/src/pkg2/use.go | 12 ++++++++++++ .../integration-tests/test-extraction/test.expected | 4 ++++ 5 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 go/ql/integration-tests/test-extraction/src/pkg1/def.go create mode 100644 go/ql/integration-tests/test-extraction/src/pkg1/def_test.go create mode 100644 go/ql/integration-tests/test-extraction/src/pkg2/use.go diff --git a/go/ql/integration-tests/test-extraction/src/go.mod b/go/ql/integration-tests/test-extraction/src/go.mod index c4a9f55df6c1..dae010718cf0 100644 --- a/go/ql/integration-tests/test-extraction/src/go.mod +++ b/go/ql/integration-tests/test-extraction/src/go.mod @@ -1,3 +1,3 @@ -go 1.14 +go 1.18 module testsample diff --git a/go/ql/integration-tests/test-extraction/src/pkg1/def.go b/go/ql/integration-tests/test-extraction/src/pkg1/def.go new file mode 100644 index 000000000000..2492919f76df --- /dev/null +++ b/go/ql/integration-tests/test-extraction/src/pkg1/def.go @@ -0,0 +1,7 @@ +package pkg1 + +type Generic[T any] struct { + element T +} + +func TestMe() { } diff --git a/go/ql/integration-tests/test-extraction/src/pkg1/def_test.go b/go/ql/integration-tests/test-extraction/src/pkg1/def_test.go new file mode 100644 index 000000000000..f321ab577c90 --- /dev/null +++ b/go/ql/integration-tests/test-extraction/src/pkg1/def_test.go @@ -0,0 +1,5 @@ +package pkg1 + +func UsePkg1() { + TestMe() +} diff --git a/go/ql/integration-tests/test-extraction/src/pkg2/use.go b/go/ql/integration-tests/test-extraction/src/pkg2/use.go new file mode 100644 index 000000000000..8caabc3847e7 --- /dev/null +++ b/go/ql/integration-tests/test-extraction/src/pkg2/use.go @@ -0,0 +1,12 @@ +package pkg2 + +import ( + "testsample/pkg1" +) + +// This tests the case of cross-package generic type references +// in the presence of test extraction. We need to make sure we +// extract packages, including test variants, in the right order +// such that we've seen pkg1.Generic before we try to use it here. + +type Specialised = pkg1.Generic[string] diff --git a/go/ql/integration-tests/test-extraction/test.expected b/go/ql/integration-tests/test-extraction/test.expected index 9e1585fc5ef8..c4135434743d 100644 --- a/go/ql/integration-tests/test-extraction/test.expected +++ b/go/ql/integration-tests/test-extraction/test.expected @@ -1,8 +1,12 @@ #select +| src/pkg1/def.go:0:0:0:0 | src/pkg1/def.go | +| src/pkg1/def_test.go:0:0:0:0 | src/pkg1/def_test.go | +| src/pkg2/use.go:0:0:0:0 | src/pkg2/use.go | | src/testme.go:0:0:0:0 | src/testme.go | | src/testme_blackbox_test.go:0:0:0:0 | src/testme_blackbox_test.go | | src/testme_test.go:0:0:0:0 | src/testme_test.go | calls +| src/pkg1/def_test.go:4:2:4:9 | call to TestMe | src/pkg1/def.go:7:1:7:17 | function declaration | | src/testme_blackbox_test.go:10:18:10:44 | call to PublicFunction | src/testme.go:3:1:3:38 | function declaration | | src/testme_test.go:9:18:9:33 | call to PublicFunction | src/testme.go:3:1:3:38 | function declaration | | src/testme_test.go:14:19:14:35 | call to privateFunction | src/testme.go:5:1:5:39 | function declaration | From 6ef2aed3aa0d1f57602261f4e8a2de680a43d3aa Mon Sep 17 00:00:00 2001 From: Chris Smowton Date: Tue, 1 Oct 2024 15:52:30 +0100 Subject: [PATCH 23/79] Add blackbox, out-of-package test --- .../test-extraction/src/pkg1/def_blackbox_test.go | 9 +++++++++ go/ql/integration-tests/test-extraction/test.expected | 2 ++ go/ql/integration-tests/test-extraction/test.py | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 go/ql/integration-tests/test-extraction/src/pkg1/def_blackbox_test.go diff --git a/go/ql/integration-tests/test-extraction/src/pkg1/def_blackbox_test.go b/go/ql/integration-tests/test-extraction/src/pkg1/def_blackbox_test.go new file mode 100644 index 000000000000..09c9474567a6 --- /dev/null +++ b/go/ql/integration-tests/test-extraction/src/pkg1/def_blackbox_test.go @@ -0,0 +1,9 @@ +package pkg1_test + +import ( + "testsample/pkg1" +) + +func UsePkg1() { + pkg1.TestMe() +} diff --git a/go/ql/integration-tests/test-extraction/test.expected b/go/ql/integration-tests/test-extraction/test.expected index c4135434743d..eda27075ad43 100644 --- a/go/ql/integration-tests/test-extraction/test.expected +++ b/go/ql/integration-tests/test-extraction/test.expected @@ -1,11 +1,13 @@ #select | src/pkg1/def.go:0:0:0:0 | src/pkg1/def.go | +| src/pkg1/def_blackbox_test.go:0:0:0:0 | src/pkg1/def_blackbox_test.go | | src/pkg1/def_test.go:0:0:0:0 | src/pkg1/def_test.go | | src/pkg2/use.go:0:0:0:0 | src/pkg2/use.go | | src/testme.go:0:0:0:0 | src/testme.go | | src/testme_blackbox_test.go:0:0:0:0 | src/testme_blackbox_test.go | | src/testme_test.go:0:0:0:0 | src/testme_test.go | calls +| src/pkg1/def_blackbox_test.go:8:2:8:14 | call to TestMe | src/pkg1/def.go:7:1:7:17 | function declaration | | src/pkg1/def_test.go:4:2:4:9 | call to TestMe | src/pkg1/def.go:7:1:7:17 | function declaration | | src/testme_blackbox_test.go:10:18:10:44 | call to PublicFunction | src/testme.go:3:1:3:38 | function declaration | | src/testme_test.go:9:18:9:33 | call to PublicFunction | src/testme.go:3:1:3:38 | function declaration | diff --git a/go/ql/integration-tests/test-extraction/test.py b/go/ql/integration-tests/test-extraction/test.py index 6419ae83f38c..e25b46801146 100644 --- a/go/ql/integration-tests/test-extraction/test.py +++ b/go/ql/integration-tests/test-extraction/test.py @@ -1,7 +1,7 @@ import os def test_traced(codeql, go): - codeql.database.create(source_root="src", command="go test -c") + codeql.database.create(source_root="src", command="go test -c ./...") def test_autobuild(codeql, go): codeql.database.create(source_root="src", extractor_option = ["extract_tests=true"]) From cd1f10cdea4b0dc52cf8ef66923e2b6ea9fb98e3 Mon Sep 17 00:00:00 2001 From: Calum Grant Date: Tue, 1 Oct 2024 16:15:24 +0100 Subject: [PATCH 24/79] C++: Reinstate accidentally-deleted comment --- cpp/ql/src/Best Practices/Unused Entities/UnusedLocals.ql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/ql/src/Best Practices/Unused Entities/UnusedLocals.ql b/cpp/ql/src/Best Practices/Unused Entities/UnusedLocals.ql index f824ecf53e76..5ae8468d0fc4 100644 --- a/cpp/ql/src/Best Practices/Unused Entities/UnusedLocals.ql +++ b/cpp/ql/src/Best Practices/Unused Entities/UnusedLocals.ql @@ -57,5 +57,5 @@ where not declarationHasSideEffects(v) and not exists(AsmStmt s | f = s.getEnclosingFunction()) and not v.getAnAttribute().getName() = "unused" and - not f.hasErrors() + not f.hasErrors() // Unextracted expressions may use `v` select v, "Variable " + v.getName() + " is not used." From 3a54c10f369826f3d0491267f582dd4cf33c8bd5 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Tue, 1 Oct 2024 17:35:30 +0100 Subject: [PATCH 25/79] Rust: For now exclude top-level AST elements from LOC counts. This is not ideal. --- rust/ql/lib/codeql/files/FileSystem.qll | 2 ++ rust/ql/test/query-tests/diagnostics/LinesOfCode.expected | 2 +- .../test/query-tests/diagnostics/LinesOfUserCode.expected | 2 +- .../query-tests/diagnostics/LinesOfUserCodeInFiles.expected | 6 +++--- rust/ql/test/query-tests/diagnostics/SummaryStats.expected | 4 ++-- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/rust/ql/lib/codeql/files/FileSystem.qll b/rust/ql/lib/codeql/files/FileSystem.qll index ee7a2235476e..a5410ece9712 100644 --- a/rust/ql/lib/codeql/files/FileSystem.qll +++ b/rust/ql/lib/codeql/files/FileSystem.qll @@ -5,6 +5,7 @@ private import codeql.util.FileSystem private import codeql.rust.elements.SourceFile private import codeql.rust.elements.AstNode private import codeql.rust.elements.Comment +private import codeql.rust.elements.internal.generated.ParentChild private module Input implements InputSig { abstract class ContainerBase extends @container { @@ -47,6 +48,7 @@ class File extends Container, Impl::File { exists(AstNode node, Location loc | not node instanceof Comment and not node instanceof SourceFile and + not getImmediateParent(node) instanceof SourceFile and // ignore top-level elements for now as we're getting their locations wrong when a comment is attached loc = node.getLocation() | node.getFile() = this and diff --git a/rust/ql/test/query-tests/diagnostics/LinesOfCode.expected b/rust/ql/test/query-tests/diagnostics/LinesOfCode.expected index d6a21ebb49cf..3885b955c3f3 100644 --- a/rust/ql/test/query-tests/diagnostics/LinesOfCode.expected +++ b/rust/ql/test/query-tests/diagnostics/LinesOfCode.expected @@ -1 +1 @@ -| 49 | +| 46 | diff --git a/rust/ql/test/query-tests/diagnostics/LinesOfUserCode.expected b/rust/ql/test/query-tests/diagnostics/LinesOfUserCode.expected index d6a21ebb49cf..3885b955c3f3 100644 --- a/rust/ql/test/query-tests/diagnostics/LinesOfUserCode.expected +++ b/rust/ql/test/query-tests/diagnostics/LinesOfUserCode.expected @@ -1 +1 @@ -| 49 | +| 46 | diff --git a/rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected b/rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected index dde3c7fe35a7..52ee2055e8fe 100644 --- a/rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected +++ b/rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected @@ -1,6 +1,6 @@ -| my_struct.rs:0:0:0:0 | my_struct.rs | 21 | -| main.rs:0:0:0:0 | main.rs | 8 | -| my_macro.rs:0:0:0:0 | my_macro.rs | 8 | +| my_struct.rs:0:0:0:0 | my_struct.rs | 20 | +| main.rs:0:0:0:0 | main.rs | 7 | +| my_macro.rs:0:0:0:0 | my_macro.rs | 7 | | lib.rs:0:0:0:0 | lib.rs | 6 | | does_not_compile.rs:0:0:0:0 | does_not_compile.rs | 3 | | error.rs:0:0:0:0 | error.rs | 3 | diff --git a/rust/ql/test/query-tests/diagnostics/SummaryStats.expected b/rust/ql/test/query-tests/diagnostics/SummaryStats.expected index 6c5eafcc38e3..da1e6cd7b60c 100644 --- a/rust/ql/test/query-tests/diagnostics/SummaryStats.expected +++ b/rust/ql/test/query-tests/diagnostics/SummaryStats.expected @@ -1,5 +1,5 @@ | Elements extracted | 216 | | Elements unextracted | 0 | | Files extracted | 6 | -| Lines of code extracted | 49 | -| Lines of user code extracted | 49 | +| Lines of code extracted | 46 | +| Lines of user code extracted | 46 | From e8dd6a88e782ca53d2693caee6cf71cc0d082255 Mon Sep 17 00:00:00 2001 From: Angela P Wen Date: Tue, 1 Oct 2024 10:19:28 -0700 Subject: [PATCH 26/79] Revert "Release preparation for version 2.19.1" --- cpp/ql/lib/CHANGELOG.md | 4 ---- cpp/ql/lib/change-notes/released/2.0.1.md | 3 --- cpp/ql/lib/codeql-pack.release.yml | 2 +- cpp/ql/lib/qlpack.yml | 2 +- cpp/ql/src/CHANGELOG.md | 10 ++------ ...24-09-26-wrong-number-format-arguments.md} | 7 +++--- cpp/ql/src/codeql-pack.release.yml | 2 +- cpp/ql/src/qlpack.yml | 2 +- .../ql/campaigns/Solorigate/lib/CHANGELOG.md | 4 ---- .../lib/change-notes/released/1.7.26.md | 3 --- .../Solorigate/lib/codeql-pack.release.yml | 2 +- csharp/ql/campaigns/Solorigate/lib/qlpack.yml | 2 +- .../ql/campaigns/Solorigate/src/CHANGELOG.md | 4 ---- .../src/change-notes/released/1.7.26.md | 3 --- .../Solorigate/src/codeql-pack.release.yml | 2 +- csharp/ql/campaigns/Solorigate/src/qlpack.yml | 2 +- csharp/ql/lib/CHANGELOG.md | 16 ------------- .../2024-09-10-ActiveThreatModelSource.md | 4 ++++ .../change-notes/2024-09-16-accessor-mad.md | 4 ++++ .../lib/change-notes/2024-09-16-delete-cil.md | 4 ++++ .../2024-09-16-indexer-attributes.md | 4 ++++ .../2024-09-19-reduced-dataflow-nodes.md | 4 ++++ csharp/ql/lib/change-notes/released/3.0.0.md | 15 ------------ csharp/ql/lib/codeql-pack.release.yml | 2 +- csharp/ql/lib/qlpack.yml | 2 +- csharp/ql/src/CHANGELOG.md | 6 ----- ...> 2024-09-25-attribute-collection-sink.md} | 7 +++--- csharp/ql/src/codeql-pack.release.yml | 2 +- csharp/ql/src/qlpack.yml | 2 +- go/ql/consistency-queries/CHANGELOG.md | 4 ---- .../change-notes/released/1.0.9.md | 3 --- .../codeql-pack.release.yml | 2 +- go/ql/consistency-queries/qlpack.yml | 2 +- go/ql/lib/CHANGELOG.md | 24 ++++++------------- .../2024-09-10-ActiveThreatModelSource.md | 4 ++++ ...024-09-24-incorrectly-promoted-methods.md} | 11 +++------ go/ql/lib/codeql-pack.release.yml | 2 +- go/ql/lib/qlpack.yml | 2 +- go/ql/src/CHANGELOG.md | 6 ----- ...ect-integer-conversion-query-precision.md} | 7 +++--- go/ql/src/codeql-pack.release.yml | 2 +- go/ql/src/qlpack.yml | 2 +- java/ql/automodel/src/CHANGELOG.md | 4 ---- .../src/change-notes/released/1.0.9.md | 3 --- java/ql/automodel/src/codeql-pack.release.yml | 2 +- java/ql/automodel/src/qlpack.yml | 2 +- java/ql/lib/CHANGELOG.md | 16 +------------ .../2024-09-10-ActiveThreatModelSource.md | 4 ++++ .../lib/change-notes/2024-09-16-nestedName.md | 4 ++++ java/ql/lib/change-notes/2024-09-18-fields.md | 5 ++++ .../change-notes/2024-09-20-kotlin-2.1.0.md | 4 ++++ .../ql/lib/change-notes/2024-09-25-java-23.md | 4 ++++ java/ql/lib/change-notes/released/4.1.0.md | 13 ---------- java/ql/lib/codeql-pack.release.yml | 2 +- java/ql/lib/qlpack.yml | 2 +- java/ql/src/CHANGELOG.md | 6 ----- .../2024-09-18-getInputStream-summary.md | 4 ++++ java/ql/src/change-notes/released/1.1.6.md | 5 ---- java/ql/src/codeql-pack.release.yml | 2 +- java/ql/src/qlpack.yml | 2 +- javascript/ql/lib/CHANGELOG.md | 4 ---- .../ql/lib/change-notes/released/2.0.1.md | 3 --- javascript/ql/lib/codeql-pack.release.yml | 2 +- javascript/ql/lib/qlpack.yml | 2 +- javascript/ql/src/CHANGELOG.md | 6 +---- .../ql/src/change-notes/released/1.2.1.md | 3 --- javascript/ql/src/codeql-pack.release.yml | 2 +- javascript/ql/src/qlpack.yml | 2 +- misc/suite-helpers/CHANGELOG.md | 4 ---- .../change-notes/released/1.0.9.md | 3 --- misc/suite-helpers/codeql-pack.release.yml | 2 +- misc/suite-helpers/qlpack.yml | 2 +- python/ql/lib/CHANGELOG.md | 10 -------- .../2.1.0.md => 2024-08-16-threat-models.md} | 11 +++------ .../2024-09-20-const-compare-gaurd.md | 4 ++++ python/ql/lib/codeql-pack.release.yml | 2 +- python/ql/lib/qlpack.yml | 2 +- python/ql/src/CHANGELOG.md | 6 ----- ...-08-26-Cors-misconfiguration-middleware.md | 4 ++++ python/ql/src/change-notes/released/1.3.0.md | 5 ---- python/ql/src/codeql-pack.release.yml | 2 +- python/ql/src/qlpack.yml | 2 +- ruby/ql/lib/CHANGELOG.md | 4 ---- ruby/ql/lib/change-notes/released/2.0.1.md | 3 --- ruby/ql/lib/codeql-pack.release.yml | 2 +- ruby/ql/lib/qlpack.yml | 2 +- ruby/ql/src/CHANGELOG.md | 4 ---- ruby/ql/src/change-notes/released/1.1.4.md | 3 --- ruby/ql/src/codeql-pack.release.yml | 2 +- ruby/ql/src/qlpack.yml | 2 +- shared/controlflow/CHANGELOG.md | 4 ---- .../change-notes/released/1.0.9.md | 3 --- shared/controlflow/codeql-pack.release.yml | 2 +- shared/controlflow/qlpack.yml | 2 +- shared/dataflow/CHANGELOG.md | 4 ---- .../dataflow/change-notes/released/1.1.3.md | 3 --- shared/dataflow/codeql-pack.release.yml | 2 +- shared/dataflow/qlpack.yml | 2 +- shared/mad/CHANGELOG.md | 4 ---- shared/mad/change-notes/released/1.0.9.md | 3 --- shared/mad/codeql-pack.release.yml | 2 +- shared/mad/qlpack.yml | 2 +- shared/rangeanalysis/CHANGELOG.md | 4 ---- .../change-notes/released/1.0.9.md | 3 --- shared/rangeanalysis/codeql-pack.release.yml | 2 +- shared/rangeanalysis/qlpack.yml | 2 +- shared/regex/CHANGELOG.md | 4 ---- shared/regex/change-notes/released/1.0.9.md | 3 --- shared/regex/codeql-pack.release.yml | 2 +- shared/regex/qlpack.yml | 2 +- shared/ssa/CHANGELOG.md | 4 ---- shared/ssa/change-notes/released/1.0.9.md | 3 --- shared/ssa/codeql-pack.release.yml | 2 +- shared/ssa/qlpack.yml | 2 +- shared/threat-models/CHANGELOG.md | 4 ---- .../change-notes/released/1.0.9.md | 3 --- shared/threat-models/codeql-pack.release.yml | 2 +- shared/threat-models/qlpack.yml | 2 +- shared/tutorial/CHANGELOG.md | 4 ---- .../tutorial/change-notes/released/1.0.9.md | 3 --- shared/tutorial/codeql-pack.release.yml | 2 +- shared/tutorial/qlpack.yml | 2 +- shared/typeflow/CHANGELOG.md | 4 ---- .../typeflow/change-notes/released/1.0.9.md | 3 --- shared/typeflow/codeql-pack.release.yml | 2 +- shared/typeflow/qlpack.yml | 2 +- shared/typetracking/CHANGELOG.md | 4 ---- .../change-notes/released/1.0.9.md | 3 --- shared/typetracking/codeql-pack.release.yml | 2 +- shared/typetracking/qlpack.yml | 2 +- shared/typos/CHANGELOG.md | 4 ---- shared/typos/change-notes/released/1.0.9.md | 3 --- shared/typos/codeql-pack.release.yml | 2 +- shared/typos/qlpack.yml | 2 +- shared/util/CHANGELOG.md | 4 ---- shared/util/change-notes/released/1.0.9.md | 3 --- shared/util/codeql-pack.release.yml | 2 +- shared/util/qlpack.yml | 2 +- shared/xml/CHANGELOG.md | 4 ---- shared/xml/change-notes/released/1.0.9.md | 3 --- shared/xml/codeql-pack.release.yml | 2 +- shared/xml/qlpack.yml | 2 +- shared/yaml/CHANGELOG.md | 4 ---- shared/yaml/change-notes/released/1.0.9.md | 3 --- shared/yaml/codeql-pack.release.yml | 2 +- shared/yaml/qlpack.yml | 2 +- swift/ql/lib/CHANGELOG.md | 6 ----- .../2.0.1.md => 2024-09-16-final-classes.md} | 7 +++--- swift/ql/lib/codeql-pack.release.yml | 2 +- swift/ql/lib/qlpack.yml | 2 +- swift/ql/src/CHANGELOG.md | 4 ---- swift/ql/src/change-notes/released/1.0.9.md | 3 --- swift/ql/src/codeql-pack.release.yml | 2 +- swift/ql/src/qlpack.yml | 2 +- 154 files changed, 156 insertions(+), 412 deletions(-) delete mode 100644 cpp/ql/lib/change-notes/released/2.0.1.md rename cpp/ql/src/change-notes/{released/1.2.4.md => 2024-09-26-wrong-number-format-arguments.md} (80%) delete mode 100644 csharp/ql/campaigns/Solorigate/lib/change-notes/released/1.7.26.md delete mode 100644 csharp/ql/campaigns/Solorigate/src/change-notes/released/1.7.26.md create mode 100644 csharp/ql/lib/change-notes/2024-09-10-ActiveThreatModelSource.md create mode 100644 csharp/ql/lib/change-notes/2024-09-16-accessor-mad.md create mode 100644 csharp/ql/lib/change-notes/2024-09-16-delete-cil.md create mode 100644 csharp/ql/lib/change-notes/2024-09-16-indexer-attributes.md create mode 100644 csharp/ql/lib/change-notes/2024-09-19-reduced-dataflow-nodes.md delete mode 100644 csharp/ql/lib/change-notes/released/3.0.0.md rename csharp/ql/src/change-notes/{released/1.0.9.md => 2024-09-25-attribute-collection-sink.md} (72%) delete mode 100644 go/ql/consistency-queries/change-notes/released/1.0.9.md create mode 100644 go/ql/lib/change-notes/2024-09-10-ActiveThreatModelSource.md rename go/ql/lib/change-notes/{released/2.1.0.md => 2024-09-24-incorrectly-promoted-methods.md} (55%) rename go/ql/src/change-notes/{released/1.1.0.md => 2024-09-24-incorrect-integer-conversion-query-precision.md} (84%) delete mode 100644 java/ql/automodel/src/change-notes/released/1.0.9.md create mode 100644 java/ql/lib/change-notes/2024-09-10-ActiveThreatModelSource.md create mode 100644 java/ql/lib/change-notes/2024-09-16-nestedName.md create mode 100644 java/ql/lib/change-notes/2024-09-18-fields.md create mode 100644 java/ql/lib/change-notes/2024-09-20-kotlin-2.1.0.md create mode 100644 java/ql/lib/change-notes/2024-09-25-java-23.md delete mode 100644 java/ql/lib/change-notes/released/4.1.0.md create mode 100644 java/ql/src/change-notes/2024-09-18-getInputStream-summary.md delete mode 100644 java/ql/src/change-notes/released/1.1.6.md delete mode 100644 javascript/ql/lib/change-notes/released/2.0.1.md delete mode 100644 javascript/ql/src/change-notes/released/1.2.1.md delete mode 100644 misc/suite-helpers/change-notes/released/1.0.9.md rename python/ql/lib/change-notes/{released/2.1.0.md => 2024-08-16-threat-models.md} (52%) create mode 100644 python/ql/lib/change-notes/2024-09-20-const-compare-gaurd.md create mode 100644 python/ql/src/change-notes/2024-08-26-Cors-misconfiguration-middleware.md delete mode 100644 python/ql/src/change-notes/released/1.3.0.md delete mode 100644 ruby/ql/lib/change-notes/released/2.0.1.md delete mode 100644 ruby/ql/src/change-notes/released/1.1.4.md delete mode 100644 shared/controlflow/change-notes/released/1.0.9.md delete mode 100644 shared/dataflow/change-notes/released/1.1.3.md delete mode 100644 shared/mad/change-notes/released/1.0.9.md delete mode 100644 shared/rangeanalysis/change-notes/released/1.0.9.md delete mode 100644 shared/regex/change-notes/released/1.0.9.md delete mode 100644 shared/ssa/change-notes/released/1.0.9.md delete mode 100644 shared/threat-models/change-notes/released/1.0.9.md delete mode 100644 shared/tutorial/change-notes/released/1.0.9.md delete mode 100644 shared/typeflow/change-notes/released/1.0.9.md delete mode 100644 shared/typetracking/change-notes/released/1.0.9.md delete mode 100644 shared/typos/change-notes/released/1.0.9.md delete mode 100644 shared/util/change-notes/released/1.0.9.md delete mode 100644 shared/xml/change-notes/released/1.0.9.md delete mode 100644 shared/yaml/change-notes/released/1.0.9.md rename swift/ql/lib/change-notes/{released/2.0.1.md => 2024-09-16-final-classes.md} (83%) delete mode 100644 swift/ql/src/change-notes/released/1.0.9.md diff --git a/cpp/ql/lib/CHANGELOG.md b/cpp/ql/lib/CHANGELOG.md index 5d39629f62b0..9723b57f127a 100644 --- a/cpp/ql/lib/CHANGELOG.md +++ b/cpp/ql/lib/CHANGELOG.md @@ -1,7 +1,3 @@ -## 2.0.1 - -No user-facing changes. - ## 2.0.0 ### Breaking Changes diff --git a/cpp/ql/lib/change-notes/released/2.0.1.md b/cpp/ql/lib/change-notes/released/2.0.1.md deleted file mode 100644 index b5b6d0dee915..000000000000 --- a/cpp/ql/lib/change-notes/released/2.0.1.md +++ /dev/null @@ -1,3 +0,0 @@ -## 2.0.1 - -No user-facing changes. diff --git a/cpp/ql/lib/codeql-pack.release.yml b/cpp/ql/lib/codeql-pack.release.yml index fe974a4dbf37..0abe6ccede0f 100644 --- a/cpp/ql/lib/codeql-pack.release.yml +++ b/cpp/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.0.1 +lastReleaseVersion: 2.0.0 diff --git a/cpp/ql/lib/qlpack.yml b/cpp/ql/lib/qlpack.yml index f1a2ac3942f2..ed8138411292 100644 --- a/cpp/ql/lib/qlpack.yml +++ b/cpp/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/cpp-all -version: 2.0.1 +version: 2.0.1-dev groups: cpp dbscheme: semmlecode.cpp.dbscheme extractor: cpp diff --git a/cpp/ql/src/CHANGELOG.md b/cpp/ql/src/CHANGELOG.md index 8eaccb0404dc..05f179aa8447 100644 --- a/cpp/ql/src/CHANGELOG.md +++ b/cpp/ql/src/CHANGELOG.md @@ -1,15 +1,9 @@ -## 1.2.4 - -### Minor Analysis Improvements - -* Fixed false positives in the `cpp/wrong-number-format-arguments` ("Too few arguments to formatting function") query when the formatting function has been declared implicitly. - ## 1.2.3 ### Minor Analysis Improvements -* Removed false positives caused by buffer accesses in unreachable code -* Removed false positives caused by inconsistent type checking +* Removed false positives caused by buffer accesses in unreachable code. +* Removed false positives caused by inconsistent type checking. * Add modeling of C functions that don't throw, thereby increasing the precision of the `cpp/incorrect-allocation-error-handling` ("Incorrect allocation-error handling") query. The query now produces additional true positives. ## 1.2.2 diff --git a/cpp/ql/src/change-notes/released/1.2.4.md b/cpp/ql/src/change-notes/2024-09-26-wrong-number-format-arguments.md similarity index 80% rename from cpp/ql/src/change-notes/released/1.2.4.md rename to cpp/ql/src/change-notes/2024-09-26-wrong-number-format-arguments.md index a603dc14047a..826a2365e24b 100644 --- a/cpp/ql/src/change-notes/released/1.2.4.md +++ b/cpp/ql/src/change-notes/2024-09-26-wrong-number-format-arguments.md @@ -1,5 +1,4 @@ -## 1.2.4 - -### Minor Analysis Improvements - +--- +category: minorAnalysis +--- * Fixed false positives in the `cpp/wrong-number-format-arguments` ("Too few arguments to formatting function") query when the formatting function has been declared implicitly. diff --git a/cpp/ql/src/codeql-pack.release.yml b/cpp/ql/src/codeql-pack.release.yml index 172090f46b6d..09a7400b5941 100644 --- a/cpp/ql/src/codeql-pack.release.yml +++ b/cpp/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.2.4 +lastReleaseVersion: 1.2.3 diff --git a/cpp/ql/src/qlpack.yml b/cpp/ql/src/qlpack.yml index e541f95cd85f..0715feb8e013 100644 --- a/cpp/ql/src/qlpack.yml +++ b/cpp/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/cpp-queries -version: 1.2.4 +version: 1.2.4-dev groups: - cpp - queries diff --git a/csharp/ql/campaigns/Solorigate/lib/CHANGELOG.md b/csharp/ql/campaigns/Solorigate/lib/CHANGELOG.md index 989d5e74408f..c469ca5f4ffc 100644 --- a/csharp/ql/campaigns/Solorigate/lib/CHANGELOG.md +++ b/csharp/ql/campaigns/Solorigate/lib/CHANGELOG.md @@ -1,7 +1,3 @@ -## 1.7.26 - -No user-facing changes. - ## 1.7.25 No user-facing changes. diff --git a/csharp/ql/campaigns/Solorigate/lib/change-notes/released/1.7.26.md b/csharp/ql/campaigns/Solorigate/lib/change-notes/released/1.7.26.md deleted file mode 100644 index 468fc7681dfb..000000000000 --- a/csharp/ql/campaigns/Solorigate/lib/change-notes/released/1.7.26.md +++ /dev/null @@ -1,3 +0,0 @@ -## 1.7.26 - -No user-facing changes. diff --git a/csharp/ql/campaigns/Solorigate/lib/codeql-pack.release.yml b/csharp/ql/campaigns/Solorigate/lib/codeql-pack.release.yml index ca4c34e70d1b..317528bce5fc 100644 --- a/csharp/ql/campaigns/Solorigate/lib/codeql-pack.release.yml +++ b/csharp/ql/campaigns/Solorigate/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.7.26 +lastReleaseVersion: 1.7.25 diff --git a/csharp/ql/campaigns/Solorigate/lib/qlpack.yml b/csharp/ql/campaigns/Solorigate/lib/qlpack.yml index 871d2ed3619a..ca0697ac40be 100644 --- a/csharp/ql/campaigns/Solorigate/lib/qlpack.yml +++ b/csharp/ql/campaigns/Solorigate/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-solorigate-all -version: 1.7.26 +version: 1.7.26-dev groups: - csharp - solorigate diff --git a/csharp/ql/campaigns/Solorigate/src/CHANGELOG.md b/csharp/ql/campaigns/Solorigate/src/CHANGELOG.md index 989d5e74408f..c469ca5f4ffc 100644 --- a/csharp/ql/campaigns/Solorigate/src/CHANGELOG.md +++ b/csharp/ql/campaigns/Solorigate/src/CHANGELOG.md @@ -1,7 +1,3 @@ -## 1.7.26 - -No user-facing changes. - ## 1.7.25 No user-facing changes. diff --git a/csharp/ql/campaigns/Solorigate/src/change-notes/released/1.7.26.md b/csharp/ql/campaigns/Solorigate/src/change-notes/released/1.7.26.md deleted file mode 100644 index 468fc7681dfb..000000000000 --- a/csharp/ql/campaigns/Solorigate/src/change-notes/released/1.7.26.md +++ /dev/null @@ -1,3 +0,0 @@ -## 1.7.26 - -No user-facing changes. diff --git a/csharp/ql/campaigns/Solorigate/src/codeql-pack.release.yml b/csharp/ql/campaigns/Solorigate/src/codeql-pack.release.yml index ca4c34e70d1b..317528bce5fc 100644 --- a/csharp/ql/campaigns/Solorigate/src/codeql-pack.release.yml +++ b/csharp/ql/campaigns/Solorigate/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.7.26 +lastReleaseVersion: 1.7.25 diff --git a/csharp/ql/campaigns/Solorigate/src/qlpack.yml b/csharp/ql/campaigns/Solorigate/src/qlpack.yml index 00c3209afe98..221eca049fe5 100644 --- a/csharp/ql/campaigns/Solorigate/src/qlpack.yml +++ b/csharp/ql/campaigns/Solorigate/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-solorigate-queries -version: 1.7.26 +version: 1.7.26-dev groups: - csharp - solorigate diff --git a/csharp/ql/lib/CHANGELOG.md b/csharp/ql/lib/CHANGELOG.md index 7e8378798830..f27c109e2693 100644 --- a/csharp/ql/lib/CHANGELOG.md +++ b/csharp/ql/lib/CHANGELOG.md @@ -1,19 +1,3 @@ -## 3.0.0 - -### Breaking Changes - -* C#: Add support for MaD directly on properties and indexers using *attributes*. Using `Attribute.Getter` or `Attribute.Setter` in the model `ext` field applies the model to the getter or setter for properties and indexers. Prior to this change `Attribute` models unintentionally worked for property setters (if the property is decorated with the matching attribute). That is, a model that uses the `Attribute` feature directly on a property for a property setter needs to be changed to `Attribute.Setter`. -* C#: Remove all CIL tables and related QL library functionality. - -### Deprecated APIs - -* The class `ThreatModelFlowSource` has been renamed to `ActiveThreatModelSource` to more clearly reflect it only contains the currently active threat model sources. `ThreatModelFlowSource` has been marked as deprecated. - -### Minor Analysis Improvements - -* `DataFlow::Node` instances are no longer created for library methods and fields that are not callable (either statically or dynamically) or otherwise referred to from source code. This may affect third-party queries that use these nodes to identify library methods or fields that are present in DLL files where those methods or fields are unreferenced. If this presents a problem, consider using `Callable` and other non-dataflow classes to identify such library entities. -* C#: Add extractor support for attributes on indexers. - ## 2.0.0 ### Breaking Changes diff --git a/csharp/ql/lib/change-notes/2024-09-10-ActiveThreatModelSource.md b/csharp/ql/lib/change-notes/2024-09-10-ActiveThreatModelSource.md new file mode 100644 index 000000000000..a51e3e1deaf0 --- /dev/null +++ b/csharp/ql/lib/change-notes/2024-09-10-ActiveThreatModelSource.md @@ -0,0 +1,4 @@ +--- +category: deprecated +--- +* The class `ThreatModelFlowSource` has been renamed to `ActiveThreatModelSource` to more clearly reflect it only contains the currently active threat model sources. `ThreatModelFlowSource` has been marked as deprecated. diff --git a/csharp/ql/lib/change-notes/2024-09-16-accessor-mad.md b/csharp/ql/lib/change-notes/2024-09-16-accessor-mad.md new file mode 100644 index 000000000000..3ccdcffef24b --- /dev/null +++ b/csharp/ql/lib/change-notes/2024-09-16-accessor-mad.md @@ -0,0 +1,4 @@ +--- +category: breaking +--- +* C#: Add support for MaD directly on properties and indexers using *attributes*. Using `Attribute.Getter` or `Attribute.Setter` in the model `ext` field applies the model to the getter or setter for properties and indexers. Prior to this change `Attribute` models unintentionally worked for property setters (if the property is decorated with the matching attribute). That is, a model that uses the `Attribute` feature directly on a property for a property setter needs to be changed to `Attribute.Setter`. diff --git a/csharp/ql/lib/change-notes/2024-09-16-delete-cil.md b/csharp/ql/lib/change-notes/2024-09-16-delete-cil.md new file mode 100644 index 000000000000..288fc29e5cb9 --- /dev/null +++ b/csharp/ql/lib/change-notes/2024-09-16-delete-cil.md @@ -0,0 +1,4 @@ +--- +category: breaking +--- +* C#: Remove all CIL tables and related QL library functionality. diff --git a/csharp/ql/lib/change-notes/2024-09-16-indexer-attributes.md b/csharp/ql/lib/change-notes/2024-09-16-indexer-attributes.md new file mode 100644 index 000000000000..4d1fbee6d4cb --- /dev/null +++ b/csharp/ql/lib/change-notes/2024-09-16-indexer-attributes.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* C#: Add extractor support for attributes on indexers. diff --git a/csharp/ql/lib/change-notes/2024-09-19-reduced-dataflow-nodes.md b/csharp/ql/lib/change-notes/2024-09-19-reduced-dataflow-nodes.md new file mode 100644 index 000000000000..da1c4cc54bc7 --- /dev/null +++ b/csharp/ql/lib/change-notes/2024-09-19-reduced-dataflow-nodes.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* `DataFlow::Node` instances are no longer created for library methods and fields that are not callable (either statically or dynamically) or otherwise referred to from source code. This may affect third-party queries that use these nodes to identify library methods or fields that are present in DLL files where those methods or fields are unreferenced. If this presents a problem, consider using `Callable` and other non-dataflow classes to identify such library entities. diff --git a/csharp/ql/lib/change-notes/released/3.0.0.md b/csharp/ql/lib/change-notes/released/3.0.0.md deleted file mode 100644 index 1042cc6d7248..000000000000 --- a/csharp/ql/lib/change-notes/released/3.0.0.md +++ /dev/null @@ -1,15 +0,0 @@ -## 3.0.0 - -### Breaking Changes - -* C#: Add support for MaD directly on properties and indexers using *attributes*. Using `Attribute.Getter` or `Attribute.Setter` in the model `ext` field applies the model to the getter or setter for properties and indexers. Prior to this change `Attribute` models unintentionally worked for property setters (if the property is decorated with the matching attribute). That is, a model that uses the `Attribute` feature directly on a property for a property setter needs to be changed to `Attribute.Setter`. -* C#: Remove all CIL tables and related QL library functionality. - -### Deprecated APIs - -* The class `ThreatModelFlowSource` has been renamed to `ActiveThreatModelSource` to more clearly reflect it only contains the currently active threat model sources. `ThreatModelFlowSource` has been marked as deprecated. - -### Minor Analysis Improvements - -* `DataFlow::Node` instances are no longer created for library methods and fields that are not callable (either statically or dynamically) or otherwise referred to from source code. This may affect third-party queries that use these nodes to identify library methods or fields that are present in DLL files where those methods or fields are unreferenced. If this presents a problem, consider using `Callable` and other non-dataflow classes to identify such library entities. -* C#: Add extractor support for attributes on indexers. diff --git a/csharp/ql/lib/codeql-pack.release.yml b/csharp/ql/lib/codeql-pack.release.yml index 33d3a2cd1139..0abe6ccede0f 100644 --- a/csharp/ql/lib/codeql-pack.release.yml +++ b/csharp/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 3.0.0 +lastReleaseVersion: 2.0.0 diff --git a/csharp/ql/lib/qlpack.yml b/csharp/ql/lib/qlpack.yml index a8e9c68cfb44..9fdd0511ccd0 100644 --- a/csharp/ql/lib/qlpack.yml +++ b/csharp/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-all -version: 3.0.0 +version: 2.0.1-dev groups: csharp dbscheme: semmlecode.csharp.dbscheme extractor: csharp diff --git a/csharp/ql/src/CHANGELOG.md b/csharp/ql/src/CHANGELOG.md index 4c162b64d8f7..c1d05cc119ef 100644 --- a/csharp/ql/src/CHANGELOG.md +++ b/csharp/ql/src/CHANGELOG.md @@ -1,9 +1,3 @@ -## 1.0.9 - -### Minor Analysis Improvements - -* C#: The indexer and `Add` method on `System.Web.UI.AttributeCollection` is no longer considered an HTML sink. - ## 1.0.8 No user-facing changes. diff --git a/csharp/ql/src/change-notes/released/1.0.9.md b/csharp/ql/src/change-notes/2024-09-25-attribute-collection-sink.md similarity index 72% rename from csharp/ql/src/change-notes/released/1.0.9.md rename to csharp/ql/src/change-notes/2024-09-25-attribute-collection-sink.md index 85944dc2a71d..35e959f6f3db 100644 --- a/csharp/ql/src/change-notes/released/1.0.9.md +++ b/csharp/ql/src/change-notes/2024-09-25-attribute-collection-sink.md @@ -1,5 +1,4 @@ -## 1.0.9 - -### Minor Analysis Improvements - +--- +category: minorAnalysis +--- * C#: The indexer and `Add` method on `System.Web.UI.AttributeCollection` is no longer considered an HTML sink. diff --git a/csharp/ql/src/codeql-pack.release.yml b/csharp/ql/src/codeql-pack.release.yml index fb813c5ee050..5c55fbd52ed1 100644 --- a/csharp/ql/src/codeql-pack.release.yml +++ b/csharp/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.9 +lastReleaseVersion: 1.0.8 diff --git a/csharp/ql/src/qlpack.yml b/csharp/ql/src/qlpack.yml index 82e9607d7ab7..363cfe14e3d1 100644 --- a/csharp/ql/src/qlpack.yml +++ b/csharp/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-queries -version: 1.0.9 +version: 1.0.9-dev groups: - csharp - queries diff --git a/go/ql/consistency-queries/CHANGELOG.md b/go/ql/consistency-queries/CHANGELOG.md index 9589b67148fa..7e87aa463576 100644 --- a/go/ql/consistency-queries/CHANGELOG.md +++ b/go/ql/consistency-queries/CHANGELOG.md @@ -1,7 +1,3 @@ -## 1.0.9 - -No user-facing changes. - ## 1.0.8 No user-facing changes. diff --git a/go/ql/consistency-queries/change-notes/released/1.0.9.md b/go/ql/consistency-queries/change-notes/released/1.0.9.md deleted file mode 100644 index ee073f7ec16d..000000000000 --- a/go/ql/consistency-queries/change-notes/released/1.0.9.md +++ /dev/null @@ -1,3 +0,0 @@ -## 1.0.9 - -No user-facing changes. diff --git a/go/ql/consistency-queries/codeql-pack.release.yml b/go/ql/consistency-queries/codeql-pack.release.yml index fb813c5ee050..5c55fbd52ed1 100644 --- a/go/ql/consistency-queries/codeql-pack.release.yml +++ b/go/ql/consistency-queries/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.9 +lastReleaseVersion: 1.0.8 diff --git a/go/ql/consistency-queries/qlpack.yml b/go/ql/consistency-queries/qlpack.yml index 9800f5090fac..b7a6550ede1a 100644 --- a/go/ql/consistency-queries/qlpack.yml +++ b/go/ql/consistency-queries/qlpack.yml @@ -1,5 +1,5 @@ name: codeql-go-consistency-queries -version: 1.0.9 +version: 1.0.9-dev groups: - go - queries diff --git a/go/ql/lib/CHANGELOG.md b/go/ql/lib/CHANGELOG.md index a9a8190e6acc..6fe67e276c31 100644 --- a/go/ql/lib/CHANGELOG.md +++ b/go/ql/lib/CHANGELOG.md @@ -1,13 +1,3 @@ -## 2.1.0 - -### Deprecated APIs - -* The class `ThreatModelFlowSource` has been renamed to `ActiveThreatModelSource` to more clearly reflect it only contains the currently active threat model sources. `ThreatModelFlowSource` has been marked as deprecated. - -### Minor Analysis Improvements - -* A method in the method set of an embedded field of a struct should not be promoted to the method set of the struct if the struct has a method with the same name. This was not being enforced, which meant that there were two methods with the same qualified name, and models were sometimes being applied when they shouldn't have been. This has now been fixed. - ## 2.0.0 ### Breaking Changes @@ -19,13 +9,13 @@ * When a function or type has more than one anonymous type parameters, they were mistakenly being treated as the same type parameter. This has now been fixed. * Local source models for reading and parsing environment variables have been added for the following libraries: - * os - * syscall - * github.com/caarlos0/env - * github.com/gobuffalo/envy - * github.com/hashicorp/go-envparse - * github.com/joho/godotenv - * github.com/kelseyhightower/envconfig + * `os` + * `syscall` + * `github.com/caarlos0/env` + * `github.com/gobuffalo/envy` + * `github.com/hashicorp/go-envparse` + * `github.com/joho/godotenv` + * `github.com/kelseyhightower/envconfig` * Local source models have been added for the APIs which open files in the `io/fs`, `io/ioutil` and `os` packages in the Go standard library. You can optionally include threat models as appropriate when using the CodeQL CLI and in GitHub code scanning. For more information, see [Analyzing your code with CodeQL queries](https://docs.github.com/code-security/codeql-cli/getting-started-with-the-codeql-cli/analyzing-your-code-with-codeql-queries#including-model-packs-to-add-potential-sources-of-tainted-data>) and [Customizing your advanced setup for code scanning](https://docs.github.com/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#extending-codeql-coverage-with-threat-models). ### Bug Fixes diff --git a/go/ql/lib/change-notes/2024-09-10-ActiveThreatModelSource.md b/go/ql/lib/change-notes/2024-09-10-ActiveThreatModelSource.md new file mode 100644 index 000000000000..a51e3e1deaf0 --- /dev/null +++ b/go/ql/lib/change-notes/2024-09-10-ActiveThreatModelSource.md @@ -0,0 +1,4 @@ +--- +category: deprecated +--- +* The class `ThreatModelFlowSource` has been renamed to `ActiveThreatModelSource` to more clearly reflect it only contains the currently active threat model sources. `ThreatModelFlowSource` has been marked as deprecated. diff --git a/go/ql/lib/change-notes/released/2.1.0.md b/go/ql/lib/change-notes/2024-09-24-incorrectly-promoted-methods.md similarity index 55% rename from go/ql/lib/change-notes/released/2.1.0.md rename to go/ql/lib/change-notes/2024-09-24-incorrectly-promoted-methods.md index 2feedfb0c15d..32802982b75e 100644 --- a/go/ql/lib/change-notes/released/2.1.0.md +++ b/go/ql/lib/change-notes/2024-09-24-incorrectly-promoted-methods.md @@ -1,9 +1,4 @@ -## 2.1.0 - -### Deprecated APIs - -* The class `ThreatModelFlowSource` has been renamed to `ActiveThreatModelSource` to more clearly reflect it only contains the currently active threat model sources. `ThreatModelFlowSource` has been marked as deprecated. - -### Minor Analysis Improvements - +--- +category: minorAnalysis +--- * A method in the method set of an embedded field of a struct should not be promoted to the method set of the struct if the struct has a method with the same name. This was not being enforced, which meant that there were two methods with the same qualified name, and models were sometimes being applied when they shouldn't have been. This has now been fixed. diff --git a/go/ql/lib/codeql-pack.release.yml b/go/ql/lib/codeql-pack.release.yml index 487a1a58b2b8..0abe6ccede0f 100644 --- a/go/ql/lib/codeql-pack.release.yml +++ b/go/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.1.0 +lastReleaseVersion: 2.0.0 diff --git a/go/ql/lib/qlpack.yml b/go/ql/lib/qlpack.yml index b6987a250d1a..d86c9a07eed9 100644 --- a/go/ql/lib/qlpack.yml +++ b/go/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/go-all -version: 2.1.0 +version: 2.0.1-dev groups: go dbscheme: go.dbscheme extractor: go diff --git a/go/ql/src/CHANGELOG.md b/go/ql/src/CHANGELOG.md index 69a5ed3e9f83..cf6d235f496b 100644 --- a/go/ql/src/CHANGELOG.md +++ b/go/ql/src/CHANGELOG.md @@ -1,9 +1,3 @@ -## 1.1.0 - -### Query Metadata Changes - -* The precision of the `go/incorrect-integer-conversion-query` query was decreased from `very-high` to `high`, since there is at least one known class of false positives involving dynamic bounds checking. - ## 1.0.8 No user-facing changes. diff --git a/go/ql/src/change-notes/released/1.1.0.md b/go/ql/src/change-notes/2024-09-24-incorrect-integer-conversion-query-precision.md similarity index 84% rename from go/ql/src/change-notes/released/1.1.0.md rename to go/ql/src/change-notes/2024-09-24-incorrect-integer-conversion-query-precision.md index b29676add16e..b8acf46c9c5b 100644 --- a/go/ql/src/change-notes/released/1.1.0.md +++ b/go/ql/src/change-notes/2024-09-24-incorrect-integer-conversion-query-precision.md @@ -1,5 +1,4 @@ -## 1.1.0 - -### Query Metadata Changes - +--- +category: queryMetadata +--- * The precision of the `go/incorrect-integer-conversion-query` query was decreased from `very-high` to `high`, since there is at least one known class of false positives involving dynamic bounds checking. diff --git a/go/ql/src/codeql-pack.release.yml b/go/ql/src/codeql-pack.release.yml index 2ac15439f561..5c55fbd52ed1 100644 --- a/go/ql/src/codeql-pack.release.yml +++ b/go/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.1.0 +lastReleaseVersion: 1.0.8 diff --git a/go/ql/src/qlpack.yml b/go/ql/src/qlpack.yml index e783026f6cfd..cd5903f6d7f4 100644 --- a/go/ql/src/qlpack.yml +++ b/go/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/go-queries -version: 1.1.0 +version: 1.0.9-dev groups: - go - queries diff --git a/java/ql/automodel/src/CHANGELOG.md b/java/ql/automodel/src/CHANGELOG.md index 4d632a2ae2d2..0a51a6089138 100644 --- a/java/ql/automodel/src/CHANGELOG.md +++ b/java/ql/automodel/src/CHANGELOG.md @@ -1,7 +1,3 @@ -## 1.0.9 - -No user-facing changes. - ## 1.0.8 No user-facing changes. diff --git a/java/ql/automodel/src/change-notes/released/1.0.9.md b/java/ql/automodel/src/change-notes/released/1.0.9.md deleted file mode 100644 index ee073f7ec16d..000000000000 --- a/java/ql/automodel/src/change-notes/released/1.0.9.md +++ /dev/null @@ -1,3 +0,0 @@ -## 1.0.9 - -No user-facing changes. diff --git a/java/ql/automodel/src/codeql-pack.release.yml b/java/ql/automodel/src/codeql-pack.release.yml index fb813c5ee050..5c55fbd52ed1 100644 --- a/java/ql/automodel/src/codeql-pack.release.yml +++ b/java/ql/automodel/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.9 +lastReleaseVersion: 1.0.8 diff --git a/java/ql/automodel/src/qlpack.yml b/java/ql/automodel/src/qlpack.yml index 1e1fdbb9f38d..8e4863f23b81 100644 --- a/java/ql/automodel/src/qlpack.yml +++ b/java/ql/automodel/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/java-automodel-queries -version: 1.0.9 +version: 1.0.9-dev groups: - java - automodel diff --git a/java/ql/lib/CHANGELOG.md b/java/ql/lib/CHANGELOG.md index 5441126d72c9..418043171763 100644 --- a/java/ql/lib/CHANGELOG.md +++ b/java/ql/lib/CHANGELOG.md @@ -1,17 +1,3 @@ -## 4.1.0 - -### Deprecated APIs - -* The `Field.getSourceDeclaration()` predicate has been deprecated. The result was always the original field, so calls to it can simply be removed. -* The `Field.isSourceDeclaration()` predicate has been deprecated. It always holds. -* The `RefType.nestedName()` predicate has been deprecated, and `RefType.getNestedName()` added to replace it. -* The class `ThreatModelFlowSource` has been renamed to `ActiveThreatModelSource` to more clearly reflect it only contains the currently active threat model sources. `ThreatModelFlowSource` has been marked as deprecated. - -### New Features - -* The Java extractor and QL libraries now support Java 23. -* Kotlin versions up to 2.1.0\ *x* are now supported. - ## 4.0.0 ### Breaking Changes @@ -27,7 +13,7 @@ ### Major Analysis Improvements -* A generated (Models as Data) summary model is no longer used, if there exists a source code alternative. This primarily affects the analysis, when the analysis includes generated models for the source code being analysed. +* When a method exists as source code, we will no longer use a models-as-data (MaD) model of that method. This primarily affects query results when the analysis includes generated models for the source code being analysed. ## 3.0.2 diff --git a/java/ql/lib/change-notes/2024-09-10-ActiveThreatModelSource.md b/java/ql/lib/change-notes/2024-09-10-ActiveThreatModelSource.md new file mode 100644 index 000000000000..a51e3e1deaf0 --- /dev/null +++ b/java/ql/lib/change-notes/2024-09-10-ActiveThreatModelSource.md @@ -0,0 +1,4 @@ +--- +category: deprecated +--- +* The class `ThreatModelFlowSource` has been renamed to `ActiveThreatModelSource` to more clearly reflect it only contains the currently active threat model sources. `ThreatModelFlowSource` has been marked as deprecated. diff --git a/java/ql/lib/change-notes/2024-09-16-nestedName.md b/java/ql/lib/change-notes/2024-09-16-nestedName.md new file mode 100644 index 000000000000..26e384e99da3 --- /dev/null +++ b/java/ql/lib/change-notes/2024-09-16-nestedName.md @@ -0,0 +1,4 @@ +--- +category: deprecated +--- +* The `RefType.nestedName()` predicate has been deprecated, and `RefType.getNestedName()` added to replace it. diff --git a/java/ql/lib/change-notes/2024-09-18-fields.md b/java/ql/lib/change-notes/2024-09-18-fields.md new file mode 100644 index 000000000000..d2367bf2b04e --- /dev/null +++ b/java/ql/lib/change-notes/2024-09-18-fields.md @@ -0,0 +1,5 @@ +--- +category: deprecated +--- +* The `Field.getSourceDeclaration()` predicate has been deprecated. The result was always the original field, so calls to it can simply be removed. +* The `Field.isSourceDeclaration()` predicate has been deprecated. It always holds. diff --git a/java/ql/lib/change-notes/2024-09-20-kotlin-2.1.0.md b/java/ql/lib/change-notes/2024-09-20-kotlin-2.1.0.md new file mode 100644 index 000000000000..f9b19e63d320 --- /dev/null +++ b/java/ql/lib/change-notes/2024-09-20-kotlin-2.1.0.md @@ -0,0 +1,4 @@ +--- +category: feature +--- +* Kotlin versions up to 2.1.0\ *x* are now supported. diff --git a/java/ql/lib/change-notes/2024-09-25-java-23.md b/java/ql/lib/change-notes/2024-09-25-java-23.md new file mode 100644 index 000000000000..cc620c54d6e7 --- /dev/null +++ b/java/ql/lib/change-notes/2024-09-25-java-23.md @@ -0,0 +1,4 @@ +--- +category: feature +--- +* The Java extractor and QL libraries now support Java 23. diff --git a/java/ql/lib/change-notes/released/4.1.0.md b/java/ql/lib/change-notes/released/4.1.0.md deleted file mode 100644 index 579567e1edd0..000000000000 --- a/java/ql/lib/change-notes/released/4.1.0.md +++ /dev/null @@ -1,13 +0,0 @@ -## 4.1.0 - -### Deprecated APIs - -* The `Field.getSourceDeclaration()` predicate has been deprecated. The result was always the original field, so calls to it can simply be removed. -* The `Field.isSourceDeclaration()` predicate has been deprecated. It always holds. -* The `RefType.nestedName()` predicate has been deprecated, and `RefType.getNestedName()` added to replace it. -* The class `ThreatModelFlowSource` has been renamed to `ActiveThreatModelSource` to more clearly reflect it only contains the currently active threat model sources. `ThreatModelFlowSource` has been marked as deprecated. - -### New Features - -* The Java extractor and QL libraries now support Java 23. -* Kotlin versions up to 2.1.0\ *x* are now supported. diff --git a/java/ql/lib/codeql-pack.release.yml b/java/ql/lib/codeql-pack.release.yml index d5b1bf88d10e..49fe3eef6973 100644 --- a/java/ql/lib/codeql-pack.release.yml +++ b/java/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 4.1.0 +lastReleaseVersion: 4.0.0 diff --git a/java/ql/lib/qlpack.yml b/java/ql/lib/qlpack.yml index 9c69e18a30b8..9189b611545b 100644 --- a/java/ql/lib/qlpack.yml +++ b/java/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/java-all -version: 4.1.0 +version: 4.0.1-dev groups: java dbscheme: config/semmlecode.dbscheme extractor: java diff --git a/java/ql/src/CHANGELOG.md b/java/ql/src/CHANGELOG.md index 20e7a248aebb..c33e27c7b655 100644 --- a/java/ql/src/CHANGELOG.md +++ b/java/ql/src/CHANGELOG.md @@ -1,9 +1,3 @@ -## 1.1.6 - -### Minor Analysis Improvements - -* Added taint summary model for `org.springframework.core.io.InputStreamSource#getInputStream()`. - ## 1.1.5 No user-facing changes. diff --git a/java/ql/src/change-notes/2024-09-18-getInputStream-summary.md b/java/ql/src/change-notes/2024-09-18-getInputStream-summary.md new file mode 100644 index 000000000000..be8056173301 --- /dev/null +++ b/java/ql/src/change-notes/2024-09-18-getInputStream-summary.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Added taint summary model for `org.springframework.core.io.InputStreamSource#getInputStream()`. \ No newline at end of file diff --git a/java/ql/src/change-notes/released/1.1.6.md b/java/ql/src/change-notes/released/1.1.6.md deleted file mode 100644 index dc156b8a5bea..000000000000 --- a/java/ql/src/change-notes/released/1.1.6.md +++ /dev/null @@ -1,5 +0,0 @@ -## 1.1.6 - -### Minor Analysis Improvements - -* Added taint summary model for `org.springframework.core.io.InputStreamSource#getInputStream()`. diff --git a/java/ql/src/codeql-pack.release.yml b/java/ql/src/codeql-pack.release.yml index 9e712a00a21d..df39a9de059d 100644 --- a/java/ql/src/codeql-pack.release.yml +++ b/java/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.1.6 +lastReleaseVersion: 1.1.5 diff --git a/java/ql/src/qlpack.yml b/java/ql/src/qlpack.yml index 635ef97836fe..28de019af811 100644 --- a/java/ql/src/qlpack.yml +++ b/java/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/java-queries -version: 1.1.6 +version: 1.1.6-dev groups: - java - queries diff --git a/javascript/ql/lib/CHANGELOG.md b/javascript/ql/lib/CHANGELOG.md index bb77b4f1f496..105414b5b37f 100644 --- a/javascript/ql/lib/CHANGELOG.md +++ b/javascript/ql/lib/CHANGELOG.md @@ -1,7 +1,3 @@ -## 2.0.1 - -No user-facing changes. - ## 2.0.0 ### Breaking Changes diff --git a/javascript/ql/lib/change-notes/released/2.0.1.md b/javascript/ql/lib/change-notes/released/2.0.1.md deleted file mode 100644 index b5b6d0dee915..000000000000 --- a/javascript/ql/lib/change-notes/released/2.0.1.md +++ /dev/null @@ -1,3 +0,0 @@ -## 2.0.1 - -No user-facing changes. diff --git a/javascript/ql/lib/codeql-pack.release.yml b/javascript/ql/lib/codeql-pack.release.yml index fe974a4dbf37..0abe6ccede0f 100644 --- a/javascript/ql/lib/codeql-pack.release.yml +++ b/javascript/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.0.1 +lastReleaseVersion: 2.0.0 diff --git a/javascript/ql/lib/qlpack.yml b/javascript/ql/lib/qlpack.yml index a93cb421a869..6355ae8868a9 100644 --- a/javascript/ql/lib/qlpack.yml +++ b/javascript/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/javascript-all -version: 2.0.1 +version: 2.0.1-dev groups: javascript dbscheme: semmlecode.javascript.dbscheme extractor: javascript diff --git a/javascript/ql/src/CHANGELOG.md b/javascript/ql/src/CHANGELOG.md index adf7daa3eb43..e337a585f634 100644 --- a/javascript/ql/src/CHANGELOG.md +++ b/javascript/ql/src/CHANGELOG.md @@ -1,12 +1,8 @@ -## 1.2.1 - -No user-facing changes. - ## 1.2.0 ### Major Analysis Improvements -- Added a new query (`js/actions/actions-artifact-leak`) to detect GitHub Actions artifacts that may leak the GITHUB_TOKEN token. +- Added a new query (`js/actions/actions-artifact-leak`) to detect GitHub Actions artifacts that may leak the `GITHUB_TOKEN` token. ## 1.1.3 diff --git a/javascript/ql/src/change-notes/released/1.2.1.md b/javascript/ql/src/change-notes/released/1.2.1.md deleted file mode 100644 index 67aaa1465fd7..000000000000 --- a/javascript/ql/src/change-notes/released/1.2.1.md +++ /dev/null @@ -1,3 +0,0 @@ -## 1.2.1 - -No user-facing changes. diff --git a/javascript/ql/src/codeql-pack.release.yml b/javascript/ql/src/codeql-pack.release.yml index 73dd403938c9..75430e73d1c4 100644 --- a/javascript/ql/src/codeql-pack.release.yml +++ b/javascript/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.2.1 +lastReleaseVersion: 1.2.0 diff --git a/javascript/ql/src/qlpack.yml b/javascript/ql/src/qlpack.yml index 49489696e79a..9b1f749b8ac4 100644 --- a/javascript/ql/src/qlpack.yml +++ b/javascript/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/javascript-queries -version: 1.2.1 +version: 1.2.1-dev groups: - javascript - queries diff --git a/misc/suite-helpers/CHANGELOG.md b/misc/suite-helpers/CHANGELOG.md index 729794553521..1d5d3b7b3869 100644 --- a/misc/suite-helpers/CHANGELOG.md +++ b/misc/suite-helpers/CHANGELOG.md @@ -1,7 +1,3 @@ -## 1.0.9 - -No user-facing changes. - ## 1.0.8 No user-facing changes. diff --git a/misc/suite-helpers/change-notes/released/1.0.9.md b/misc/suite-helpers/change-notes/released/1.0.9.md deleted file mode 100644 index ee073f7ec16d..000000000000 --- a/misc/suite-helpers/change-notes/released/1.0.9.md +++ /dev/null @@ -1,3 +0,0 @@ -## 1.0.9 - -No user-facing changes. diff --git a/misc/suite-helpers/codeql-pack.release.yml b/misc/suite-helpers/codeql-pack.release.yml index fb813c5ee050..5c55fbd52ed1 100644 --- a/misc/suite-helpers/codeql-pack.release.yml +++ b/misc/suite-helpers/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.9 +lastReleaseVersion: 1.0.8 diff --git a/misc/suite-helpers/qlpack.yml b/misc/suite-helpers/qlpack.yml index a4d970e31297..a349dd3c6d23 100644 --- a/misc/suite-helpers/qlpack.yml +++ b/misc/suite-helpers/qlpack.yml @@ -1,4 +1,4 @@ name: codeql/suite-helpers -version: 1.0.9 +version: 1.0.9-dev groups: shared warnOnImplicitThis: true diff --git a/python/ql/lib/CHANGELOG.md b/python/ql/lib/CHANGELOG.md index 4cadb40bc2f5..bd673aa9edc1 100644 --- a/python/ql/lib/CHANGELOG.md +++ b/python/ql/lib/CHANGELOG.md @@ -1,13 +1,3 @@ -## 2.1.0 - -### New Features - -* Added support for custom threat-models, which can be used in most of our taint-tracking queries, see our [documentation](https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#extending-codeql-coverage-with-threat-models) for more details. - -### Minor Analysis Improvements - -* The common sanitizer guard `StringConstCompareBarrier` has been renamed to `ConstCompareBarrier` and expanded to cover comparisons with other constant values such as `None`. This may result in fewer false positive results for several queries. - ## 2.0.0 ### Breaking Changes diff --git a/python/ql/lib/change-notes/released/2.1.0.md b/python/ql/lib/change-notes/2024-08-16-threat-models.md similarity index 52% rename from python/ql/lib/change-notes/released/2.1.0.md rename to python/ql/lib/change-notes/2024-08-16-threat-models.md index e399bad51197..ba01e6f6fbda 100644 --- a/python/ql/lib/change-notes/released/2.1.0.md +++ b/python/ql/lib/change-notes/2024-08-16-threat-models.md @@ -1,9 +1,4 @@ -## 2.1.0 - -### New Features - +--- +category: feature +--- * Added support for custom threat-models, which can be used in most of our taint-tracking queries, see our [documentation](https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#extending-codeql-coverage-with-threat-models) for more details. - -### Minor Analysis Improvements - -* The common sanitizer guard `StringConstCompareBarrier` has been renamed to `ConstCompareBarrier` and expanded to cover comparisons with other constant values such as `None`. This may result in fewer false positive results for several queries. diff --git a/python/ql/lib/change-notes/2024-09-20-const-compare-gaurd.md b/python/ql/lib/change-notes/2024-09-20-const-compare-gaurd.md new file mode 100644 index 000000000000..2adb7fa82a88 --- /dev/null +++ b/python/ql/lib/change-notes/2024-09-20-const-compare-gaurd.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* The common sanitizer guard `StringConstCompareBarrier` has been renamed to `ConstCompareBarrier` and expanded to cover comparisons with other constant values such as `None`. This may result in fewer false positive results for several queries. \ No newline at end of file diff --git a/python/ql/lib/codeql-pack.release.yml b/python/ql/lib/codeql-pack.release.yml index 487a1a58b2b8..0abe6ccede0f 100644 --- a/python/ql/lib/codeql-pack.release.yml +++ b/python/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.1.0 +lastReleaseVersion: 2.0.0 diff --git a/python/ql/lib/qlpack.yml b/python/ql/lib/qlpack.yml index 316f7a1cc1e6..5c71504afecc 100644 --- a/python/ql/lib/qlpack.yml +++ b/python/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/python-all -version: 2.1.0 +version: 2.0.1-dev groups: python dbscheme: semmlecode.python.dbscheme extractor: python diff --git a/python/ql/src/CHANGELOG.md b/python/ql/src/CHANGELOG.md index 21c9ebcf16f9..045938a0cde6 100644 --- a/python/ql/src/CHANGELOG.md +++ b/python/ql/src/CHANGELOG.md @@ -1,9 +1,3 @@ -## 1.3.0 - -### New Queries - -* The `py/cors-misconfiguration-with-credentials` query, which finds insecure CORS middleware configurations. - ## 1.2.2 ### Minor Analysis Improvements diff --git a/python/ql/src/change-notes/2024-08-26-Cors-misconfiguration-middleware.md b/python/ql/src/change-notes/2024-08-26-Cors-misconfiguration-middleware.md new file mode 100644 index 000000000000..aa8bc7198b31 --- /dev/null +++ b/python/ql/src/change-notes/2024-08-26-Cors-misconfiguration-middleware.md @@ -0,0 +1,4 @@ +--- +category: newQuery +--- +* The `py/cors-misconfiguration-with-credentials` query, which finds insecure CORS middleware configurations. \ No newline at end of file diff --git a/python/ql/src/change-notes/released/1.3.0.md b/python/ql/src/change-notes/released/1.3.0.md deleted file mode 100644 index 5679632843a0..000000000000 --- a/python/ql/src/change-notes/released/1.3.0.md +++ /dev/null @@ -1,5 +0,0 @@ -## 1.3.0 - -### New Queries - -* The `py/cors-misconfiguration-with-credentials` query, which finds insecure CORS middleware configurations. diff --git a/python/ql/src/codeql-pack.release.yml b/python/ql/src/codeql-pack.release.yml index ec16350ed6fd..0a70a9a01a7e 100644 --- a/python/ql/src/codeql-pack.release.yml +++ b/python/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.3.0 +lastReleaseVersion: 1.2.2 diff --git a/python/ql/src/qlpack.yml b/python/ql/src/qlpack.yml index 02c861d40e1d..17a8639b4160 100644 --- a/python/ql/src/qlpack.yml +++ b/python/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/python-queries -version: 1.3.0 +version: 1.2.3-dev groups: - python - queries diff --git a/ruby/ql/lib/CHANGELOG.md b/ruby/ql/lib/CHANGELOG.md index 59c058c1c45c..160b3b2b6e73 100644 --- a/ruby/ql/lib/CHANGELOG.md +++ b/ruby/ql/lib/CHANGELOG.md @@ -1,7 +1,3 @@ -## 2.0.1 - -No user-facing changes. - ## 2.0.0 ### Breaking Changes diff --git a/ruby/ql/lib/change-notes/released/2.0.1.md b/ruby/ql/lib/change-notes/released/2.0.1.md deleted file mode 100644 index b5b6d0dee915..000000000000 --- a/ruby/ql/lib/change-notes/released/2.0.1.md +++ /dev/null @@ -1,3 +0,0 @@ -## 2.0.1 - -No user-facing changes. diff --git a/ruby/ql/lib/codeql-pack.release.yml b/ruby/ql/lib/codeql-pack.release.yml index fe974a4dbf37..0abe6ccede0f 100644 --- a/ruby/ql/lib/codeql-pack.release.yml +++ b/ruby/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.0.1 +lastReleaseVersion: 2.0.0 diff --git a/ruby/ql/lib/qlpack.yml b/ruby/ql/lib/qlpack.yml index da808214ea50..aa67854634a3 100644 --- a/ruby/ql/lib/qlpack.yml +++ b/ruby/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/ruby-all -version: 2.0.1 +version: 2.0.1-dev groups: ruby extractor: ruby dbscheme: ruby.dbscheme diff --git a/ruby/ql/src/CHANGELOG.md b/ruby/ql/src/CHANGELOG.md index 5e9c68a56a01..2598b88aa0bd 100644 --- a/ruby/ql/src/CHANGELOG.md +++ b/ruby/ql/src/CHANGELOG.md @@ -1,7 +1,3 @@ -## 1.1.4 - -No user-facing changes. - ## 1.1.3 No user-facing changes. diff --git a/ruby/ql/src/change-notes/released/1.1.4.md b/ruby/ql/src/change-notes/released/1.1.4.md deleted file mode 100644 index b95051903c5a..000000000000 --- a/ruby/ql/src/change-notes/released/1.1.4.md +++ /dev/null @@ -1,3 +0,0 @@ -## 1.1.4 - -No user-facing changes. diff --git a/ruby/ql/src/codeql-pack.release.yml b/ruby/ql/src/codeql-pack.release.yml index 26cbcd3f123b..35e710ab1bf0 100644 --- a/ruby/ql/src/codeql-pack.release.yml +++ b/ruby/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.1.4 +lastReleaseVersion: 1.1.3 diff --git a/ruby/ql/src/qlpack.yml b/ruby/ql/src/qlpack.yml index 47651d248c01..6fe83794b898 100644 --- a/ruby/ql/src/qlpack.yml +++ b/ruby/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/ruby-queries -version: 1.1.4 +version: 1.1.4-dev groups: - ruby - queries diff --git a/shared/controlflow/CHANGELOG.md b/shared/controlflow/CHANGELOG.md index 52b731626290..15a3aca14c62 100644 --- a/shared/controlflow/CHANGELOG.md +++ b/shared/controlflow/CHANGELOG.md @@ -1,7 +1,3 @@ -## 1.0.9 - -No user-facing changes. - ## 1.0.8 No user-facing changes. diff --git a/shared/controlflow/change-notes/released/1.0.9.md b/shared/controlflow/change-notes/released/1.0.9.md deleted file mode 100644 index ee073f7ec16d..000000000000 --- a/shared/controlflow/change-notes/released/1.0.9.md +++ /dev/null @@ -1,3 +0,0 @@ -## 1.0.9 - -No user-facing changes. diff --git a/shared/controlflow/codeql-pack.release.yml b/shared/controlflow/codeql-pack.release.yml index fb813c5ee050..5c55fbd52ed1 100644 --- a/shared/controlflow/codeql-pack.release.yml +++ b/shared/controlflow/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.9 +lastReleaseVersion: 1.0.8 diff --git a/shared/controlflow/qlpack.yml b/shared/controlflow/qlpack.yml index fc8bdde934d4..8e88b6d4da37 100644 --- a/shared/controlflow/qlpack.yml +++ b/shared/controlflow/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/controlflow -version: 1.0.9 +version: 1.0.9-dev groups: shared library: true dependencies: diff --git a/shared/dataflow/CHANGELOG.md b/shared/dataflow/CHANGELOG.md index 360dc9cc8bff..594e7e40d60e 100644 --- a/shared/dataflow/CHANGELOG.md +++ b/shared/dataflow/CHANGELOG.md @@ -1,7 +1,3 @@ -## 1.1.3 - -No user-facing changes. - ## 1.1.2 No user-facing changes. diff --git a/shared/dataflow/change-notes/released/1.1.3.md b/shared/dataflow/change-notes/released/1.1.3.md deleted file mode 100644 index e8f1701bd624..000000000000 --- a/shared/dataflow/change-notes/released/1.1.3.md +++ /dev/null @@ -1,3 +0,0 @@ -## 1.1.3 - -No user-facing changes. diff --git a/shared/dataflow/codeql-pack.release.yml b/shared/dataflow/codeql-pack.release.yml index 35e710ab1bf0..53ab127707fc 100644 --- a/shared/dataflow/codeql-pack.release.yml +++ b/shared/dataflow/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.1.3 +lastReleaseVersion: 1.1.2 diff --git a/shared/dataflow/qlpack.yml b/shared/dataflow/qlpack.yml index 2ad3f8bc73c0..025663097319 100644 --- a/shared/dataflow/qlpack.yml +++ b/shared/dataflow/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/dataflow -version: 1.1.3 +version: 1.1.3-dev groups: shared library: true dependencies: diff --git a/shared/mad/CHANGELOG.md b/shared/mad/CHANGELOG.md index 7857f62905c7..74187f361120 100644 --- a/shared/mad/CHANGELOG.md +++ b/shared/mad/CHANGELOG.md @@ -1,7 +1,3 @@ -## 1.0.9 - -No user-facing changes. - ## 1.0.8 No user-facing changes. diff --git a/shared/mad/change-notes/released/1.0.9.md b/shared/mad/change-notes/released/1.0.9.md deleted file mode 100644 index ee073f7ec16d..000000000000 --- a/shared/mad/change-notes/released/1.0.9.md +++ /dev/null @@ -1,3 +0,0 @@ -## 1.0.9 - -No user-facing changes. diff --git a/shared/mad/codeql-pack.release.yml b/shared/mad/codeql-pack.release.yml index fb813c5ee050..5c55fbd52ed1 100644 --- a/shared/mad/codeql-pack.release.yml +++ b/shared/mad/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.9 +lastReleaseVersion: 1.0.8 diff --git a/shared/mad/qlpack.yml b/shared/mad/qlpack.yml index ed0c1f7113c5..e1bb442e4aee 100644 --- a/shared/mad/qlpack.yml +++ b/shared/mad/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/mad -version: 1.0.9 +version: 1.0.9-dev groups: shared library: true dependencies: diff --git a/shared/rangeanalysis/CHANGELOG.md b/shared/rangeanalysis/CHANGELOG.md index 5878f9b564c0..8a3b99e0bdf0 100644 --- a/shared/rangeanalysis/CHANGELOG.md +++ b/shared/rangeanalysis/CHANGELOG.md @@ -1,7 +1,3 @@ -## 1.0.9 - -No user-facing changes. - ## 1.0.8 No user-facing changes. diff --git a/shared/rangeanalysis/change-notes/released/1.0.9.md b/shared/rangeanalysis/change-notes/released/1.0.9.md deleted file mode 100644 index ee073f7ec16d..000000000000 --- a/shared/rangeanalysis/change-notes/released/1.0.9.md +++ /dev/null @@ -1,3 +0,0 @@ -## 1.0.9 - -No user-facing changes. diff --git a/shared/rangeanalysis/codeql-pack.release.yml b/shared/rangeanalysis/codeql-pack.release.yml index fb813c5ee050..5c55fbd52ed1 100644 --- a/shared/rangeanalysis/codeql-pack.release.yml +++ b/shared/rangeanalysis/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.9 +lastReleaseVersion: 1.0.8 diff --git a/shared/rangeanalysis/qlpack.yml b/shared/rangeanalysis/qlpack.yml index aaf1b1903576..e443eea184f0 100644 --- a/shared/rangeanalysis/qlpack.yml +++ b/shared/rangeanalysis/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/rangeanalysis -version: 1.0.9 +version: 1.0.9-dev groups: shared library: true dependencies: diff --git a/shared/regex/CHANGELOG.md b/shared/regex/CHANGELOG.md index 01154f6c5f52..f0b74ab2c7e4 100644 --- a/shared/regex/CHANGELOG.md +++ b/shared/regex/CHANGELOG.md @@ -1,7 +1,3 @@ -## 1.0.9 - -No user-facing changes. - ## 1.0.8 No user-facing changes. diff --git a/shared/regex/change-notes/released/1.0.9.md b/shared/regex/change-notes/released/1.0.9.md deleted file mode 100644 index ee073f7ec16d..000000000000 --- a/shared/regex/change-notes/released/1.0.9.md +++ /dev/null @@ -1,3 +0,0 @@ -## 1.0.9 - -No user-facing changes. diff --git a/shared/regex/codeql-pack.release.yml b/shared/regex/codeql-pack.release.yml index fb813c5ee050..5c55fbd52ed1 100644 --- a/shared/regex/codeql-pack.release.yml +++ b/shared/regex/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.9 +lastReleaseVersion: 1.0.8 diff --git a/shared/regex/qlpack.yml b/shared/regex/qlpack.yml index d8b03f4ad2f5..56deb3800a17 100644 --- a/shared/regex/qlpack.yml +++ b/shared/regex/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/regex -version: 1.0.9 +version: 1.0.9-dev groups: shared library: true dependencies: diff --git a/shared/ssa/CHANGELOG.md b/shared/ssa/CHANGELOG.md index 85bef6a32845..8d36e2ab664a 100644 --- a/shared/ssa/CHANGELOG.md +++ b/shared/ssa/CHANGELOG.md @@ -1,7 +1,3 @@ -## 1.0.9 - -No user-facing changes. - ## 1.0.8 No user-facing changes. diff --git a/shared/ssa/change-notes/released/1.0.9.md b/shared/ssa/change-notes/released/1.0.9.md deleted file mode 100644 index ee073f7ec16d..000000000000 --- a/shared/ssa/change-notes/released/1.0.9.md +++ /dev/null @@ -1,3 +0,0 @@ -## 1.0.9 - -No user-facing changes. diff --git a/shared/ssa/codeql-pack.release.yml b/shared/ssa/codeql-pack.release.yml index fb813c5ee050..5c55fbd52ed1 100644 --- a/shared/ssa/codeql-pack.release.yml +++ b/shared/ssa/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.9 +lastReleaseVersion: 1.0.8 diff --git a/shared/ssa/qlpack.yml b/shared/ssa/qlpack.yml index 1bd2bea757b3..f412d56b9952 100644 --- a/shared/ssa/qlpack.yml +++ b/shared/ssa/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/ssa -version: 1.0.9 +version: 1.0.9-dev groups: shared library: true dependencies: diff --git a/shared/threat-models/CHANGELOG.md b/shared/threat-models/CHANGELOG.md index 9589b67148fa..7e87aa463576 100644 --- a/shared/threat-models/CHANGELOG.md +++ b/shared/threat-models/CHANGELOG.md @@ -1,7 +1,3 @@ -## 1.0.9 - -No user-facing changes. - ## 1.0.8 No user-facing changes. diff --git a/shared/threat-models/change-notes/released/1.0.9.md b/shared/threat-models/change-notes/released/1.0.9.md deleted file mode 100644 index ee073f7ec16d..000000000000 --- a/shared/threat-models/change-notes/released/1.0.9.md +++ /dev/null @@ -1,3 +0,0 @@ -## 1.0.9 - -No user-facing changes. diff --git a/shared/threat-models/codeql-pack.release.yml b/shared/threat-models/codeql-pack.release.yml index fb813c5ee050..5c55fbd52ed1 100644 --- a/shared/threat-models/codeql-pack.release.yml +++ b/shared/threat-models/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.9 +lastReleaseVersion: 1.0.8 diff --git a/shared/threat-models/qlpack.yml b/shared/threat-models/qlpack.yml index 434466938b1c..0035335c6e3f 100644 --- a/shared/threat-models/qlpack.yml +++ b/shared/threat-models/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/threat-models -version: 1.0.9 +version: 1.0.9-dev library: true groups: shared dataExtensions: diff --git a/shared/tutorial/CHANGELOG.md b/shared/tutorial/CHANGELOG.md index ba77e020439d..93d06a2b74f3 100644 --- a/shared/tutorial/CHANGELOG.md +++ b/shared/tutorial/CHANGELOG.md @@ -1,7 +1,3 @@ -## 1.0.9 - -No user-facing changes. - ## 1.0.8 No user-facing changes. diff --git a/shared/tutorial/change-notes/released/1.0.9.md b/shared/tutorial/change-notes/released/1.0.9.md deleted file mode 100644 index ee073f7ec16d..000000000000 --- a/shared/tutorial/change-notes/released/1.0.9.md +++ /dev/null @@ -1,3 +0,0 @@ -## 1.0.9 - -No user-facing changes. diff --git a/shared/tutorial/codeql-pack.release.yml b/shared/tutorial/codeql-pack.release.yml index fb813c5ee050..5c55fbd52ed1 100644 --- a/shared/tutorial/codeql-pack.release.yml +++ b/shared/tutorial/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.9 +lastReleaseVersion: 1.0.8 diff --git a/shared/tutorial/qlpack.yml b/shared/tutorial/qlpack.yml index 9a89b262a321..6f745d6c77e8 100644 --- a/shared/tutorial/qlpack.yml +++ b/shared/tutorial/qlpack.yml @@ -1,7 +1,7 @@ name: codeql/tutorial description: Library for the CodeQL detective tutorials, helping new users learn to write CodeQL queries. -version: 1.0.9 +version: 1.0.9-dev groups: shared library: true warnOnImplicitThis: true diff --git a/shared/typeflow/CHANGELOG.md b/shared/typeflow/CHANGELOG.md index 93c030dee3e4..de58be267d73 100644 --- a/shared/typeflow/CHANGELOG.md +++ b/shared/typeflow/CHANGELOG.md @@ -1,7 +1,3 @@ -## 1.0.9 - -No user-facing changes. - ## 1.0.8 No user-facing changes. diff --git a/shared/typeflow/change-notes/released/1.0.9.md b/shared/typeflow/change-notes/released/1.0.9.md deleted file mode 100644 index ee073f7ec16d..000000000000 --- a/shared/typeflow/change-notes/released/1.0.9.md +++ /dev/null @@ -1,3 +0,0 @@ -## 1.0.9 - -No user-facing changes. diff --git a/shared/typeflow/codeql-pack.release.yml b/shared/typeflow/codeql-pack.release.yml index fb813c5ee050..5c55fbd52ed1 100644 --- a/shared/typeflow/codeql-pack.release.yml +++ b/shared/typeflow/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.9 +lastReleaseVersion: 1.0.8 diff --git a/shared/typeflow/qlpack.yml b/shared/typeflow/qlpack.yml index 21b1ddbc9654..71d74cb3af5b 100644 --- a/shared/typeflow/qlpack.yml +++ b/shared/typeflow/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/typeflow -version: 1.0.9 +version: 1.0.9-dev groups: shared library: true dependencies: diff --git a/shared/typetracking/CHANGELOG.md b/shared/typetracking/CHANGELOG.md index a4e57c221876..0135f24d76b0 100644 --- a/shared/typetracking/CHANGELOG.md +++ b/shared/typetracking/CHANGELOG.md @@ -1,7 +1,3 @@ -## 1.0.9 - -No user-facing changes. - ## 1.0.8 No user-facing changes. diff --git a/shared/typetracking/change-notes/released/1.0.9.md b/shared/typetracking/change-notes/released/1.0.9.md deleted file mode 100644 index ee073f7ec16d..000000000000 --- a/shared/typetracking/change-notes/released/1.0.9.md +++ /dev/null @@ -1,3 +0,0 @@ -## 1.0.9 - -No user-facing changes. diff --git a/shared/typetracking/codeql-pack.release.yml b/shared/typetracking/codeql-pack.release.yml index fb813c5ee050..5c55fbd52ed1 100644 --- a/shared/typetracking/codeql-pack.release.yml +++ b/shared/typetracking/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.9 +lastReleaseVersion: 1.0.8 diff --git a/shared/typetracking/qlpack.yml b/shared/typetracking/qlpack.yml index 6f7282c54e9e..3f61875e42fb 100644 --- a/shared/typetracking/qlpack.yml +++ b/shared/typetracking/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/typetracking -version: 1.0.9 +version: 1.0.9-dev groups: shared library: true dependencies: diff --git a/shared/typos/CHANGELOG.md b/shared/typos/CHANGELOG.md index acee82ce867b..415174b3b07d 100644 --- a/shared/typos/CHANGELOG.md +++ b/shared/typos/CHANGELOG.md @@ -1,7 +1,3 @@ -## 1.0.9 - -No user-facing changes. - ## 1.0.8 No user-facing changes. diff --git a/shared/typos/change-notes/released/1.0.9.md b/shared/typos/change-notes/released/1.0.9.md deleted file mode 100644 index ee073f7ec16d..000000000000 --- a/shared/typos/change-notes/released/1.0.9.md +++ /dev/null @@ -1,3 +0,0 @@ -## 1.0.9 - -No user-facing changes. diff --git a/shared/typos/codeql-pack.release.yml b/shared/typos/codeql-pack.release.yml index fb813c5ee050..5c55fbd52ed1 100644 --- a/shared/typos/codeql-pack.release.yml +++ b/shared/typos/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.9 +lastReleaseVersion: 1.0.8 diff --git a/shared/typos/qlpack.yml b/shared/typos/qlpack.yml index 3e644f92d6d1..4df1e7c6e6a6 100644 --- a/shared/typos/qlpack.yml +++ b/shared/typos/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/typos -version: 1.0.9 +version: 1.0.9-dev groups: shared library: true warnOnImplicitThis: true diff --git a/shared/util/CHANGELOG.md b/shared/util/CHANGELOG.md index 2f918fd0416f..5213509f1c7b 100644 --- a/shared/util/CHANGELOG.md +++ b/shared/util/CHANGELOG.md @@ -1,7 +1,3 @@ -## 1.0.9 - -No user-facing changes. - ## 1.0.8 No user-facing changes. diff --git a/shared/util/change-notes/released/1.0.9.md b/shared/util/change-notes/released/1.0.9.md deleted file mode 100644 index ee073f7ec16d..000000000000 --- a/shared/util/change-notes/released/1.0.9.md +++ /dev/null @@ -1,3 +0,0 @@ -## 1.0.9 - -No user-facing changes. diff --git a/shared/util/codeql-pack.release.yml b/shared/util/codeql-pack.release.yml index fb813c5ee050..5c55fbd52ed1 100644 --- a/shared/util/codeql-pack.release.yml +++ b/shared/util/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.9 +lastReleaseVersion: 1.0.8 diff --git a/shared/util/qlpack.yml b/shared/util/qlpack.yml index ab191310e567..2e46755f89fe 100644 --- a/shared/util/qlpack.yml +++ b/shared/util/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/util -version: 1.0.9 +version: 1.0.9-dev groups: shared library: true dependencies: null diff --git a/shared/xml/CHANGELOG.md b/shared/xml/CHANGELOG.md index 90afd761e7d4..e776ce85b589 100644 --- a/shared/xml/CHANGELOG.md +++ b/shared/xml/CHANGELOG.md @@ -1,7 +1,3 @@ -## 1.0.9 - -No user-facing changes. - ## 1.0.8 No user-facing changes. diff --git a/shared/xml/change-notes/released/1.0.9.md b/shared/xml/change-notes/released/1.0.9.md deleted file mode 100644 index ee073f7ec16d..000000000000 --- a/shared/xml/change-notes/released/1.0.9.md +++ /dev/null @@ -1,3 +0,0 @@ -## 1.0.9 - -No user-facing changes. diff --git a/shared/xml/codeql-pack.release.yml b/shared/xml/codeql-pack.release.yml index fb813c5ee050..5c55fbd52ed1 100644 --- a/shared/xml/codeql-pack.release.yml +++ b/shared/xml/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.9 +lastReleaseVersion: 1.0.8 diff --git a/shared/xml/qlpack.yml b/shared/xml/qlpack.yml index f43260879fb6..50b2e44a4b77 100644 --- a/shared/xml/qlpack.yml +++ b/shared/xml/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/xml -version: 1.0.9 +version: 1.0.9-dev groups: shared library: true dependencies: diff --git a/shared/yaml/CHANGELOG.md b/shared/yaml/CHANGELOG.md index 222c0ec037c6..3b774c7dc4c7 100644 --- a/shared/yaml/CHANGELOG.md +++ b/shared/yaml/CHANGELOG.md @@ -1,7 +1,3 @@ -## 1.0.9 - -No user-facing changes. - ## 1.0.8 No user-facing changes. diff --git a/shared/yaml/change-notes/released/1.0.9.md b/shared/yaml/change-notes/released/1.0.9.md deleted file mode 100644 index ee073f7ec16d..000000000000 --- a/shared/yaml/change-notes/released/1.0.9.md +++ /dev/null @@ -1,3 +0,0 @@ -## 1.0.9 - -No user-facing changes. diff --git a/shared/yaml/codeql-pack.release.yml b/shared/yaml/codeql-pack.release.yml index fb813c5ee050..5c55fbd52ed1 100644 --- a/shared/yaml/codeql-pack.release.yml +++ b/shared/yaml/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.9 +lastReleaseVersion: 1.0.8 diff --git a/shared/yaml/qlpack.yml b/shared/yaml/qlpack.yml index 4a63da564e55..4fa80cf5c0c9 100644 --- a/shared/yaml/qlpack.yml +++ b/shared/yaml/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/yaml -version: 1.0.9 +version: 1.0.9-dev groups: shared library: true warnOnImplicitThis: true diff --git a/swift/ql/lib/CHANGELOG.md b/swift/ql/lib/CHANGELOG.md index 5602ebc7d231..07ce1b3e9dee 100644 --- a/swift/ql/lib/CHANGELOG.md +++ b/swift/ql/lib/CHANGELOG.md @@ -1,9 +1,3 @@ -## 2.0.1 - -### Minor Analysis Improvements - -* All AST classes in `codeql.swift.elements` are now `final`, which means that it is no longer possible to `override` predicates defined in those classes (it is, however, still possible to `extend` the classes). - ## 2.0.0 ### Breaking Changes diff --git a/swift/ql/lib/change-notes/released/2.0.1.md b/swift/ql/lib/change-notes/2024-09-16-final-classes.md similarity index 83% rename from swift/ql/lib/change-notes/released/2.0.1.md rename to swift/ql/lib/change-notes/2024-09-16-final-classes.md index ea35dc1370bd..32f46efd9796 100644 --- a/swift/ql/lib/change-notes/released/2.0.1.md +++ b/swift/ql/lib/change-notes/2024-09-16-final-classes.md @@ -1,5 +1,4 @@ -## 2.0.1 - -### Minor Analysis Improvements - +--- +category: minorAnalysis +--- * All AST classes in `codeql.swift.elements` are now `final`, which means that it is no longer possible to `override` predicates defined in those classes (it is, however, still possible to `extend` the classes). diff --git a/swift/ql/lib/codeql-pack.release.yml b/swift/ql/lib/codeql-pack.release.yml index fe974a4dbf37..0abe6ccede0f 100644 --- a/swift/ql/lib/codeql-pack.release.yml +++ b/swift/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.0.1 +lastReleaseVersion: 2.0.0 diff --git a/swift/ql/lib/qlpack.yml b/swift/ql/lib/qlpack.yml index dd1896b3c291..dac64ed9ea91 100644 --- a/swift/ql/lib/qlpack.yml +++ b/swift/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/swift-all -version: 2.0.1 +version: 2.0.1-dev groups: swift extractor: swift dbscheme: swift.dbscheme diff --git a/swift/ql/src/CHANGELOG.md b/swift/ql/src/CHANGELOG.md index b47f96f9eb9e..6e8b43032bde 100644 --- a/swift/ql/src/CHANGELOG.md +++ b/swift/ql/src/CHANGELOG.md @@ -1,7 +1,3 @@ -## 1.0.9 - -No user-facing changes. - ## 1.0.8 No user-facing changes. diff --git a/swift/ql/src/change-notes/released/1.0.9.md b/swift/ql/src/change-notes/released/1.0.9.md deleted file mode 100644 index ee073f7ec16d..000000000000 --- a/swift/ql/src/change-notes/released/1.0.9.md +++ /dev/null @@ -1,3 +0,0 @@ -## 1.0.9 - -No user-facing changes. diff --git a/swift/ql/src/codeql-pack.release.yml b/swift/ql/src/codeql-pack.release.yml index fb813c5ee050..5c55fbd52ed1 100644 --- a/swift/ql/src/codeql-pack.release.yml +++ b/swift/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.9 +lastReleaseVersion: 1.0.8 diff --git a/swift/ql/src/qlpack.yml b/swift/ql/src/qlpack.yml index 8f33acf16a69..ff1a0b18e740 100644 --- a/swift/ql/src/qlpack.yml +++ b/swift/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/swift-queries -version: 1.0.9 +version: 1.0.9-dev groups: - swift - queries From 5444a5bf8adce0b37cd34c05319b2a9813fa3301 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Mon, 30 Sep 2024 16:57:31 +0200 Subject: [PATCH 27/79] Rust: Extend `while` and `for` CFG tests --- .../CONSISTENCY/CfgConsistency.expected | 6 +- .../library-tests/controlflow/Cfg.expected | 690 +++++++++--------- .../ql/test/library-tests/controlflow/test.rs | 10 +- 3 files changed, 356 insertions(+), 350 deletions(-) diff --git a/rust/ql/test/library-tests/controlflow/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/library-tests/controlflow/CONSISTENCY/CfgConsistency.expected index ec8ec04bf3ea..49f433fff2c8 100644 --- a/rust/ql/test/library-tests/controlflow/CONSISTENCY/CfgConsistency.expected +++ b/rust/ql/test/library-tests/controlflow/CONSISTENCY/CfgConsistency.expected @@ -1,6 +1,6 @@ deadEnd | test.rs:55:13:55:17 | b | -| test.rs:224:28:224:33 | ... < ... | -| test.rs:239:30:239:48 | BlockExpr | +| test.rs:230:28:230:33 | ... < ... | +| test.rs:245:30:245:48 | BlockExpr | scopeNoFirst -| test.rs:62:5:66:5 | test_for | +| test.rs:65:5:72:5 | test_for | diff --git a/rust/ql/test/library-tests/controlflow/Cfg.expected b/rust/ql/test/library-tests/controlflow/Cfg.expected index d0ab3bd10d63..f7d5365cf182 100644 --- a/rust/ql/test/library-tests/controlflow/Cfg.expected +++ b/rust/ql/test/library-tests/controlflow/Cfg.expected @@ -97,350 +97,350 @@ | test.rs:47:21:47:36 | ExprStmt | test.rs:47:21:47:35 | ContinueExpr | | | test.rs:49:17:49:31 | ContinueExpr | test.rs:44:17:48:17 | ExprStmt | continue('inner) | | test.rs:49:17:49:32 | ExprStmt | test.rs:49:17:49:31 | ContinueExpr | | -| test.rs:54:5:60:5 | enter test_while | test.rs:55:9:55:25 | LetStmt | | +| test.rs:54:5:63:5 | enter test_while | test.rs:55:9:55:25 | LetStmt | | | test.rs:55:9:55:25 | LetStmt | test.rs:55:21:55:24 | true | | | test.rs:55:21:55:24 | true | test.rs:55:13:55:17 | b | | -| test.rs:69:1:72:1 | enter test_nested_function | test.rs:70:5:70:28 | LetStmt | | -| test.rs:69:1:72:1 | exit test_nested_function (normal) | test.rs:69:1:72:1 | exit test_nested_function | | -| test.rs:69:40:72:1 | BlockExpr | test.rs:69:1:72:1 | exit test_nested_function (normal) | | -| test.rs:70:5:70:28 | LetStmt | test.rs:70:19:70:27 | ClosureExpr | | -| test.rs:70:9:70:15 | add_one | test.rs:71:5:71:11 | add_one | match, no-match | -| test.rs:70:19:70:27 | ClosureExpr | test.rs:70:9:70:15 | add_one | | -| test.rs:70:19:70:27 | enter ClosureExpr | test.rs:70:23:70:23 | i | | -| test.rs:70:19:70:27 | exit ClosureExpr (normal) | test.rs:70:19:70:27 | exit ClosureExpr | | -| test.rs:70:23:70:23 | i | test.rs:70:27:70:27 | 1 | | -| test.rs:70:23:70:27 | ... + ... | test.rs:70:19:70:27 | exit ClosureExpr (normal) | | -| test.rs:70:27:70:27 | 1 | test.rs:70:23:70:27 | ... + ... | | -| test.rs:71:5:71:11 | add_one | test.rs:71:13:71:19 | add_one | | -| test.rs:71:5:71:23 | CallExpr | test.rs:69:40:72:1 | BlockExpr | | -| test.rs:71:13:71:19 | add_one | test.rs:71:21:71:21 | n | | -| test.rs:71:13:71:22 | CallExpr | test.rs:71:5:71:23 | CallExpr | | -| test.rs:71:21:71:21 | n | test.rs:71:13:71:22 | CallExpr | | -| test.rs:76:5:82:5 | enter test_if_else | test.rs:77:12:77:12 | n | | -| test.rs:76:5:82:5 | exit test_if_else (normal) | test.rs:76:5:82:5 | exit test_if_else | | -| test.rs:76:36:82:5 | BlockExpr | test.rs:76:5:82:5 | exit test_if_else (normal) | | -| test.rs:77:9:81:9 | IfExpr | test.rs:76:36:82:5 | BlockExpr | | -| test.rs:77:12:77:12 | n | test.rs:77:17:77:17 | 0 | | -| test.rs:77:12:77:17 | ... <= ... | test.rs:78:13:78:13 | 0 | true | -| test.rs:77:12:77:17 | ... <= ... | test.rs:80:13:80:13 | n | false | -| test.rs:77:17:77:17 | 0 | test.rs:77:12:77:17 | ... <= ... | | -| test.rs:77:19:79:9 | BlockExpr | test.rs:77:9:81:9 | IfExpr | | -| test.rs:78:13:78:13 | 0 | test.rs:77:19:79:9 | BlockExpr | | -| test.rs:79:16:81:9 | BlockExpr | test.rs:77:9:81:9 | IfExpr | | -| test.rs:80:13:80:13 | n | test.rs:80:17:80:17 | 1 | | -| test.rs:80:13:80:17 | ... - ... | test.rs:79:16:81:9 | BlockExpr | | -| test.rs:80:17:80:17 | 1 | test.rs:80:13:80:17 | ... - ... | | -| test.rs:84:5:90:5 | enter test_if_let_else | test.rs:85:12:85:26 | LetExpr | | -| test.rs:84:5:90:5 | exit test_if_let_else (normal) | test.rs:84:5:90:5 | exit test_if_let_else | | -| test.rs:84:48:90:5 | BlockExpr | test.rs:84:5:90:5 | exit test_if_let_else (normal) | | -| test.rs:85:9:89:9 | IfExpr | test.rs:84:48:90:5 | BlockExpr | | -| test.rs:85:12:85:26 | LetExpr | test.rs:85:16:85:22 | TupleStructPat | | -| test.rs:85:16:85:22 | TupleStructPat | test.rs:86:13:86:13 | n | match | -| test.rs:85:16:85:22 | TupleStructPat | test.rs:88:13:88:13 | 0 | no-match | -| test.rs:85:28:87:9 | BlockExpr | test.rs:85:9:89:9 | IfExpr | | -| test.rs:86:13:86:13 | n | test.rs:85:28:87:9 | BlockExpr | | -| test.rs:87:16:89:9 | BlockExpr | test.rs:85:9:89:9 | IfExpr | | -| test.rs:88:13:88:13 | 0 | test.rs:87:16:89:9 | BlockExpr | | -| test.rs:92:5:97:5 | enter test_if_let | test.rs:93:9:95:9 | ExprStmt | | -| test.rs:92:5:97:5 | exit test_if_let (normal) | test.rs:92:5:97:5 | exit test_if_let | | -| test.rs:92:43:97:5 | BlockExpr | test.rs:92:5:97:5 | exit test_if_let (normal) | | -| test.rs:93:9:95:9 | ExprStmt | test.rs:93:12:93:26 | LetExpr | | -| test.rs:93:9:95:9 | IfExpr | test.rs:96:9:96:9 | 0 | | -| test.rs:93:12:93:26 | LetExpr | test.rs:93:16:93:22 | TupleStructPat | | -| test.rs:93:16:93:22 | TupleStructPat | test.rs:93:9:95:9 | IfExpr | no-match | -| test.rs:93:16:93:22 | TupleStructPat | test.rs:94:13:94:13 | n | match | -| test.rs:93:28:95:9 | BlockExpr | test.rs:93:9:95:9 | IfExpr | | -| test.rs:94:13:94:13 | n | test.rs:93:28:95:9 | BlockExpr | | -| test.rs:96:9:96:9 | 0 | test.rs:92:43:97:5 | BlockExpr | | -| test.rs:99:5:105:5 | enter test_nested_if | test.rs:100:16:100:16 | PathExpr | | -| test.rs:99:5:105:5 | exit test_nested_if (normal) | test.rs:99:5:105:5 | exit test_nested_if | | -| test.rs:99:38:105:5 | BlockExpr | test.rs:99:5:105:5 | exit test_nested_if (normal) | | -| test.rs:100:9:104:9 | IfExpr | test.rs:99:38:105:5 | BlockExpr | | -| test.rs:100:12:100:49 | ParenExpr | test.rs:101:13:101:13 | 1 | true | -| test.rs:100:12:100:49 | ParenExpr | test.rs:103:13:103:13 | 0 | false | -| test.rs:100:13:100:48 | IfExpr | test.rs:100:12:100:49 | ParenExpr | | -| test.rs:100:16:100:16 | PathExpr | test.rs:100:20:100:20 | 0 | | -| test.rs:100:16:100:20 | ... < ... | test.rs:100:24:100:24 | a | true | -| test.rs:100:16:100:20 | ... < ... | test.rs:100:41:100:41 | a | false | -| test.rs:100:20:100:20 | 0 | test.rs:100:16:100:20 | ... < ... | | -| test.rs:100:22:100:32 | BlockExpr | test.rs:100:13:100:48 | IfExpr | | -| test.rs:100:24:100:24 | a | test.rs:100:29:100:30 | 10 | | -| test.rs:100:24:100:30 | ... < ... | test.rs:100:22:100:32 | BlockExpr | | -| test.rs:100:28:100:30 | - ... | test.rs:100:24:100:30 | ... < ... | | -| test.rs:100:29:100:30 | 10 | test.rs:100:28:100:30 | - ... | | -| test.rs:100:39:100:48 | BlockExpr | test.rs:100:13:100:48 | IfExpr | | -| test.rs:100:41:100:41 | a | test.rs:100:45:100:46 | 10 | | -| test.rs:100:41:100:46 | ... > ... | test.rs:100:39:100:48 | BlockExpr | | -| test.rs:100:45:100:46 | 10 | test.rs:100:41:100:46 | ... > ... | | -| test.rs:100:51:102:9 | BlockExpr | test.rs:100:9:104:9 | IfExpr | | -| test.rs:101:13:101:13 | 1 | test.rs:100:51:102:9 | BlockExpr | | -| test.rs:102:16:104:9 | BlockExpr | test.rs:100:9:104:9 | IfExpr | | -| test.rs:103:13:103:13 | 0 | test.rs:102:16:104:9 | BlockExpr | | -| test.rs:107:5:116:5 | enter test_nested_if_match | test.rs:108:19:108:19 | a | | -| test.rs:107:5:116:5 | exit test_nested_if_match (normal) | test.rs:107:5:116:5 | exit test_nested_if_match | | -| test.rs:107:44:116:5 | BlockExpr | test.rs:107:5:116:5 | exit test_nested_if_match (normal) | | -| test.rs:108:9:115:9 | IfExpr | test.rs:107:44:116:5 | BlockExpr | | -| test.rs:108:12:111:10 | ParenExpr | test.rs:112:13:112:13 | 1 | true | -| test.rs:108:12:111:10 | ParenExpr | test.rs:114:13:114:13 | 0 | false | -| test.rs:108:13:111:9 | MatchExpr | test.rs:108:12:111:10 | ParenExpr | | -| test.rs:108:19:108:19 | a | test.rs:109:13:109:13 | LiteralPat | | -| test.rs:109:13:109:13 | LiteralPat | test.rs:109:18:109:21 | true | match | -| test.rs:109:13:109:13 | LiteralPat | test.rs:110:13:110:13 | WildcardPat | no-match | -| test.rs:109:18:109:21 | true | test.rs:108:13:111:9 | MatchExpr | | -| test.rs:110:13:110:13 | WildcardPat | test.rs:110:18:110:22 | false | match | -| test.rs:110:18:110:22 | false | test.rs:108:13:111:9 | MatchExpr | | -| test.rs:111:12:113:9 | BlockExpr | test.rs:108:9:115:9 | IfExpr | | -| test.rs:112:13:112:13 | 1 | test.rs:111:12:113:9 | BlockExpr | | -| test.rs:113:16:115:9 | BlockExpr | test.rs:108:9:115:9 | IfExpr | | -| test.rs:114:13:114:13 | 0 | test.rs:113:16:115:9 | BlockExpr | | -| test.rs:118:5:127:5 | enter test_nested_if_block | test.rs:120:13:120:15 | ExprStmt | | -| test.rs:118:5:127:5 | exit test_nested_if_block (normal) | test.rs:118:5:127:5 | exit test_nested_if_block | | -| test.rs:118:44:127:5 | BlockExpr | test.rs:118:5:127:5 | exit test_nested_if_block (normal) | | -| test.rs:119:9:126:9 | IfExpr | test.rs:118:44:127:5 | BlockExpr | | -| test.rs:119:12:122:9 | BlockExpr | test.rs:123:13:123:13 | 1 | true | -| test.rs:119:12:122:9 | BlockExpr | test.rs:125:13:125:13 | 0 | false | -| test.rs:120:13:120:14 | TupleExpr | test.rs:121:13:121:13 | a | | -| test.rs:120:13:120:15 | ExprStmt | test.rs:120:13:120:14 | TupleExpr | | -| test.rs:121:13:121:13 | a | test.rs:121:17:121:17 | 0 | | -| test.rs:121:13:121:17 | ... > ... | test.rs:119:12:122:9 | BlockExpr | false, true | -| test.rs:121:17:121:17 | 0 | test.rs:121:13:121:17 | ... > ... | | -| test.rs:122:11:124:9 | BlockExpr | test.rs:119:9:126:9 | IfExpr | | -| test.rs:123:13:123:13 | 1 | test.rs:122:11:124:9 | BlockExpr | | -| test.rs:124:16:126:9 | BlockExpr | test.rs:119:9:126:9 | IfExpr | | -| test.rs:125:13:125:13 | 0 | test.rs:124:16:126:9 | BlockExpr | | -| test.rs:129:5:136:5 | enter test_if_assignment | test.rs:130:9:130:26 | LetStmt | | -| test.rs:129:5:136:5 | exit test_if_assignment (normal) | test.rs:129:5:136:5 | exit test_if_assignment | | -| test.rs:129:42:136:5 | BlockExpr | test.rs:129:5:136:5 | exit test_if_assignment (normal) | | -| test.rs:130:9:130:26 | LetStmt | test.rs:130:21:130:25 | false | | -| test.rs:130:13:130:17 | x | test.rs:131:12:131:12 | x | match, no-match | -| test.rs:130:21:130:25 | false | test.rs:130:13:130:17 | x | | -| test.rs:131:9:135:9 | IfExpr | test.rs:129:42:136:5 | BlockExpr | | -| test.rs:131:12:131:12 | x | test.rs:131:16:131:19 | true | | -| test.rs:131:12:131:19 | ... = ... | test.rs:132:13:132:13 | 1 | true | -| test.rs:131:12:131:19 | ... = ... | test.rs:134:13:134:13 | 0 | false | -| test.rs:131:16:131:19 | true | test.rs:131:12:131:19 | ... = ... | | -| test.rs:131:21:133:9 | BlockExpr | test.rs:131:9:135:9 | IfExpr | | -| test.rs:132:13:132:13 | 1 | test.rs:131:21:133:9 | BlockExpr | | -| test.rs:133:16:135:9 | BlockExpr | test.rs:131:9:135:9 | IfExpr | | -| test.rs:134:13:134:13 | 0 | test.rs:133:16:135:9 | BlockExpr | | -| test.rs:138:5:149:5 | enter test_if_loop1 | test.rs:140:13:142:14 | ExprStmt | | -| test.rs:138:5:149:5 | exit test_if_loop1 (normal) | test.rs:138:5:149:5 | exit test_if_loop1 | | -| test.rs:138:37:149:5 | BlockExpr | test.rs:138:5:149:5 | exit test_if_loop1 (normal) | | -| test.rs:139:9:148:9 | IfExpr | test.rs:138:37:149:5 | BlockExpr | | -| test.rs:139:12:144:10 | ParenExpr | test.rs:145:13:145:13 | 1 | true | -| test.rs:139:12:144:10 | ParenExpr | test.rs:147:13:147:13 | 0 | false | -| test.rs:139:13:144:9 | LoopExpr | test.rs:139:12:144:10 | ParenExpr | | -| test.rs:139:18:144:9 | BlockExpr | test.rs:140:13:142:14 | ExprStmt | | -| test.rs:140:13:142:13 | IfExpr | test.rs:143:13:143:19 | ExprStmt | | -| test.rs:140:13:142:14 | ExprStmt | test.rs:140:16:140:16 | a | | -| test.rs:140:16:140:16 | a | test.rs:140:20:140:20 | 0 | | -| test.rs:140:16:140:20 | ... > ... | test.rs:140:13:142:13 | IfExpr | false | -| test.rs:140:16:140:20 | ... > ... | test.rs:141:17:141:29 | ExprStmt | true | -| test.rs:140:20:140:20 | 0 | test.rs:140:16:140:20 | ... > ... | | -| test.rs:141:17:141:28 | BreakExpr | test.rs:139:13:144:9 | LoopExpr | break | -| test.rs:141:17:141:29 | ExprStmt | test.rs:141:23:141:23 | a | | -| test.rs:141:23:141:23 | a | test.rs:141:27:141:28 | 10 | | -| test.rs:141:23:141:28 | ... > ... | test.rs:141:17:141:28 | BreakExpr | | -| test.rs:141:27:141:28 | 10 | test.rs:141:23:141:28 | ... > ... | | -| test.rs:143:13:143:13 | a | test.rs:143:17:143:18 | 10 | | -| test.rs:143:13:143:18 | ... < ... | test.rs:139:18:144:9 | BlockExpr | | -| test.rs:143:13:143:19 | ExprStmt | test.rs:143:13:143:13 | a | | -| test.rs:143:17:143:18 | 10 | test.rs:143:13:143:18 | ... < ... | | -| test.rs:144:12:146:9 | BlockExpr | test.rs:139:9:148:9 | IfExpr | | -| test.rs:145:13:145:13 | 1 | test.rs:144:12:146:9 | BlockExpr | | -| test.rs:146:16:148:9 | BlockExpr | test.rs:139:9:148:9 | IfExpr | | -| test.rs:147:13:147:13 | 0 | test.rs:146:16:148:9 | BlockExpr | | -| test.rs:151:5:162:5 | enter test_if_loop2 | test.rs:153:13:155:14 | ExprStmt | | -| test.rs:151:5:162:5 | exit test_if_loop2 (normal) | test.rs:151:5:162:5 | exit test_if_loop2 | | -| test.rs:151:37:162:5 | BlockExpr | test.rs:151:5:162:5 | exit test_if_loop2 (normal) | | -| test.rs:152:9:161:9 | IfExpr | test.rs:151:37:162:5 | BlockExpr | | -| test.rs:152:12:157:10 | ParenExpr | test.rs:158:13:158:13 | 1 | true | -| test.rs:152:12:157:10 | ParenExpr | test.rs:160:13:160:13 | 0 | false | -| test.rs:152:13:157:9 | LoopExpr | test.rs:152:12:157:10 | ParenExpr | | -| test.rs:152:26:157:9 | BlockExpr | test.rs:153:13:155:14 | ExprStmt | | -| test.rs:153:13:155:13 | IfExpr | test.rs:156:13:156:19 | ExprStmt | | -| test.rs:153:13:155:14 | ExprStmt | test.rs:153:16:153:16 | a | | -| test.rs:153:16:153:16 | a | test.rs:153:20:153:20 | 0 | | -| test.rs:153:16:153:20 | ... > ... | test.rs:153:13:155:13 | IfExpr | false | -| test.rs:153:16:153:20 | ... > ... | test.rs:154:17:154:36 | ExprStmt | true | -| test.rs:153:20:153:20 | 0 | test.rs:153:16:153:20 | ... > ... | | -| test.rs:154:17:154:35 | BreakExpr | test.rs:152:13:157:9 | LoopExpr | break('label) | -| test.rs:154:17:154:36 | ExprStmt | test.rs:154:30:154:30 | a | | -| test.rs:154:30:154:30 | a | test.rs:154:34:154:35 | 10 | | -| test.rs:154:30:154:35 | ... > ... | test.rs:154:17:154:35 | BreakExpr | | -| test.rs:154:34:154:35 | 10 | test.rs:154:30:154:35 | ... > ... | | -| test.rs:156:13:156:13 | a | test.rs:156:17:156:18 | 10 | | -| test.rs:156:13:156:18 | ... < ... | test.rs:152:26:157:9 | BlockExpr | | -| test.rs:156:13:156:19 | ExprStmt | test.rs:156:13:156:13 | a | | -| test.rs:156:17:156:18 | 10 | test.rs:156:13:156:18 | ... < ... | | -| test.rs:157:12:159:9 | BlockExpr | test.rs:152:9:161:9 | IfExpr | | -| test.rs:158:13:158:13 | 1 | test.rs:157:12:159:9 | BlockExpr | | -| test.rs:159:16:161:9 | BlockExpr | test.rs:152:9:161:9 | IfExpr | | -| test.rs:160:13:160:13 | 0 | test.rs:159:16:161:9 | BlockExpr | | -| test.rs:164:5:172:5 | enter test_labelled_block | test.rs:166:13:166:31 | ExprStmt | | -| test.rs:164:5:172:5 | exit test_labelled_block (normal) | test.rs:164:5:172:5 | exit test_labelled_block | | -| test.rs:166:13:166:30 | BreakExpr | test.rs:164:5:172:5 | exit test_labelled_block (normal) | break('block) | -| test.rs:166:13:166:31 | ExprStmt | test.rs:166:26:166:26 | a | | -| test.rs:166:26:166:26 | a | test.rs:166:30:166:30 | 0 | | -| test.rs:166:26:166:30 | ... > ... | test.rs:166:13:166:30 | BreakExpr | | -| test.rs:166:30:166:30 | 0 | test.rs:166:26:166:30 | ... > ... | | -| test.rs:177:5:180:5 | enter test_and_operator | test.rs:178:9:178:28 | LetStmt | | -| test.rs:177:5:180:5 | exit test_and_operator (normal) | test.rs:177:5:180:5 | exit test_and_operator | | -| test.rs:177:61:180:5 | BlockExpr | test.rs:177:5:180:5 | exit test_and_operator (normal) | | -| test.rs:178:9:178:28 | LetStmt | test.rs:178:17:178:27 | ... && ... | | -| test.rs:178:13:178:13 | d | test.rs:179:9:179:9 | d | match, no-match | -| test.rs:178:17:178:17 | a | test.rs:178:13:178:13 | d | false | -| test.rs:178:17:178:17 | a | test.rs:178:22:178:22 | b | true | -| test.rs:178:17:178:22 | ... && ... | test.rs:178:17:178:17 | a | | -| test.rs:178:17:178:27 | ... && ... | test.rs:178:17:178:22 | ... && ... | | -| test.rs:178:22:178:22 | b | test.rs:178:13:178:13 | d | false | -| test.rs:178:22:178:22 | b | test.rs:178:27:178:27 | c | true | -| test.rs:178:27:178:27 | c | test.rs:178:13:178:13 | d | | -| test.rs:179:9:179:9 | d | test.rs:177:61:180:5 | BlockExpr | | -| test.rs:182:5:185:5 | enter test_or_operator | test.rs:183:9:183:28 | LetStmt | | -| test.rs:182:5:185:5 | exit test_or_operator (normal) | test.rs:182:5:185:5 | exit test_or_operator | | -| test.rs:182:60:185:5 | BlockExpr | test.rs:182:5:185:5 | exit test_or_operator (normal) | | -| test.rs:183:9:183:28 | LetStmt | test.rs:183:17:183:27 | ... \|\| ... | | -| test.rs:183:13:183:13 | d | test.rs:184:9:184:9 | d | match, no-match | -| test.rs:183:17:183:17 | a | test.rs:183:13:183:13 | d | true | -| test.rs:183:17:183:17 | a | test.rs:183:22:183:22 | b | false | -| test.rs:183:17:183:22 | ... \|\| ... | test.rs:183:17:183:17 | a | | -| test.rs:183:17:183:27 | ... \|\| ... | test.rs:183:17:183:22 | ... \|\| ... | | -| test.rs:183:22:183:22 | b | test.rs:183:13:183:13 | d | true | -| test.rs:183:22:183:22 | b | test.rs:183:27:183:27 | c | false | -| test.rs:183:27:183:27 | c | test.rs:183:13:183:13 | d | | -| test.rs:184:9:184:9 | d | test.rs:182:60:185:5 | BlockExpr | | -| test.rs:187:5:190:5 | enter test_or_operator_2 | test.rs:188:9:188:36 | LetStmt | | -| test.rs:187:5:190:5 | exit test_or_operator_2 (normal) | test.rs:187:5:190:5 | exit test_or_operator_2 | | -| test.rs:187:61:190:5 | BlockExpr | test.rs:187:5:190:5 | exit test_or_operator_2 (normal) | | -| test.rs:188:9:188:36 | LetStmt | test.rs:188:17:188:35 | ... \|\| ... | | -| test.rs:188:13:188:13 | d | test.rs:189:9:189:9 | d | match, no-match | -| test.rs:188:17:188:17 | a | test.rs:188:13:188:13 | d | true | -| test.rs:188:17:188:17 | a | test.rs:188:23:188:23 | b | false | -| test.rs:188:17:188:30 | ... \|\| ... | test.rs:188:17:188:17 | a | | -| test.rs:188:17:188:35 | ... \|\| ... | test.rs:188:17:188:30 | ... \|\| ... | | -| test.rs:188:22:188:30 | ParenExpr | test.rs:188:13:188:13 | d | true | -| test.rs:188:22:188:30 | ParenExpr | test.rs:188:35:188:35 | c | false | -| test.rs:188:23:188:23 | b | test.rs:188:28:188:29 | 28 | | -| test.rs:188:23:188:29 | ... == ... | test.rs:188:22:188:30 | ParenExpr | | -| test.rs:188:28:188:29 | 28 | test.rs:188:23:188:29 | ... == ... | | -| test.rs:188:35:188:35 | c | test.rs:188:13:188:13 | d | | -| test.rs:189:9:189:9 | d | test.rs:187:61:190:5 | BlockExpr | | -| test.rs:192:5:195:5 | enter test_not_operator | test.rs:193:9:193:19 | LetStmt | | -| test.rs:192:5:195:5 | exit test_not_operator (normal) | test.rs:192:5:195:5 | exit test_not_operator | | -| test.rs:192:43:195:5 | BlockExpr | test.rs:192:5:195:5 | exit test_not_operator (normal) | | -| test.rs:193:9:193:19 | LetStmt | test.rs:193:18:193:18 | a | | -| test.rs:193:13:193:13 | d | test.rs:194:9:194:9 | d | match, no-match | -| test.rs:193:17:193:18 | ! ... | test.rs:193:13:193:13 | d | | -| test.rs:193:18:193:18 | a | test.rs:193:17:193:18 | ! ... | | -| test.rs:194:9:194:9 | d | test.rs:192:43:195:5 | BlockExpr | | -| test.rs:197:5:203:5 | enter test_if_and_operator | test.rs:198:12:198:22 | ... && ... | | -| test.rs:197:5:203:5 | exit test_if_and_operator (normal) | test.rs:197:5:203:5 | exit test_if_and_operator | | -| test.rs:197:63:203:5 | BlockExpr | test.rs:197:5:203:5 | exit test_if_and_operator (normal) | | -| test.rs:198:9:202:9 | IfExpr | test.rs:197:63:203:5 | BlockExpr | | -| test.rs:198:12:198:12 | a | test.rs:198:17:198:17 | b | true | -| test.rs:198:12:198:12 | a | test.rs:201:13:201:17 | false | false | -| test.rs:198:12:198:17 | ... && ... | test.rs:198:12:198:12 | a | | -| test.rs:198:12:198:22 | ... && ... | test.rs:198:12:198:17 | ... && ... | | -| test.rs:198:17:198:17 | b | test.rs:198:22:198:22 | c | true | -| test.rs:198:17:198:17 | b | test.rs:201:13:201:17 | false | false | -| test.rs:198:22:198:22 | c | test.rs:199:13:199:16 | true | true | -| test.rs:198:22:198:22 | c | test.rs:201:13:201:17 | false | false | -| test.rs:198:24:200:9 | BlockExpr | test.rs:198:9:202:9 | IfExpr | | -| test.rs:199:13:199:16 | true | test.rs:198:24:200:9 | BlockExpr | | -| test.rs:200:16:202:9 | BlockExpr | test.rs:198:9:202:9 | IfExpr | | -| test.rs:201:13:201:17 | false | test.rs:200:16:202:9 | BlockExpr | | -| test.rs:205:5:211:5 | enter test_if_or_operator | test.rs:206:12:206:22 | ... \|\| ... | | -| test.rs:205:5:211:5 | exit test_if_or_operator (normal) | test.rs:205:5:211:5 | exit test_if_or_operator | | -| test.rs:205:62:211:5 | BlockExpr | test.rs:205:5:211:5 | exit test_if_or_operator (normal) | | -| test.rs:206:9:210:9 | IfExpr | test.rs:205:62:211:5 | BlockExpr | | -| test.rs:206:12:206:12 | a | test.rs:206:17:206:17 | b | false | -| test.rs:206:12:206:12 | a | test.rs:207:13:207:16 | true | true | -| test.rs:206:12:206:17 | ... \|\| ... | test.rs:206:12:206:12 | a | | -| test.rs:206:12:206:22 | ... \|\| ... | test.rs:206:12:206:17 | ... \|\| ... | | -| test.rs:206:17:206:17 | b | test.rs:206:22:206:22 | c | false | -| test.rs:206:17:206:17 | b | test.rs:207:13:207:16 | true | true | -| test.rs:206:22:206:22 | c | test.rs:207:13:207:16 | true | true | -| test.rs:206:22:206:22 | c | test.rs:209:13:209:17 | false | false | -| test.rs:206:24:208:9 | BlockExpr | test.rs:206:9:210:9 | IfExpr | | -| test.rs:207:13:207:16 | true | test.rs:206:24:208:9 | BlockExpr | | -| test.rs:208:16:210:9 | BlockExpr | test.rs:206:9:210:9 | IfExpr | | -| test.rs:209:13:209:17 | false | test.rs:208:16:210:9 | BlockExpr | | -| test.rs:213:5:219:5 | enter test_if_not_operator | test.rs:214:13:214:13 | a | | -| test.rs:213:5:219:5 | exit test_if_not_operator (normal) | test.rs:213:5:219:5 | exit test_if_not_operator | | -| test.rs:213:46:219:5 | BlockExpr | test.rs:213:5:219:5 | exit test_if_not_operator (normal) | | -| test.rs:214:9:218:9 | IfExpr | test.rs:213:46:219:5 | BlockExpr | | -| test.rs:214:12:214:13 | ! ... | test.rs:215:13:215:16 | true | true | -| test.rs:214:12:214:13 | ! ... | test.rs:217:13:217:17 | false | false | -| test.rs:214:13:214:13 | a | test.rs:214:12:214:13 | ! ... | false, true | -| test.rs:214:15:216:9 | BlockExpr | test.rs:214:9:218:9 | IfExpr | | -| test.rs:215:13:215:16 | true | test.rs:214:15:216:9 | BlockExpr | | -| test.rs:216:16:218:9 | BlockExpr | test.rs:214:9:218:9 | IfExpr | | -| test.rs:217:13:217:17 | false | test.rs:216:16:218:9 | BlockExpr | | -| test.rs:222:1:228:1 | enter test_match | test.rs:223:11:223:21 | maybe_digit | | -| test.rs:222:1:228:1 | exit test_match (normal) | test.rs:222:1:228:1 | exit test_match | | -| test.rs:222:48:228:1 | BlockExpr | test.rs:222:1:228:1 | exit test_match (normal) | | -| test.rs:223:5:227:5 | MatchExpr | test.rs:222:48:228:1 | BlockExpr | | -| test.rs:223:11:223:21 | maybe_digit | test.rs:224:9:224:23 | TupleStructPat | | -| test.rs:224:9:224:23 | TupleStructPat | test.rs:224:28:224:28 | x | match | -| test.rs:224:9:224:23 | TupleStructPat | test.rs:225:9:225:23 | TupleStructPat | no-match | -| test.rs:224:28:224:28 | x | test.rs:224:32:224:33 | 10 | | -| test.rs:224:32:224:33 | 10 | test.rs:224:28:224:33 | ... < ... | | -| test.rs:225:9:225:23 | TupleStructPat | test.rs:225:28:225:28 | x | match | -| test.rs:225:9:225:23 | TupleStructPat | test.rs:226:9:226:20 | PathPat | no-match | -| test.rs:225:28:225:28 | x | test.rs:223:5:227:5 | MatchExpr | | -| test.rs:226:9:226:20 | PathPat | test.rs:226:25:226:25 | 5 | match | -| test.rs:226:25:226:25 | 5 | test.rs:223:5:227:5 | MatchExpr | | -| test.rs:231:5:236:5 | enter test_infinite_loop | test.rs:232:9:234:9 | ExprStmt | | -| test.rs:232:9:234:9 | ExprStmt | test.rs:233:13:233:13 | 1 | | -| test.rs:232:14:234:9 | BlockExpr | test.rs:233:13:233:13 | 1 | | -| test.rs:233:13:233:13 | 1 | test.rs:232:14:234:9 | BlockExpr | | -| test.rs:238:5:241:5 | enter test_let_match | test.rs:239:9:239:49 | LetStmt | | -| test.rs:238:5:241:5 | exit test_let_match (normal) | test.rs:238:5:241:5 | exit test_let_match | | -| test.rs:238:39:241:5 | BlockExpr | test.rs:238:5:241:5 | exit test_let_match (normal) | | -| test.rs:239:9:239:49 | LetStmt | test.rs:239:23:239:23 | a | | -| test.rs:239:13:239:19 | TupleStructPat | test.rs:239:32:239:46 | "Expected some" | no-match | -| test.rs:239:13:239:19 | TupleStructPat | test.rs:240:9:240:9 | n | match | -| test.rs:239:23:239:23 | a | test.rs:239:13:239:19 | TupleStructPat | | -| test.rs:239:32:239:46 | "Expected some" | test.rs:239:30:239:48 | BlockExpr | | -| test.rs:240:9:240:9 | n | test.rs:238:39:241:5 | BlockExpr | | -| test.rs:244:1:249:1 | enter dead_code | test.rs:245:5:247:5 | ExprStmt | | -| test.rs:244:1:249:1 | exit dead_code (normal) | test.rs:244:1:249:1 | exit dead_code | | -| test.rs:245:5:247:5 | ExprStmt | test.rs:245:9:245:12 | true | | -| test.rs:245:8:245:13 | ParenExpr | test.rs:246:9:246:17 | ExprStmt | true | -| test.rs:245:9:245:12 | true | test.rs:245:8:245:13 | ParenExpr | | -| test.rs:246:9:246:16 | ReturnExpr | test.rs:244:1:249:1 | exit dead_code (normal) | return | -| test.rs:246:9:246:17 | ExprStmt | test.rs:246:16:246:16 | 0 | | -| test.rs:246:16:246:16 | 0 | test.rs:246:9:246:16 | ReturnExpr | | -| test.rs:251:1:264:1 | enter labelled_block | test.rs:252:5:263:6 | LetStmt | | -| test.rs:251:1:264:1 | exit labelled_block (normal) | test.rs:251:1:264:1 | exit labelled_block | | -| test.rs:251:28:264:1 | BlockExpr | test.rs:251:1:264:1 | exit labelled_block (normal) | | -| test.rs:252:5:263:6 | LetStmt | test.rs:253:9:253:19 | ExprStmt | | -| test.rs:252:9:252:14 | result | test.rs:251:28:264:1 | BlockExpr | match, no-match | -| test.rs:252:18:263:5 | BlockExpr | test.rs:252:9:252:14 | result | | -| test.rs:253:9:253:16 | PathExpr | test.rs:253:9:253:18 | CallExpr | | -| test.rs:253:9:253:18 | CallExpr | test.rs:254:9:256:9 | ExprStmt | | -| test.rs:253:9:253:19 | ExprStmt | test.rs:253:9:253:16 | PathExpr | | -| test.rs:254:9:256:9 | ExprStmt | test.rs:254:12:254:28 | PathExpr | | -| test.rs:254:9:256:9 | IfExpr | test.rs:257:9:257:24 | ExprStmt | | -| test.rs:254:12:254:28 | PathExpr | test.rs:254:12:254:30 | CallExpr | | -| test.rs:254:12:254:30 | CallExpr | test.rs:254:9:256:9 | IfExpr | false | -| test.rs:254:12:254:30 | CallExpr | test.rs:255:13:255:27 | ExprStmt | true | -| test.rs:255:13:255:26 | BreakExpr | test.rs:251:1:264:1 | exit labelled_block (normal) | break('block) | -| test.rs:255:13:255:27 | ExprStmt | test.rs:255:26:255:26 | 1 | | -| test.rs:255:26:255:26 | 1 | test.rs:255:13:255:26 | BreakExpr | | -| test.rs:257:9:257:21 | PathExpr | test.rs:257:9:257:23 | CallExpr | | -| test.rs:257:9:257:23 | CallExpr | test.rs:258:9:260:9 | ExprStmt | | -| test.rs:257:9:257:24 | ExprStmt | test.rs:257:9:257:21 | PathExpr | | -| test.rs:258:9:260:9 | ExprStmt | test.rs:258:12:258:28 | PathExpr | | -| test.rs:258:9:260:9 | IfExpr | test.rs:261:9:261:24 | ExprStmt | | -| test.rs:258:12:258:28 | PathExpr | test.rs:258:12:258:30 | CallExpr | | -| test.rs:258:12:258:30 | CallExpr | test.rs:258:9:260:9 | IfExpr | false | -| test.rs:258:12:258:30 | CallExpr | test.rs:259:13:259:27 | ExprStmt | true | -| test.rs:259:13:259:26 | BreakExpr | test.rs:251:1:264:1 | exit labelled_block (normal) | break('block) | -| test.rs:259:13:259:27 | ExprStmt | test.rs:259:26:259:26 | 2 | | -| test.rs:259:26:259:26 | 2 | test.rs:259:13:259:26 | BreakExpr | | -| test.rs:261:9:261:21 | PathExpr | test.rs:261:9:261:23 | CallExpr | | -| test.rs:261:9:261:23 | CallExpr | test.rs:262:9:262:9 | 3 | | -| test.rs:261:9:261:24 | ExprStmt | test.rs:261:9:261:21 | PathExpr | | -| test.rs:262:9:262:9 | 3 | test.rs:252:18:263:5 | BlockExpr | | +| test.rs:75:1:78:1 | enter test_nested_function | test.rs:76:5:76:28 | LetStmt | | +| test.rs:75:1:78:1 | exit test_nested_function (normal) | test.rs:75:1:78:1 | exit test_nested_function | | +| test.rs:75:40:78:1 | BlockExpr | test.rs:75:1:78:1 | exit test_nested_function (normal) | | +| test.rs:76:5:76:28 | LetStmt | test.rs:76:19:76:27 | ClosureExpr | | +| test.rs:76:9:76:15 | add_one | test.rs:77:5:77:11 | add_one | match, no-match | +| test.rs:76:19:76:27 | ClosureExpr | test.rs:76:9:76:15 | add_one | | +| test.rs:76:19:76:27 | enter ClosureExpr | test.rs:76:23:76:23 | i | | +| test.rs:76:19:76:27 | exit ClosureExpr (normal) | test.rs:76:19:76:27 | exit ClosureExpr | | +| test.rs:76:23:76:23 | i | test.rs:76:27:76:27 | 1 | | +| test.rs:76:23:76:27 | ... + ... | test.rs:76:19:76:27 | exit ClosureExpr (normal) | | +| test.rs:76:27:76:27 | 1 | test.rs:76:23:76:27 | ... + ... | | +| test.rs:77:5:77:11 | add_one | test.rs:77:13:77:19 | add_one | | +| test.rs:77:5:77:23 | CallExpr | test.rs:75:40:78:1 | BlockExpr | | +| test.rs:77:13:77:19 | add_one | test.rs:77:21:77:21 | n | | +| test.rs:77:13:77:22 | CallExpr | test.rs:77:5:77:23 | CallExpr | | +| test.rs:77:21:77:21 | n | test.rs:77:13:77:22 | CallExpr | | +| test.rs:82:5:88:5 | enter test_if_else | test.rs:83:12:83:12 | n | | +| test.rs:82:5:88:5 | exit test_if_else (normal) | test.rs:82:5:88:5 | exit test_if_else | | +| test.rs:82:36:88:5 | BlockExpr | test.rs:82:5:88:5 | exit test_if_else (normal) | | +| test.rs:83:9:87:9 | IfExpr | test.rs:82:36:88:5 | BlockExpr | | +| test.rs:83:12:83:12 | n | test.rs:83:17:83:17 | 0 | | +| test.rs:83:12:83:17 | ... <= ... | test.rs:84:13:84:13 | 0 | true | +| test.rs:83:12:83:17 | ... <= ... | test.rs:86:13:86:13 | n | false | +| test.rs:83:17:83:17 | 0 | test.rs:83:12:83:17 | ... <= ... | | +| test.rs:83:19:85:9 | BlockExpr | test.rs:83:9:87:9 | IfExpr | | +| test.rs:84:13:84:13 | 0 | test.rs:83:19:85:9 | BlockExpr | | +| test.rs:85:16:87:9 | BlockExpr | test.rs:83:9:87:9 | IfExpr | | +| test.rs:86:13:86:13 | n | test.rs:86:17:86:17 | 1 | | +| test.rs:86:13:86:17 | ... - ... | test.rs:85:16:87:9 | BlockExpr | | +| test.rs:86:17:86:17 | 1 | test.rs:86:13:86:17 | ... - ... | | +| test.rs:90:5:96:5 | enter test_if_let_else | test.rs:91:12:91:26 | LetExpr | | +| test.rs:90:5:96:5 | exit test_if_let_else (normal) | test.rs:90:5:96:5 | exit test_if_let_else | | +| test.rs:90:48:96:5 | BlockExpr | test.rs:90:5:96:5 | exit test_if_let_else (normal) | | +| test.rs:91:9:95:9 | IfExpr | test.rs:90:48:96:5 | BlockExpr | | +| test.rs:91:12:91:26 | LetExpr | test.rs:91:16:91:22 | TupleStructPat | | +| test.rs:91:16:91:22 | TupleStructPat | test.rs:92:13:92:13 | n | match | +| test.rs:91:16:91:22 | TupleStructPat | test.rs:94:13:94:13 | 0 | no-match | +| test.rs:91:28:93:9 | BlockExpr | test.rs:91:9:95:9 | IfExpr | | +| test.rs:92:13:92:13 | n | test.rs:91:28:93:9 | BlockExpr | | +| test.rs:93:16:95:9 | BlockExpr | test.rs:91:9:95:9 | IfExpr | | +| test.rs:94:13:94:13 | 0 | test.rs:93:16:95:9 | BlockExpr | | +| test.rs:98:5:103:5 | enter test_if_let | test.rs:99:9:101:9 | ExprStmt | | +| test.rs:98:5:103:5 | exit test_if_let (normal) | test.rs:98:5:103:5 | exit test_if_let | | +| test.rs:98:43:103:5 | BlockExpr | test.rs:98:5:103:5 | exit test_if_let (normal) | | +| test.rs:99:9:101:9 | ExprStmt | test.rs:99:12:99:26 | LetExpr | | +| test.rs:99:9:101:9 | IfExpr | test.rs:102:9:102:9 | 0 | | +| test.rs:99:12:99:26 | LetExpr | test.rs:99:16:99:22 | TupleStructPat | | +| test.rs:99:16:99:22 | TupleStructPat | test.rs:99:9:101:9 | IfExpr | no-match | +| test.rs:99:16:99:22 | TupleStructPat | test.rs:100:13:100:13 | n | match | +| test.rs:99:28:101:9 | BlockExpr | test.rs:99:9:101:9 | IfExpr | | +| test.rs:100:13:100:13 | n | test.rs:99:28:101:9 | BlockExpr | | +| test.rs:102:9:102:9 | 0 | test.rs:98:43:103:5 | BlockExpr | | +| test.rs:105:5:111:5 | enter test_nested_if | test.rs:106:16:106:16 | PathExpr | | +| test.rs:105:5:111:5 | exit test_nested_if (normal) | test.rs:105:5:111:5 | exit test_nested_if | | +| test.rs:105:38:111:5 | BlockExpr | test.rs:105:5:111:5 | exit test_nested_if (normal) | | +| test.rs:106:9:110:9 | IfExpr | test.rs:105:38:111:5 | BlockExpr | | +| test.rs:106:12:106:49 | ParenExpr | test.rs:107:13:107:13 | 1 | true | +| test.rs:106:12:106:49 | ParenExpr | test.rs:109:13:109:13 | 0 | false | +| test.rs:106:13:106:48 | IfExpr | test.rs:106:12:106:49 | ParenExpr | | +| test.rs:106:16:106:16 | PathExpr | test.rs:106:20:106:20 | 0 | | +| test.rs:106:16:106:20 | ... < ... | test.rs:106:24:106:24 | a | true | +| test.rs:106:16:106:20 | ... < ... | test.rs:106:41:106:41 | a | false | +| test.rs:106:20:106:20 | 0 | test.rs:106:16:106:20 | ... < ... | | +| test.rs:106:22:106:32 | BlockExpr | test.rs:106:13:106:48 | IfExpr | | +| test.rs:106:24:106:24 | a | test.rs:106:29:106:30 | 10 | | +| test.rs:106:24:106:30 | ... < ... | test.rs:106:22:106:32 | BlockExpr | | +| test.rs:106:28:106:30 | - ... | test.rs:106:24:106:30 | ... < ... | | +| test.rs:106:29:106:30 | 10 | test.rs:106:28:106:30 | - ... | | +| test.rs:106:39:106:48 | BlockExpr | test.rs:106:13:106:48 | IfExpr | | +| test.rs:106:41:106:41 | a | test.rs:106:45:106:46 | 10 | | +| test.rs:106:41:106:46 | ... > ... | test.rs:106:39:106:48 | BlockExpr | | +| test.rs:106:45:106:46 | 10 | test.rs:106:41:106:46 | ... > ... | | +| test.rs:106:51:108:9 | BlockExpr | test.rs:106:9:110:9 | IfExpr | | +| test.rs:107:13:107:13 | 1 | test.rs:106:51:108:9 | BlockExpr | | +| test.rs:108:16:110:9 | BlockExpr | test.rs:106:9:110:9 | IfExpr | | +| test.rs:109:13:109:13 | 0 | test.rs:108:16:110:9 | BlockExpr | | +| test.rs:113:5:122:5 | enter test_nested_if_match | test.rs:114:19:114:19 | a | | +| test.rs:113:5:122:5 | exit test_nested_if_match (normal) | test.rs:113:5:122:5 | exit test_nested_if_match | | +| test.rs:113:44:122:5 | BlockExpr | test.rs:113:5:122:5 | exit test_nested_if_match (normal) | | +| test.rs:114:9:121:9 | IfExpr | test.rs:113:44:122:5 | BlockExpr | | +| test.rs:114:12:117:10 | ParenExpr | test.rs:118:13:118:13 | 1 | true | +| test.rs:114:12:117:10 | ParenExpr | test.rs:120:13:120:13 | 0 | false | +| test.rs:114:13:117:9 | MatchExpr | test.rs:114:12:117:10 | ParenExpr | | +| test.rs:114:19:114:19 | a | test.rs:115:13:115:13 | LiteralPat | | +| test.rs:115:13:115:13 | LiteralPat | test.rs:115:18:115:21 | true | match | +| test.rs:115:13:115:13 | LiteralPat | test.rs:116:13:116:13 | WildcardPat | no-match | +| test.rs:115:18:115:21 | true | test.rs:114:13:117:9 | MatchExpr | | +| test.rs:116:13:116:13 | WildcardPat | test.rs:116:18:116:22 | false | match | +| test.rs:116:18:116:22 | false | test.rs:114:13:117:9 | MatchExpr | | +| test.rs:117:12:119:9 | BlockExpr | test.rs:114:9:121:9 | IfExpr | | +| test.rs:118:13:118:13 | 1 | test.rs:117:12:119:9 | BlockExpr | | +| test.rs:119:16:121:9 | BlockExpr | test.rs:114:9:121:9 | IfExpr | | +| test.rs:120:13:120:13 | 0 | test.rs:119:16:121:9 | BlockExpr | | +| test.rs:124:5:133:5 | enter test_nested_if_block | test.rs:126:13:126:15 | ExprStmt | | +| test.rs:124:5:133:5 | exit test_nested_if_block (normal) | test.rs:124:5:133:5 | exit test_nested_if_block | | +| test.rs:124:44:133:5 | BlockExpr | test.rs:124:5:133:5 | exit test_nested_if_block (normal) | | +| test.rs:125:9:132:9 | IfExpr | test.rs:124:44:133:5 | BlockExpr | | +| test.rs:125:12:128:9 | BlockExpr | test.rs:129:13:129:13 | 1 | true | +| test.rs:125:12:128:9 | BlockExpr | test.rs:131:13:131:13 | 0 | false | +| test.rs:126:13:126:14 | TupleExpr | test.rs:127:13:127:13 | a | | +| test.rs:126:13:126:15 | ExprStmt | test.rs:126:13:126:14 | TupleExpr | | +| test.rs:127:13:127:13 | a | test.rs:127:17:127:17 | 0 | | +| test.rs:127:13:127:17 | ... > ... | test.rs:125:12:128:9 | BlockExpr | false, true | +| test.rs:127:17:127:17 | 0 | test.rs:127:13:127:17 | ... > ... | | +| test.rs:128:11:130:9 | BlockExpr | test.rs:125:9:132:9 | IfExpr | | +| test.rs:129:13:129:13 | 1 | test.rs:128:11:130:9 | BlockExpr | | +| test.rs:130:16:132:9 | BlockExpr | test.rs:125:9:132:9 | IfExpr | | +| test.rs:131:13:131:13 | 0 | test.rs:130:16:132:9 | BlockExpr | | +| test.rs:135:5:142:5 | enter test_if_assignment | test.rs:136:9:136:26 | LetStmt | | +| test.rs:135:5:142:5 | exit test_if_assignment (normal) | test.rs:135:5:142:5 | exit test_if_assignment | | +| test.rs:135:42:142:5 | BlockExpr | test.rs:135:5:142:5 | exit test_if_assignment (normal) | | +| test.rs:136:9:136:26 | LetStmt | test.rs:136:21:136:25 | false | | +| test.rs:136:13:136:17 | x | test.rs:137:12:137:12 | x | match, no-match | +| test.rs:136:21:136:25 | false | test.rs:136:13:136:17 | x | | +| test.rs:137:9:141:9 | IfExpr | test.rs:135:42:142:5 | BlockExpr | | +| test.rs:137:12:137:12 | x | test.rs:137:16:137:19 | true | | +| test.rs:137:12:137:19 | ... = ... | test.rs:138:13:138:13 | 1 | true | +| test.rs:137:12:137:19 | ... = ... | test.rs:140:13:140:13 | 0 | false | +| test.rs:137:16:137:19 | true | test.rs:137:12:137:19 | ... = ... | | +| test.rs:137:21:139:9 | BlockExpr | test.rs:137:9:141:9 | IfExpr | | +| test.rs:138:13:138:13 | 1 | test.rs:137:21:139:9 | BlockExpr | | +| test.rs:139:16:141:9 | BlockExpr | test.rs:137:9:141:9 | IfExpr | | +| test.rs:140:13:140:13 | 0 | test.rs:139:16:141:9 | BlockExpr | | +| test.rs:144:5:155:5 | enter test_if_loop1 | test.rs:146:13:148:14 | ExprStmt | | +| test.rs:144:5:155:5 | exit test_if_loop1 (normal) | test.rs:144:5:155:5 | exit test_if_loop1 | | +| test.rs:144:37:155:5 | BlockExpr | test.rs:144:5:155:5 | exit test_if_loop1 (normal) | | +| test.rs:145:9:154:9 | IfExpr | test.rs:144:37:155:5 | BlockExpr | | +| test.rs:145:12:150:10 | ParenExpr | test.rs:151:13:151:13 | 1 | true | +| test.rs:145:12:150:10 | ParenExpr | test.rs:153:13:153:13 | 0 | false | +| test.rs:145:13:150:9 | LoopExpr | test.rs:145:12:150:10 | ParenExpr | | +| test.rs:145:18:150:9 | BlockExpr | test.rs:146:13:148:14 | ExprStmt | | +| test.rs:146:13:148:13 | IfExpr | test.rs:149:13:149:19 | ExprStmt | | +| test.rs:146:13:148:14 | ExprStmt | test.rs:146:16:146:16 | a | | +| test.rs:146:16:146:16 | a | test.rs:146:20:146:20 | 0 | | +| test.rs:146:16:146:20 | ... > ... | test.rs:146:13:148:13 | IfExpr | false | +| test.rs:146:16:146:20 | ... > ... | test.rs:147:17:147:29 | ExprStmt | true | +| test.rs:146:20:146:20 | 0 | test.rs:146:16:146:20 | ... > ... | | +| test.rs:147:17:147:28 | BreakExpr | test.rs:145:13:150:9 | LoopExpr | break | +| test.rs:147:17:147:29 | ExprStmt | test.rs:147:23:147:23 | a | | +| test.rs:147:23:147:23 | a | test.rs:147:27:147:28 | 10 | | +| test.rs:147:23:147:28 | ... > ... | test.rs:147:17:147:28 | BreakExpr | | +| test.rs:147:27:147:28 | 10 | test.rs:147:23:147:28 | ... > ... | | +| test.rs:149:13:149:13 | a | test.rs:149:17:149:18 | 10 | | +| test.rs:149:13:149:18 | ... < ... | test.rs:145:18:150:9 | BlockExpr | | +| test.rs:149:13:149:19 | ExprStmt | test.rs:149:13:149:13 | a | | +| test.rs:149:17:149:18 | 10 | test.rs:149:13:149:18 | ... < ... | | +| test.rs:150:12:152:9 | BlockExpr | test.rs:145:9:154:9 | IfExpr | | +| test.rs:151:13:151:13 | 1 | test.rs:150:12:152:9 | BlockExpr | | +| test.rs:152:16:154:9 | BlockExpr | test.rs:145:9:154:9 | IfExpr | | +| test.rs:153:13:153:13 | 0 | test.rs:152:16:154:9 | BlockExpr | | +| test.rs:157:5:168:5 | enter test_if_loop2 | test.rs:159:13:161:14 | ExprStmt | | +| test.rs:157:5:168:5 | exit test_if_loop2 (normal) | test.rs:157:5:168:5 | exit test_if_loop2 | | +| test.rs:157:37:168:5 | BlockExpr | test.rs:157:5:168:5 | exit test_if_loop2 (normal) | | +| test.rs:158:9:167:9 | IfExpr | test.rs:157:37:168:5 | BlockExpr | | +| test.rs:158:12:163:10 | ParenExpr | test.rs:164:13:164:13 | 1 | true | +| test.rs:158:12:163:10 | ParenExpr | test.rs:166:13:166:13 | 0 | false | +| test.rs:158:13:163:9 | LoopExpr | test.rs:158:12:163:10 | ParenExpr | | +| test.rs:158:26:163:9 | BlockExpr | test.rs:159:13:161:14 | ExprStmt | | +| test.rs:159:13:161:13 | IfExpr | test.rs:162:13:162:19 | ExprStmt | | +| test.rs:159:13:161:14 | ExprStmt | test.rs:159:16:159:16 | a | | +| test.rs:159:16:159:16 | a | test.rs:159:20:159:20 | 0 | | +| test.rs:159:16:159:20 | ... > ... | test.rs:159:13:161:13 | IfExpr | false | +| test.rs:159:16:159:20 | ... > ... | test.rs:160:17:160:36 | ExprStmt | true | +| test.rs:159:20:159:20 | 0 | test.rs:159:16:159:20 | ... > ... | | +| test.rs:160:17:160:35 | BreakExpr | test.rs:158:13:163:9 | LoopExpr | break('label) | +| test.rs:160:17:160:36 | ExprStmt | test.rs:160:30:160:30 | a | | +| test.rs:160:30:160:30 | a | test.rs:160:34:160:35 | 10 | | +| test.rs:160:30:160:35 | ... > ... | test.rs:160:17:160:35 | BreakExpr | | +| test.rs:160:34:160:35 | 10 | test.rs:160:30:160:35 | ... > ... | | +| test.rs:162:13:162:13 | a | test.rs:162:17:162:18 | 10 | | +| test.rs:162:13:162:18 | ... < ... | test.rs:158:26:163:9 | BlockExpr | | +| test.rs:162:13:162:19 | ExprStmt | test.rs:162:13:162:13 | a | | +| test.rs:162:17:162:18 | 10 | test.rs:162:13:162:18 | ... < ... | | +| test.rs:163:12:165:9 | BlockExpr | test.rs:158:9:167:9 | IfExpr | | +| test.rs:164:13:164:13 | 1 | test.rs:163:12:165:9 | BlockExpr | | +| test.rs:165:16:167:9 | BlockExpr | test.rs:158:9:167:9 | IfExpr | | +| test.rs:166:13:166:13 | 0 | test.rs:165:16:167:9 | BlockExpr | | +| test.rs:170:5:178:5 | enter test_labelled_block | test.rs:172:13:172:31 | ExprStmt | | +| test.rs:170:5:178:5 | exit test_labelled_block (normal) | test.rs:170:5:178:5 | exit test_labelled_block | | +| test.rs:172:13:172:30 | BreakExpr | test.rs:170:5:178:5 | exit test_labelled_block (normal) | break('block) | +| test.rs:172:13:172:31 | ExprStmt | test.rs:172:26:172:26 | a | | +| test.rs:172:26:172:26 | a | test.rs:172:30:172:30 | 0 | | +| test.rs:172:26:172:30 | ... > ... | test.rs:172:13:172:30 | BreakExpr | | +| test.rs:172:30:172:30 | 0 | test.rs:172:26:172:30 | ... > ... | | +| test.rs:183:5:186:5 | enter test_and_operator | test.rs:184:9:184:28 | LetStmt | | +| test.rs:183:5:186:5 | exit test_and_operator (normal) | test.rs:183:5:186:5 | exit test_and_operator | | +| test.rs:183:61:186:5 | BlockExpr | test.rs:183:5:186:5 | exit test_and_operator (normal) | | +| test.rs:184:9:184:28 | LetStmt | test.rs:184:17:184:27 | ... && ... | | +| test.rs:184:13:184:13 | d | test.rs:185:9:185:9 | d | match, no-match | +| test.rs:184:17:184:17 | a | test.rs:184:13:184:13 | d | false | +| test.rs:184:17:184:17 | a | test.rs:184:22:184:22 | b | true | +| test.rs:184:17:184:22 | ... && ... | test.rs:184:17:184:17 | a | | +| test.rs:184:17:184:27 | ... && ... | test.rs:184:17:184:22 | ... && ... | | +| test.rs:184:22:184:22 | b | test.rs:184:13:184:13 | d | false | +| test.rs:184:22:184:22 | b | test.rs:184:27:184:27 | c | true | +| test.rs:184:27:184:27 | c | test.rs:184:13:184:13 | d | | +| test.rs:185:9:185:9 | d | test.rs:183:61:186:5 | BlockExpr | | +| test.rs:188:5:191:5 | enter test_or_operator | test.rs:189:9:189:28 | LetStmt | | +| test.rs:188:5:191:5 | exit test_or_operator (normal) | test.rs:188:5:191:5 | exit test_or_operator | | +| test.rs:188:60:191:5 | BlockExpr | test.rs:188:5:191:5 | exit test_or_operator (normal) | | +| test.rs:189:9:189:28 | LetStmt | test.rs:189:17:189:27 | ... \|\| ... | | +| test.rs:189:13:189:13 | d | test.rs:190:9:190:9 | d | match, no-match | +| test.rs:189:17:189:17 | a | test.rs:189:13:189:13 | d | true | +| test.rs:189:17:189:17 | a | test.rs:189:22:189:22 | b | false | +| test.rs:189:17:189:22 | ... \|\| ... | test.rs:189:17:189:17 | a | | +| test.rs:189:17:189:27 | ... \|\| ... | test.rs:189:17:189:22 | ... \|\| ... | | +| test.rs:189:22:189:22 | b | test.rs:189:13:189:13 | d | true | +| test.rs:189:22:189:22 | b | test.rs:189:27:189:27 | c | false | +| test.rs:189:27:189:27 | c | test.rs:189:13:189:13 | d | | +| test.rs:190:9:190:9 | d | test.rs:188:60:191:5 | BlockExpr | | +| test.rs:193:5:196:5 | enter test_or_operator_2 | test.rs:194:9:194:36 | LetStmt | | +| test.rs:193:5:196:5 | exit test_or_operator_2 (normal) | test.rs:193:5:196:5 | exit test_or_operator_2 | | +| test.rs:193:61:196:5 | BlockExpr | test.rs:193:5:196:5 | exit test_or_operator_2 (normal) | | +| test.rs:194:9:194:36 | LetStmt | test.rs:194:17:194:35 | ... \|\| ... | | +| test.rs:194:13:194:13 | d | test.rs:195:9:195:9 | d | match, no-match | +| test.rs:194:17:194:17 | a | test.rs:194:13:194:13 | d | true | +| test.rs:194:17:194:17 | a | test.rs:194:23:194:23 | b | false | +| test.rs:194:17:194:30 | ... \|\| ... | test.rs:194:17:194:17 | a | | +| test.rs:194:17:194:35 | ... \|\| ... | test.rs:194:17:194:30 | ... \|\| ... | | +| test.rs:194:22:194:30 | ParenExpr | test.rs:194:13:194:13 | d | true | +| test.rs:194:22:194:30 | ParenExpr | test.rs:194:35:194:35 | c | false | +| test.rs:194:23:194:23 | b | test.rs:194:28:194:29 | 28 | | +| test.rs:194:23:194:29 | ... == ... | test.rs:194:22:194:30 | ParenExpr | | +| test.rs:194:28:194:29 | 28 | test.rs:194:23:194:29 | ... == ... | | +| test.rs:194:35:194:35 | c | test.rs:194:13:194:13 | d | | +| test.rs:195:9:195:9 | d | test.rs:193:61:196:5 | BlockExpr | | +| test.rs:198:5:201:5 | enter test_not_operator | test.rs:199:9:199:19 | LetStmt | | +| test.rs:198:5:201:5 | exit test_not_operator (normal) | test.rs:198:5:201:5 | exit test_not_operator | | +| test.rs:198:43:201:5 | BlockExpr | test.rs:198:5:201:5 | exit test_not_operator (normal) | | +| test.rs:199:9:199:19 | LetStmt | test.rs:199:18:199:18 | a | | +| test.rs:199:13:199:13 | d | test.rs:200:9:200:9 | d | match, no-match | +| test.rs:199:17:199:18 | ! ... | test.rs:199:13:199:13 | d | | +| test.rs:199:18:199:18 | a | test.rs:199:17:199:18 | ! ... | | +| test.rs:200:9:200:9 | d | test.rs:198:43:201:5 | BlockExpr | | +| test.rs:203:5:209:5 | enter test_if_and_operator | test.rs:204:12:204:22 | ... && ... | | +| test.rs:203:5:209:5 | exit test_if_and_operator (normal) | test.rs:203:5:209:5 | exit test_if_and_operator | | +| test.rs:203:63:209:5 | BlockExpr | test.rs:203:5:209:5 | exit test_if_and_operator (normal) | | +| test.rs:204:9:208:9 | IfExpr | test.rs:203:63:209:5 | BlockExpr | | +| test.rs:204:12:204:12 | a | test.rs:204:17:204:17 | b | true | +| test.rs:204:12:204:12 | a | test.rs:207:13:207:17 | false | false | +| test.rs:204:12:204:17 | ... && ... | test.rs:204:12:204:12 | a | | +| test.rs:204:12:204:22 | ... && ... | test.rs:204:12:204:17 | ... && ... | | +| test.rs:204:17:204:17 | b | test.rs:204:22:204:22 | c | true | +| test.rs:204:17:204:17 | b | test.rs:207:13:207:17 | false | false | +| test.rs:204:22:204:22 | c | test.rs:205:13:205:16 | true | true | +| test.rs:204:22:204:22 | c | test.rs:207:13:207:17 | false | false | +| test.rs:204:24:206:9 | BlockExpr | test.rs:204:9:208:9 | IfExpr | | +| test.rs:205:13:205:16 | true | test.rs:204:24:206:9 | BlockExpr | | +| test.rs:206:16:208:9 | BlockExpr | test.rs:204:9:208:9 | IfExpr | | +| test.rs:207:13:207:17 | false | test.rs:206:16:208:9 | BlockExpr | | +| test.rs:211:5:217:5 | enter test_if_or_operator | test.rs:212:12:212:22 | ... \|\| ... | | +| test.rs:211:5:217:5 | exit test_if_or_operator (normal) | test.rs:211:5:217:5 | exit test_if_or_operator | | +| test.rs:211:62:217:5 | BlockExpr | test.rs:211:5:217:5 | exit test_if_or_operator (normal) | | +| test.rs:212:9:216:9 | IfExpr | test.rs:211:62:217:5 | BlockExpr | | +| test.rs:212:12:212:12 | a | test.rs:212:17:212:17 | b | false | +| test.rs:212:12:212:12 | a | test.rs:213:13:213:16 | true | true | +| test.rs:212:12:212:17 | ... \|\| ... | test.rs:212:12:212:12 | a | | +| test.rs:212:12:212:22 | ... \|\| ... | test.rs:212:12:212:17 | ... \|\| ... | | +| test.rs:212:17:212:17 | b | test.rs:212:22:212:22 | c | false | +| test.rs:212:17:212:17 | b | test.rs:213:13:213:16 | true | true | +| test.rs:212:22:212:22 | c | test.rs:213:13:213:16 | true | true | +| test.rs:212:22:212:22 | c | test.rs:215:13:215:17 | false | false | +| test.rs:212:24:214:9 | BlockExpr | test.rs:212:9:216:9 | IfExpr | | +| test.rs:213:13:213:16 | true | test.rs:212:24:214:9 | BlockExpr | | +| test.rs:214:16:216:9 | BlockExpr | test.rs:212:9:216:9 | IfExpr | | +| test.rs:215:13:215:17 | false | test.rs:214:16:216:9 | BlockExpr | | +| test.rs:219:5:225:5 | enter test_if_not_operator | test.rs:220:13:220:13 | a | | +| test.rs:219:5:225:5 | exit test_if_not_operator (normal) | test.rs:219:5:225:5 | exit test_if_not_operator | | +| test.rs:219:46:225:5 | BlockExpr | test.rs:219:5:225:5 | exit test_if_not_operator (normal) | | +| test.rs:220:9:224:9 | IfExpr | test.rs:219:46:225:5 | BlockExpr | | +| test.rs:220:12:220:13 | ! ... | test.rs:221:13:221:16 | true | true | +| test.rs:220:12:220:13 | ! ... | test.rs:223:13:223:17 | false | false | +| test.rs:220:13:220:13 | a | test.rs:220:12:220:13 | ! ... | false, true | +| test.rs:220:15:222:9 | BlockExpr | test.rs:220:9:224:9 | IfExpr | | +| test.rs:221:13:221:16 | true | test.rs:220:15:222:9 | BlockExpr | | +| test.rs:222:16:224:9 | BlockExpr | test.rs:220:9:224:9 | IfExpr | | +| test.rs:223:13:223:17 | false | test.rs:222:16:224:9 | BlockExpr | | +| test.rs:228:1:234:1 | enter test_match | test.rs:229:11:229:21 | maybe_digit | | +| test.rs:228:1:234:1 | exit test_match (normal) | test.rs:228:1:234:1 | exit test_match | | +| test.rs:228:48:234:1 | BlockExpr | test.rs:228:1:234:1 | exit test_match (normal) | | +| test.rs:229:5:233:5 | MatchExpr | test.rs:228:48:234:1 | BlockExpr | | +| test.rs:229:11:229:21 | maybe_digit | test.rs:230:9:230:23 | TupleStructPat | | +| test.rs:230:9:230:23 | TupleStructPat | test.rs:230:28:230:28 | x | match | +| test.rs:230:9:230:23 | TupleStructPat | test.rs:231:9:231:23 | TupleStructPat | no-match | +| test.rs:230:28:230:28 | x | test.rs:230:32:230:33 | 10 | | +| test.rs:230:32:230:33 | 10 | test.rs:230:28:230:33 | ... < ... | | +| test.rs:231:9:231:23 | TupleStructPat | test.rs:231:28:231:28 | x | match | +| test.rs:231:9:231:23 | TupleStructPat | test.rs:232:9:232:20 | PathPat | no-match | +| test.rs:231:28:231:28 | x | test.rs:229:5:233:5 | MatchExpr | | +| test.rs:232:9:232:20 | PathPat | test.rs:232:25:232:25 | 5 | match | +| test.rs:232:25:232:25 | 5 | test.rs:229:5:233:5 | MatchExpr | | +| test.rs:237:5:242:5 | enter test_infinite_loop | test.rs:238:9:240:9 | ExprStmt | | +| test.rs:238:9:240:9 | ExprStmt | test.rs:239:13:239:13 | 1 | | +| test.rs:238:14:240:9 | BlockExpr | test.rs:239:13:239:13 | 1 | | +| test.rs:239:13:239:13 | 1 | test.rs:238:14:240:9 | BlockExpr | | +| test.rs:244:5:247:5 | enter test_let_match | test.rs:245:9:245:49 | LetStmt | | +| test.rs:244:5:247:5 | exit test_let_match (normal) | test.rs:244:5:247:5 | exit test_let_match | | +| test.rs:244:39:247:5 | BlockExpr | test.rs:244:5:247:5 | exit test_let_match (normal) | | +| test.rs:245:9:245:49 | LetStmt | test.rs:245:23:245:23 | a | | +| test.rs:245:13:245:19 | TupleStructPat | test.rs:245:32:245:46 | "Expected some" | no-match | +| test.rs:245:13:245:19 | TupleStructPat | test.rs:246:9:246:9 | n | match | +| test.rs:245:23:245:23 | a | test.rs:245:13:245:19 | TupleStructPat | | +| test.rs:245:32:245:46 | "Expected some" | test.rs:245:30:245:48 | BlockExpr | | +| test.rs:246:9:246:9 | n | test.rs:244:39:247:5 | BlockExpr | | +| test.rs:250:1:255:1 | enter dead_code | test.rs:251:5:253:5 | ExprStmt | | +| test.rs:250:1:255:1 | exit dead_code (normal) | test.rs:250:1:255:1 | exit dead_code | | +| test.rs:251:5:253:5 | ExprStmt | test.rs:251:9:251:12 | true | | +| test.rs:251:8:251:13 | ParenExpr | test.rs:252:9:252:17 | ExprStmt | true | +| test.rs:251:9:251:12 | true | test.rs:251:8:251:13 | ParenExpr | | +| test.rs:252:9:252:16 | ReturnExpr | test.rs:250:1:255:1 | exit dead_code (normal) | return | +| test.rs:252:9:252:17 | ExprStmt | test.rs:252:16:252:16 | 0 | | +| test.rs:252:16:252:16 | 0 | test.rs:252:9:252:16 | ReturnExpr | | +| test.rs:257:1:270:1 | enter labelled_block | test.rs:258:5:269:6 | LetStmt | | +| test.rs:257:1:270:1 | exit labelled_block (normal) | test.rs:257:1:270:1 | exit labelled_block | | +| test.rs:257:28:270:1 | BlockExpr | test.rs:257:1:270:1 | exit labelled_block (normal) | | +| test.rs:258:5:269:6 | LetStmt | test.rs:259:9:259:19 | ExprStmt | | +| test.rs:258:9:258:14 | result | test.rs:257:28:270:1 | BlockExpr | match, no-match | +| test.rs:258:18:269:5 | BlockExpr | test.rs:258:9:258:14 | result | | +| test.rs:259:9:259:16 | PathExpr | test.rs:259:9:259:18 | CallExpr | | +| test.rs:259:9:259:18 | CallExpr | test.rs:260:9:262:9 | ExprStmt | | +| test.rs:259:9:259:19 | ExprStmt | test.rs:259:9:259:16 | PathExpr | | +| test.rs:260:9:262:9 | ExprStmt | test.rs:260:12:260:28 | PathExpr | | +| test.rs:260:9:262:9 | IfExpr | test.rs:263:9:263:24 | ExprStmt | | +| test.rs:260:12:260:28 | PathExpr | test.rs:260:12:260:30 | CallExpr | | +| test.rs:260:12:260:30 | CallExpr | test.rs:260:9:262:9 | IfExpr | false | +| test.rs:260:12:260:30 | CallExpr | test.rs:261:13:261:27 | ExprStmt | true | +| test.rs:261:13:261:26 | BreakExpr | test.rs:257:1:270:1 | exit labelled_block (normal) | break('block) | +| test.rs:261:13:261:27 | ExprStmt | test.rs:261:26:261:26 | 1 | | +| test.rs:261:26:261:26 | 1 | test.rs:261:13:261:26 | BreakExpr | | +| test.rs:263:9:263:21 | PathExpr | test.rs:263:9:263:23 | CallExpr | | +| test.rs:263:9:263:23 | CallExpr | test.rs:264:9:266:9 | ExprStmt | | +| test.rs:263:9:263:24 | ExprStmt | test.rs:263:9:263:21 | PathExpr | | +| test.rs:264:9:266:9 | ExprStmt | test.rs:264:12:264:28 | PathExpr | | +| test.rs:264:9:266:9 | IfExpr | test.rs:267:9:267:24 | ExprStmt | | +| test.rs:264:12:264:28 | PathExpr | test.rs:264:12:264:30 | CallExpr | | +| test.rs:264:12:264:30 | CallExpr | test.rs:264:9:266:9 | IfExpr | false | +| test.rs:264:12:264:30 | CallExpr | test.rs:265:13:265:27 | ExprStmt | true | +| test.rs:265:13:265:26 | BreakExpr | test.rs:257:1:270:1 | exit labelled_block (normal) | break('block) | +| test.rs:265:13:265:27 | ExprStmt | test.rs:265:26:265:26 | 2 | | +| test.rs:265:26:265:26 | 2 | test.rs:265:13:265:26 | BreakExpr | | +| test.rs:267:9:267:21 | PathExpr | test.rs:267:9:267:23 | CallExpr | | +| test.rs:267:9:267:23 | CallExpr | test.rs:268:9:268:9 | 3 | | +| test.rs:267:9:267:24 | ExprStmt | test.rs:267:9:267:21 | PathExpr | | +| test.rs:268:9:268:9 | 3 | test.rs:258:18:269:5 | BlockExpr | | diff --git a/rust/ql/test/library-tests/controlflow/test.rs b/rust/ql/test/library-tests/controlflow/test.rs index 220241832186..dd1659ee997b 100644 --- a/rust/ql/test/library-tests/controlflow/test.rs +++ b/rust/ql/test/library-tests/controlflow/test.rs @@ -51,16 +51,22 @@ mod loop_expression { } } - fn test_while() { + fn test_while(i: i64) { let mut b = true; while b { 1; + if (i > 0) { + break; + } b = false; } } - fn test_for() { + fn test_for(j: i64) { for i in 0..10 { + if (i == j) { + break; + } 1; } } From f3e373442442c544193f960b86ebfa0f08dbdf5f Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Mon, 30 Sep 2024 16:58:44 +0200 Subject: [PATCH 28/79] Rust: Implement CFG for `WhileExpr`s --- .../rust/controlflow/internal/Completion.qll | 2 + .../internal/ControlFlowGraphImpl.qll | 63 +++++++++++++++---- .../CONSISTENCY/CfgConsistency.expected | 1 - .../library-tests/controlflow/Cfg.expected | 22 +++++++ 4 files changed, 74 insertions(+), 14 deletions(-) diff --git a/rust/ql/lib/codeql/rust/controlflow/internal/Completion.qll b/rust/ql/lib/codeql/rust/controlflow/internal/Completion.qll index 7e51f62a535b..e9c5d95f910c 100644 --- a/rust/ql/lib/codeql/rust/controlflow/internal/Completion.qll +++ b/rust/ql/lib/codeql/rust/controlflow/internal/Completion.qll @@ -84,6 +84,8 @@ class BooleanCompletion extends ConditionalCompletion, TBooleanCompletion { private predicate isValidForSpecific0(AstNode e) { e = any(IfExpr c).getCondition() or + e = any(WhileExpr c).getCondition() + or any(MatchArm arm).getGuard() = e or exists(BinaryExpr expr | diff --git a/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll b/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll index 1e4c2ec431d8..2cbf49b9e2b1 100644 --- a/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll +++ b/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll @@ -277,45 +277,82 @@ class LetStmtTree extends PreOrderTree instanceof LetStmt { class LiteralExprTree extends LeafTree instanceof LiteralExpr { } -class LoopExprTree extends PostOrderTree instanceof LoopExpr { +abstract class LoopingExprTree extends PostOrderTree { override predicate propagatesAbnormal(AstNode child) { none() } - override predicate first(AstNode node) { first(super.getLoopBody(), node) } + abstract BlockExpr getLoopBody(); - /** Whether this `LoopExpr` captures the `c` completion. */ - private predicate capturesLoopJumpCompletion(LoopJumpCompletion c) { + abstract Label getLabel(); + + /** Whether this loop captures the `c` completion. */ + predicate capturesLoopJumpCompletion(LoopJumpCompletion c) { not c.hasLabel() or - c.getLabelName() = super.getLabel().getLifetime().getText() + c.getLabelName() = this.getLabel().getLifetime().getText() } override predicate succ(AstNode pred, AstNode succ, Completion c) { + // Edge for exiting the loop with a break expressions + last(this.getLoopBody(), pred, c) and + c.(LoopJumpCompletion).isBreak() and + this.capturesLoopJumpCompletion(c) and + succ = this + or // Edge back to the start for final expression and continue expressions - last(super.getLoopBody(), pred, c) and + last(this.getLoopBody(), pred, c) and ( completionIsNormal(c) or c.(LoopJumpCompletion).isContinue() and this.capturesLoopJumpCompletion(c) ) and this.first(succ) - or - // Edge for exiting the loop with a break expressions - last(super.getLoopBody(), pred, c) and - c.(LoopJumpCompletion).isBreak() and - this.capturesLoopJumpCompletion(c) and - succ = this } override predicate last(AstNode last, Completion c) { super.last(last, c) or // Any abnormal completions that this loop does not capture should propagate - last(super.getLoopBody(), last, c) and + last(this.getLoopBody(), last, c) and not completionIsNormal(c) and not this.capturesLoopJumpCompletion(c) } } +class LoopExprTree extends LoopingExprTree instanceof LoopExpr { + override BlockExpr getLoopBody() { result = LoopExpr.super.getLoopBody() } + + override Label getLabel() { result = LoopExpr.super.getLabel() } + + override predicate first(AstNode node) { first(this.getLoopBody(), node) } +} + +class WhileExprTree extends LoopingExprTree instanceof WhileExpr { + override BlockExpr getLoopBody() { result = WhileExpr.super.getLoopBody() } + + override Label getLabel() { result = WhileExpr.super.getLabel() } + + override predicate first(AstNode node) { first(super.getCondition(), node) } + + override predicate succ(AstNode pred, AstNode succ, Completion c) { + super.succ(pred, succ, c) + or + last(super.getCondition(), pred, c) and + c.(BooleanCompletion).succeeded() and + first(this.getLoopBody(), succ) + or + last(super.getCondition(), pred, c) and + c.(BooleanCompletion).failed() and + succ = this + } + + override predicate last(AstNode last, Completion c) { + super.last(last, c) + or + last(super.getCondition(), last, c) and + not completionIsNormal(c) + } +} + class MatchArmTree extends ControlFlowTree instanceof MatchArm { override predicate propagatesAbnormal(AstNode child) { child = super.getExpr() } diff --git a/rust/ql/test/library-tests/controlflow/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/library-tests/controlflow/CONSISTENCY/CfgConsistency.expected index 49f433fff2c8..df4c34f39f73 100644 --- a/rust/ql/test/library-tests/controlflow/CONSISTENCY/CfgConsistency.expected +++ b/rust/ql/test/library-tests/controlflow/CONSISTENCY/CfgConsistency.expected @@ -1,5 +1,4 @@ deadEnd -| test.rs:55:13:55:17 | b | | test.rs:230:28:230:33 | ... < ... | | test.rs:245:30:245:48 | BlockExpr | scopeNoFirst diff --git a/rust/ql/test/library-tests/controlflow/Cfg.expected b/rust/ql/test/library-tests/controlflow/Cfg.expected index f7d5365cf182..388ebed628a2 100644 --- a/rust/ql/test/library-tests/controlflow/Cfg.expected +++ b/rust/ql/test/library-tests/controlflow/Cfg.expected @@ -98,8 +98,30 @@ | test.rs:49:17:49:31 | ContinueExpr | test.rs:44:17:48:17 | ExprStmt | continue('inner) | | test.rs:49:17:49:32 | ExprStmt | test.rs:49:17:49:31 | ContinueExpr | | | test.rs:54:5:63:5 | enter test_while | test.rs:55:9:55:25 | LetStmt | | +| test.rs:54:5:63:5 | exit test_while (normal) | test.rs:54:5:63:5 | exit test_while | | +| test.rs:54:27:63:5 | BlockExpr | test.rs:54:5:63:5 | exit test_while (normal) | | | test.rs:55:9:55:25 | LetStmt | test.rs:55:21:55:24 | true | | +| test.rs:55:13:55:17 | b | test.rs:56:15:56:15 | b | match, no-match | | test.rs:55:21:55:24 | true | test.rs:55:13:55:17 | b | | +| test.rs:56:9:62:9 | WhileExpr | test.rs:54:27:63:5 | BlockExpr | | +| test.rs:56:15:56:15 | b | test.rs:56:9:62:9 | WhileExpr | false | +| test.rs:56:15:56:15 | b | test.rs:57:13:57:14 | ExprStmt | true | +| test.rs:56:17:62:9 | BlockExpr | test.rs:56:15:56:15 | b | | +| test.rs:57:13:57:13 | 1 | test.rs:58:13:60:13 | ExprStmt | | +| test.rs:57:13:57:14 | ExprStmt | test.rs:57:13:57:13 | 1 | | +| test.rs:58:13:60:13 | ExprStmt | test.rs:58:17:58:17 | i | | +| test.rs:58:13:60:13 | IfExpr | test.rs:61:13:61:22 | ExprStmt | | +| test.rs:58:16:58:22 | ParenExpr | test.rs:58:13:60:13 | IfExpr | false | +| test.rs:58:16:58:22 | ParenExpr | test.rs:59:17:59:22 | ExprStmt | true | +| test.rs:58:17:58:17 | i | test.rs:58:21:58:21 | 0 | | +| test.rs:58:17:58:21 | ... > ... | test.rs:58:16:58:22 | ParenExpr | | +| test.rs:58:21:58:21 | 0 | test.rs:58:17:58:21 | ... > ... | | +| test.rs:59:17:59:21 | BreakExpr | test.rs:56:9:62:9 | WhileExpr | break | +| test.rs:59:17:59:22 | ExprStmt | test.rs:59:17:59:21 | BreakExpr | | +| test.rs:61:13:61:13 | PathExpr | test.rs:61:17:61:21 | false | | +| test.rs:61:13:61:21 | ... = ... | test.rs:56:17:62:9 | BlockExpr | | +| test.rs:61:13:61:22 | ExprStmt | test.rs:61:13:61:13 | PathExpr | | +| test.rs:61:17:61:21 | false | test.rs:61:13:61:21 | ... = ... | | | test.rs:75:1:78:1 | enter test_nested_function | test.rs:76:5:76:28 | LetStmt | | | test.rs:75:1:78:1 | exit test_nested_function (normal) | test.rs:75:1:78:1 | exit test_nested_function | | | test.rs:75:40:78:1 | BlockExpr | test.rs:75:1:78:1 | exit test_nested_function (normal) | | From 8c1fd8fa7a22a4f5f99aa0ca9f58b3dc6d2a0d00 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Tue, 1 Oct 2024 10:27:38 +0200 Subject: [PATCH 29/79] Rust: Implement CFG for `ForExpr`s --- .../internal/ControlFlowGraphImpl.qll | 43 ++++++++++++++++++- .../CONSISTENCY/CfgConsistency.expected | 2 - .../library-tests/controlflow/Cfg.expected | 21 +++++++++ 3 files changed, 62 insertions(+), 4 deletions(-) diff --git a/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll b/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll index 2cbf49b9e2b1..4535e0be4c1c 100644 --- a/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll +++ b/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll @@ -284,7 +284,9 @@ abstract class LoopingExprTree extends PostOrderTree { abstract Label getLabel(); - /** Whether this loop captures the `c` completion. */ + abstract predicate entry(AstNode node); + + /** Holds if this loop captures the `c` completion. */ predicate capturesLoopJumpCompletion(LoopJumpCompletion c) { not c.hasLabel() or @@ -305,7 +307,7 @@ abstract class LoopingExprTree extends PostOrderTree { or c.(LoopJumpCompletion).isContinue() and this.capturesLoopJumpCompletion(c) ) and - this.first(succ) + this.entry(succ) } override predicate last(AstNode last, Completion c) { @@ -323,6 +325,8 @@ class LoopExprTree extends LoopingExprTree instanceof LoopExpr { override Label getLabel() { result = LoopExpr.super.getLabel() } + override predicate entry(AstNode node) { this.first(node) } + override predicate first(AstNode node) { first(this.getLoopBody(), node) } } @@ -331,6 +335,8 @@ class WhileExprTree extends LoopingExprTree instanceof WhileExpr { override Label getLabel() { result = WhileExpr.super.getLabel() } + override predicate entry(AstNode node) { this.first(node) } + override predicate first(AstNode node) { first(super.getCondition(), node) } override predicate succ(AstNode pred, AstNode succ, Completion c) { @@ -353,6 +359,39 @@ class WhileExprTree extends LoopingExprTree instanceof WhileExpr { } } +class ForExprTree extends LoopingExprTree instanceof ForExpr { + override BlockExpr getLoopBody() { result = ForExpr.super.getLoopBody() } + + override Label getLabel() { result = ForExpr.super.getLabel() } + + override predicate entry(AstNode n) { first(super.getPat(), n) } + + override predicate first(AstNode node) { first(super.getIterable(), node) } + + override predicate succ(AstNode pred, AstNode succ, Completion c) { + super.succ(pred, succ, c) + or + last(super.getIterable(), pred, c) and + first(super.getPat(), succ) and + completionIsNormal(c) + or + last(super.getPat(), pred, c) and + c.(MatchCompletion).succeeded() and + first(this.getLoopBody(), succ) + or + last(super.getPat(), pred, c) and + c.(MatchCompletion).failed() and + succ = this + } + + override predicate last(AstNode last, Completion c) { + super.last(last, c) + or + last(super.getIterable(), last, c) and + not completionIsNormal(c) + } +} + class MatchArmTree extends ControlFlowTree instanceof MatchArm { override predicate propagatesAbnormal(AstNode child) { child = super.getExpr() } diff --git a/rust/ql/test/library-tests/controlflow/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/library-tests/controlflow/CONSISTENCY/CfgConsistency.expected index df4c34f39f73..64911eb1788f 100644 --- a/rust/ql/test/library-tests/controlflow/CONSISTENCY/CfgConsistency.expected +++ b/rust/ql/test/library-tests/controlflow/CONSISTENCY/CfgConsistency.expected @@ -1,5 +1,3 @@ deadEnd | test.rs:230:28:230:33 | ... < ... | | test.rs:245:30:245:48 | BlockExpr | -scopeNoFirst -| test.rs:65:5:72:5 | test_for | diff --git a/rust/ql/test/library-tests/controlflow/Cfg.expected b/rust/ql/test/library-tests/controlflow/Cfg.expected index 388ebed628a2..67756a2bca27 100644 --- a/rust/ql/test/library-tests/controlflow/Cfg.expected +++ b/rust/ql/test/library-tests/controlflow/Cfg.expected @@ -122,6 +122,27 @@ | test.rs:61:13:61:21 | ... = ... | test.rs:56:17:62:9 | BlockExpr | | | test.rs:61:13:61:22 | ExprStmt | test.rs:61:13:61:13 | PathExpr | | | test.rs:61:17:61:21 | false | test.rs:61:13:61:21 | ... = ... | | +| test.rs:65:5:72:5 | enter test_for | test.rs:66:18:66:18 | 0 | | +| test.rs:65:5:72:5 | exit test_for (normal) | test.rs:65:5:72:5 | exit test_for | | +| test.rs:65:25:72:5 | BlockExpr | test.rs:65:5:72:5 | exit test_for (normal) | | +| test.rs:66:9:71:9 | ForExpr | test.rs:65:25:72:5 | BlockExpr | | +| test.rs:66:13:66:13 | i | test.rs:66:9:71:9 | ForExpr | no-match | +| test.rs:66:13:66:13 | i | test.rs:67:13:69:13 | ExprStmt | match | +| test.rs:66:18:66:18 | 0 | test.rs:66:21:66:22 | 10 | | +| test.rs:66:18:66:22 | RangeExpr | test.rs:66:13:66:13 | i | | +| test.rs:66:21:66:22 | 10 | test.rs:66:18:66:22 | RangeExpr | | +| test.rs:66:24:71:9 | BlockExpr | test.rs:66:13:66:13 | i | | +| test.rs:67:13:69:13 | ExprStmt | test.rs:67:17:67:17 | i | | +| test.rs:67:13:69:13 | IfExpr | test.rs:70:13:70:14 | ExprStmt | | +| test.rs:67:16:67:23 | ParenExpr | test.rs:67:13:69:13 | IfExpr | false | +| test.rs:67:16:67:23 | ParenExpr | test.rs:68:17:68:22 | ExprStmt | true | +| test.rs:67:17:67:17 | i | test.rs:67:22:67:22 | j | | +| test.rs:67:17:67:22 | ... == ... | test.rs:67:16:67:23 | ParenExpr | | +| test.rs:67:22:67:22 | j | test.rs:67:17:67:22 | ... == ... | | +| test.rs:68:17:68:21 | BreakExpr | test.rs:66:9:71:9 | ForExpr | break | +| test.rs:68:17:68:22 | ExprStmt | test.rs:68:17:68:21 | BreakExpr | | +| test.rs:70:13:70:13 | 1 | test.rs:66:24:71:9 | BlockExpr | | +| test.rs:70:13:70:14 | ExprStmt | test.rs:70:13:70:13 | 1 | | | test.rs:75:1:78:1 | enter test_nested_function | test.rs:76:5:76:28 | LetStmt | | | test.rs:75:1:78:1 | exit test_nested_function (normal) | test.rs:75:1:78:1 | exit test_nested_function | | | test.rs:75:40:78:1 | BlockExpr | test.rs:75:1:78:1 | exit test_nested_function (normal) | | From a507854288824de825761439bf1fbb233813ffd2 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Tue, 1 Oct 2024 10:34:15 +0200 Subject: [PATCH 30/79] Rust: Fix bug in `BooleanCompletion.isValidForSpecific0` --- rust/ql/lib/codeql/rust/controlflow/internal/Completion.qll | 2 +- .../controlflow/CONSISTENCY/CfgConsistency.expected | 1 - rust/ql/test/library-tests/controlflow/Cfg.expected | 5 +++++ .../variables/CONSISTENCY/CfgConsistency.expected | 1 - 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/rust/ql/lib/codeql/rust/controlflow/internal/Completion.qll b/rust/ql/lib/codeql/rust/controlflow/internal/Completion.qll index e9c5d95f910c..facb3849f71f 100644 --- a/rust/ql/lib/codeql/rust/controlflow/internal/Completion.qll +++ b/rust/ql/lib/codeql/rust/controlflow/internal/Completion.qll @@ -86,7 +86,7 @@ class BooleanCompletion extends ConditionalCompletion, TBooleanCompletion { or e = any(WhileExpr c).getCondition() or - any(MatchArm arm).getGuard() = e + any(MatchGuard guard).getCondition() = e or exists(BinaryExpr expr | expr.getOperatorName() = ["&&", "||"] and diff --git a/rust/ql/test/library-tests/controlflow/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/library-tests/controlflow/CONSISTENCY/CfgConsistency.expected index 64911eb1788f..10964769c6e7 100644 --- a/rust/ql/test/library-tests/controlflow/CONSISTENCY/CfgConsistency.expected +++ b/rust/ql/test/library-tests/controlflow/CONSISTENCY/CfgConsistency.expected @@ -1,3 +1,2 @@ deadEnd -| test.rs:230:28:230:33 | ... < ... | | test.rs:245:30:245:48 | BlockExpr | diff --git a/rust/ql/test/library-tests/controlflow/Cfg.expected b/rust/ql/test/library-tests/controlflow/Cfg.expected index 67756a2bca27..30ffb3673c14 100644 --- a/rust/ql/test/library-tests/controlflow/Cfg.expected +++ b/rust/ql/test/library-tests/controlflow/Cfg.expected @@ -428,7 +428,12 @@ | test.rs:230:9:230:23 | TupleStructPat | test.rs:230:28:230:28 | x | match | | test.rs:230:9:230:23 | TupleStructPat | test.rs:231:9:231:23 | TupleStructPat | no-match | | test.rs:230:28:230:28 | x | test.rs:230:32:230:33 | 10 | | +| test.rs:230:28:230:33 | ... < ... | test.rs:230:38:230:38 | x | true | +| test.rs:230:28:230:33 | ... < ... | test.rs:231:9:231:23 | TupleStructPat | false | | test.rs:230:32:230:33 | 10 | test.rs:230:28:230:33 | ... < ... | | +| test.rs:230:38:230:38 | x | test.rs:230:42:230:42 | 5 | | +| test.rs:230:38:230:42 | ... + ... | test.rs:229:5:233:5 | MatchExpr | | +| test.rs:230:42:230:42 | 5 | test.rs:230:38:230:42 | ... + ... | | | test.rs:231:9:231:23 | TupleStructPat | test.rs:231:28:231:28 | x | match | | test.rs:231:9:231:23 | TupleStructPat | test.rs:232:9:232:20 | PathPat | no-match | | test.rs:231:28:231:28 | x | test.rs:229:5:233:5 | MatchExpr | | diff --git a/rust/ql/test/library-tests/variables/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/library-tests/variables/CONSISTENCY/CfgConsistency.expected index 5457cb7c9d96..f7c02f86bb8d 100644 --- a/rust/ql/test/library-tests/variables/CONSISTENCY/CfgConsistency.expected +++ b/rust/ql/test/library-tests/variables/CONSISTENCY/CfgConsistency.expected @@ -1,5 +1,4 @@ deadEnd | variables.rs:2:5:2:22 | ExprStmt | | variables.rs:6:5:6:22 | ExprStmt | -| variables.rs:200:16:200:21 | ... > ... | | variables.rs:310:5:310:42 | LetStmt | From 17770af491b69035e616fe2f61c7e1d509e1b808 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Tue, 1 Oct 2024 10:39:09 +0200 Subject: [PATCH 31/79] Rust: Account for `let` statement `else` blocks in `deadEnd` --- rust/ql/consistency-queries/CfgConsistency.ql | 6 ++++++ .../controlflow/CONSISTENCY/CfgConsistency.expected | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) delete mode 100644 rust/ql/test/library-tests/controlflow/CONSISTENCY/CfgConsistency.expected diff --git a/rust/ql/consistency-queries/CfgConsistency.ql b/rust/ql/consistency-queries/CfgConsistency.ql index ef7f9b6f2551..52b44170a397 100644 --- a/rust/ql/consistency-queries/CfgConsistency.ql +++ b/rust/ql/consistency-queries/CfgConsistency.ql @@ -25,3 +25,9 @@ query predicate scopeNoFirst(CfgScope scope) { not scope = any(Function f | not exists(f.getBody())) and not scope = any(ClosureExpr c | not exists(c.getBody())) } + +query predicate deadEnd(CfgImpl::Node node) { + Consistency::deadEnd(node) and + // `else` blocks in `let` statements diverge, so they are by definition dead ends + not node.getAstNode() = any(LetStmt let).getLetElse().getBlockExpr() +} diff --git a/rust/ql/test/library-tests/controlflow/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/library-tests/controlflow/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 10964769c6e7..000000000000 --- a/rust/ql/test/library-tests/controlflow/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -deadEnd -| test.rs:245:30:245:48 | BlockExpr | From bbd0aa929fa196432d0d2b02075b00ce3f688826 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Tue, 1 Oct 2024 11:11:42 +0200 Subject: [PATCH 32/79] Rust: Add more missing CFG trees --- .../internal/ControlFlowGraphImpl.qll | 35 +++++++++++++++++++ .../Abi/CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../Attr/CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../Const/CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../Enum/CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../Impl/CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../Label/CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../Meta/CONSISTENCY/CfgConsistency.expected | 2 -- .../Name/CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../Param/CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../Trait/CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../Union/CONSISTENCY/CfgConsistency.expected | 2 -- .../Use/CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 2 -- .../CONSISTENCY/CfgConsistency.expected | 4 --- .../CONSISTENCY/CfgConsistency.expected | 4 --- .../CONSISTENCY/CfgConsistency.expected | 8 ----- 98 files changed, 35 insertions(+), 204 deletions(-) delete mode 100644 rust/ql/test/extractor-tests/generated/Abi/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/ArgList/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/ArrayExpr/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/ArrayType/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/AssocItemList/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/AssocTypeArg/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/Attr/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/ClosureBinder/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/Const/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/ConstArg/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/ConstParam/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/DynTraitType/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/Enum/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/ExprStmt/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/ExternBlock/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/ExternCrate/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/ExternItemList/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/FnPtrType/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/ForExpr/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/ForType/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/FormatArgsArg/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/FormatArgsExpr/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/GenericParamList/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/IfExpr/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/Impl/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/ImplTraitType/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/InferType/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/ItemList/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/Label/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/LetElse/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/LetExpr/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/Lifetime/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/LifetimeArg/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/LifetimeParam/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/LoopExpr/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/MacroCall/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/MacroDef/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/MacroExpr/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/MacroPat/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/MacroRules/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/MacroType/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/MatchArm/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/MatchArmList/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/MatchExpr/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/MatchGuard/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/Meta/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/Name/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/NameRef/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/NeverType/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/Param/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/ParamList/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/ParenExpr/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/ParenPat/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/ParenType/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/PathSegment/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/PathType/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/PtrType/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/RecordExprFieldList/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/RecordField/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/RecordFieldList/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/RecordPatFieldList/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/RefType/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/Rename/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/RestPat/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/RetType/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/ReturnTypeSyntax/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/SelfParam/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/SliceType/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/SourceFile/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/Static/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/StmtList/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/Struct/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/TokenTree/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/Trait/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/TraitAlias/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/TryExpr/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/TupleField/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/TupleFieldList/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/TupleType/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/TypeAlias/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/TypeArg/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/TypeBound/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/TypeBoundList/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/TypeParam/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/Union/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/Use/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/UseTree/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/UseTreeList/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/Variant/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/VariantList/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/Visibility/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/WhereClause/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/WherePred/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/WhileExpr/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/library-tests/variables/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/query-tests/diagnostics/CONSISTENCY/CfgConsistency.expected delete mode 100644 rust/ql/test/query-tests/unusedentities/CONSISTENCY/CfgConsistency.expected diff --git a/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll b/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll index 4535e0be4c1c..177651bf1ca8 100644 --- a/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll +++ b/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll @@ -61,6 +61,10 @@ import CfgImpl /** Holds if `p` is a trivial pattern that is always guaranteed to match. */ predicate trivialPat(Pat p) { p instanceof WildcardPat or p instanceof IdentPat } +class ArrayExprTree extends StandardPostOrderTree, ArrayExpr { + override AstNode getChildNode(int i) { result = this.getExpr(i) } +} + class AsmExprTree extends LeafTree instanceof AsmExpr { } class AwaitExprTree extends StandardPostOrderTree instanceof AwaitExpr { @@ -392,6 +396,9 @@ class ForExprTree extends LoopingExprTree instanceof ForExpr { } } +// TODO: replace with expanded macro once the extractor supports it +class MacroExprTree extends LeafTree, MacroExpr { } + class MatchArmTree extends ControlFlowTree instanceof MatchArm { override predicate propagatesAbnormal(AstNode child) { child = super.getExpr() } @@ -452,6 +459,10 @@ class MethodCallExprTree extends StandardPostOrderTree instanceof MethodCallExpr } } +class NameTree extends LeafTree, Name { } + +class NameRefTree extends LeafTree, NameRef { } + class OffsetOfExprTree extends LeafTree instanceof OffsetOfExpr { } class ParenExprTree extends StandardPostOrderTree, ParenExpr { @@ -461,6 +472,18 @@ class ParenExprTree extends StandardPostOrderTree, ParenExpr { // This covers all patterns as they all extend `Pat` class PatExprTree extends LeafTree instanceof Pat { } +class PathTree extends StandardPostOrderTree, Path { + override AstNode getChildNode(int i) { + i = 0 and result = this.getQualifier() + or + i = 1 and result = this.getPart() + } +} + +class PathSegmentTree extends StandardPostOrderTree, PathSegment { + override AstNode getChildNode(int i) { i = 0 and result = this.getNameRef() } +} + class PathExprTree extends LeafTree instanceof PathExpr { } class PrefixExprTree extends StandardPostOrderTree instanceof PrefixExpr { @@ -499,6 +522,14 @@ class ReturnExprTree extends PostOrderTree instanceof ReturnExpr { } } +class StaticTree extends StandardPostOrderTree, Static { + override AstNode getChildNode(int i) { + i = 0 and result = this.getName() + or + i = 1 and result = this.getBody() + } +} + class TupleExprTree extends StandardPostOrderTree instanceof TupleExpr { override AstNode getChildNode(int i) { result = super.getField(i) } } @@ -507,6 +538,10 @@ class TypeRefTree extends LeafTree instanceof TypeRef { } class UnderscoreExprTree extends LeafTree instanceof UnderscoreExpr { } +class UseTree_ extends StandardPreOrderTree, Use { + override AstNode getChildNode(int i) { i = 0 and result = this.getUseTree().getPath() } +} + // NOTE: `yield` is a reserved but unused keyword. class YieldExprTree extends StandardPostOrderTree instanceof YieldExpr { override AstNode getChildNode(int i) { i = 0 and result = super.getExpr() } diff --git a/rust/ql/test/extractor-tests/generated/Abi/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/Abi/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 8d4bdf6cd3dc..000000000000 --- a/rust/ql/test/extractor-tests/generated/Abi/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_abi.rs:3:1:6:1 | test_abi | diff --git a/rust/ql/test/extractor-tests/generated/ArgList/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/ArgList/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 9d248b750b83..000000000000 --- a/rust/ql/test/extractor-tests/generated/ArgList/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_arg_list.rs:3:1:6:1 | test_arg_list | diff --git a/rust/ql/test/extractor-tests/generated/ArrayExpr/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/ArrayExpr/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 4bf8e4062121..000000000000 --- a/rust/ql/test/extractor-tests/generated/ArrayExpr/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -deadEnd -| gen_array_expr.rs:5:5:5:14 | ExprStmt | diff --git a/rust/ql/test/extractor-tests/generated/ArrayType/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/ArrayType/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 62342a759d5b..000000000000 --- a/rust/ql/test/extractor-tests/generated/ArrayType/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_array_type.rs:3:1:6:1 | test_array_type | diff --git a/rust/ql/test/extractor-tests/generated/AssocItemList/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/AssocItemList/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index cc7eef9075c0..000000000000 --- a/rust/ql/test/extractor-tests/generated/AssocItemList/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_assoc_item_list.rs:3:1:6:1 | test_assoc_item_list | diff --git a/rust/ql/test/extractor-tests/generated/AssocTypeArg/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/AssocTypeArg/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 0b79831a0c6c..000000000000 --- a/rust/ql/test/extractor-tests/generated/AssocTypeArg/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_assoc_type_arg.rs:3:1:6:1 | test_assoc_type_arg | diff --git a/rust/ql/test/extractor-tests/generated/Attr/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/Attr/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 0b123c1df9bf..000000000000 --- a/rust/ql/test/extractor-tests/generated/Attr/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_attr.rs:3:1:6:1 | test_attr | diff --git a/rust/ql/test/extractor-tests/generated/ClosureBinder/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/ClosureBinder/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index f60c0a4be22e..000000000000 --- a/rust/ql/test/extractor-tests/generated/ClosureBinder/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_closure_binder.rs:3:1:6:1 | test_closure_binder | diff --git a/rust/ql/test/extractor-tests/generated/Const/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/Const/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index ee1cb7311e75..000000000000 --- a/rust/ql/test/extractor-tests/generated/Const/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_const.rs:3:1:6:1 | test_const | diff --git a/rust/ql/test/extractor-tests/generated/ConstArg/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/ConstArg/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index bc07de34ae2a..000000000000 --- a/rust/ql/test/extractor-tests/generated/ConstArg/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_const_arg.rs:3:1:6:1 | test_const_arg | diff --git a/rust/ql/test/extractor-tests/generated/ConstParam/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/ConstParam/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 634709095ffd..000000000000 --- a/rust/ql/test/extractor-tests/generated/ConstParam/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_const_param.rs:3:1:6:1 | test_const_param | diff --git a/rust/ql/test/extractor-tests/generated/DynTraitType/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/DynTraitType/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 4753404b64da..000000000000 --- a/rust/ql/test/extractor-tests/generated/DynTraitType/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_dyn_trait_type.rs:3:1:6:1 | test_dyn_trait_type | diff --git a/rust/ql/test/extractor-tests/generated/Enum/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/Enum/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 112cd9bc2ff8..000000000000 --- a/rust/ql/test/extractor-tests/generated/Enum/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_enum.rs:3:1:6:1 | test_enum | diff --git a/rust/ql/test/extractor-tests/generated/ExprStmt/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/ExprStmt/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 1013a9a4bb51..000000000000 --- a/rust/ql/test/extractor-tests/generated/ExprStmt/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -deadEnd -| gen_expr_stmt.rs:6:5:6:12 | CallExpr | diff --git a/rust/ql/test/extractor-tests/generated/ExternBlock/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/ExternBlock/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index dcd514c03c23..000000000000 --- a/rust/ql/test/extractor-tests/generated/ExternBlock/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_extern_block.rs:3:1:6:1 | test_extern_block | diff --git a/rust/ql/test/extractor-tests/generated/ExternCrate/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/ExternCrate/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index a3657bdec4eb..000000000000 --- a/rust/ql/test/extractor-tests/generated/ExternCrate/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_extern_crate.rs:3:1:6:1 | test_extern_crate | diff --git a/rust/ql/test/extractor-tests/generated/ExternItemList/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/ExternItemList/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 004b9a6b6a2e..000000000000 --- a/rust/ql/test/extractor-tests/generated/ExternItemList/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_extern_item_list.rs:3:1:6:1 | test_extern_item_list | diff --git a/rust/ql/test/extractor-tests/generated/FnPtrType/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/FnPtrType/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index ee3d592a18f5..000000000000 --- a/rust/ql/test/extractor-tests/generated/FnPtrType/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_fn_ptr_type.rs:3:1:6:1 | test_fn_ptr_type | diff --git a/rust/ql/test/extractor-tests/generated/ForExpr/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/ForExpr/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 536401b32bd6..000000000000 --- a/rust/ql/test/extractor-tests/generated/ForExpr/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_for_expr.rs:3:1:6:1 | test_for_expr | diff --git a/rust/ql/test/extractor-tests/generated/ForType/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/ForType/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 9b87a1cae09b..000000000000 --- a/rust/ql/test/extractor-tests/generated/ForType/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_for_type.rs:3:1:6:1 | test_for_type | diff --git a/rust/ql/test/extractor-tests/generated/FormatArgsArg/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/FormatArgsArg/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 80e93a811d5c..000000000000 --- a/rust/ql/test/extractor-tests/generated/FormatArgsArg/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_format_args_arg.rs:3:1:6:1 | test_format_args_arg | diff --git a/rust/ql/test/extractor-tests/generated/FormatArgsExpr/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/FormatArgsExpr/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 7fb70c61bde5..000000000000 --- a/rust/ql/test/extractor-tests/generated/FormatArgsExpr/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_format_args_expr.rs:3:1:6:1 | test_format_args_expr | diff --git a/rust/ql/test/extractor-tests/generated/GenericParamList/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/GenericParamList/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 1468fc6dd52d..000000000000 --- a/rust/ql/test/extractor-tests/generated/GenericParamList/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_generic_param_list.rs:3:1:6:1 | test_generic_param_list | diff --git a/rust/ql/test/extractor-tests/generated/IfExpr/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/IfExpr/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 8049e813d65e..000000000000 --- a/rust/ql/test/extractor-tests/generated/IfExpr/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -deadEnd -| gen_if_expr.rs:6:9:6:38 | ExprStmt | diff --git a/rust/ql/test/extractor-tests/generated/Impl/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/Impl/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 43501141e2be..000000000000 --- a/rust/ql/test/extractor-tests/generated/Impl/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_impl.rs:3:1:6:1 | test_impl | diff --git a/rust/ql/test/extractor-tests/generated/ImplTraitType/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/ImplTraitType/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index a88979d04764..000000000000 --- a/rust/ql/test/extractor-tests/generated/ImplTraitType/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_impl_trait_type.rs:3:1:6:1 | test_impl_trait_type | diff --git a/rust/ql/test/extractor-tests/generated/InferType/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/InferType/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 2eaf72e19646..000000000000 --- a/rust/ql/test/extractor-tests/generated/InferType/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_infer_type.rs:3:1:6:1 | test_infer_type | diff --git a/rust/ql/test/extractor-tests/generated/ItemList/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/ItemList/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 47b7abefadc3..000000000000 --- a/rust/ql/test/extractor-tests/generated/ItemList/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_item_list.rs:3:1:6:1 | test_item_list | diff --git a/rust/ql/test/extractor-tests/generated/Label/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/Label/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 8409c37b3651..000000000000 --- a/rust/ql/test/extractor-tests/generated/Label/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -deadEnd -| gen_label.rs:6:9:6:41 | ExprStmt | diff --git a/rust/ql/test/extractor-tests/generated/LetElse/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/LetElse/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 3e531a4f531c..000000000000 --- a/rust/ql/test/extractor-tests/generated/LetElse/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_let_else.rs:3:1:6:1 | test_let_else | diff --git a/rust/ql/test/extractor-tests/generated/LetExpr/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/LetExpr/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index b095048ef145..000000000000 --- a/rust/ql/test/extractor-tests/generated/LetExpr/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -deadEnd -| gen_let_expr.rs:6:9:6:26 | ExprStmt | diff --git a/rust/ql/test/extractor-tests/generated/Lifetime/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/Lifetime/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 5ce6674c6dbc..000000000000 --- a/rust/ql/test/extractor-tests/generated/Lifetime/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_lifetime.rs:3:1:6:1 | test_lifetime | diff --git a/rust/ql/test/extractor-tests/generated/LifetimeArg/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/LifetimeArg/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index e7fb5e883146..000000000000 --- a/rust/ql/test/extractor-tests/generated/LifetimeArg/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_lifetime_arg.rs:3:1:6:1 | test_lifetime_arg | diff --git a/rust/ql/test/extractor-tests/generated/LifetimeParam/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/LifetimeParam/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index e8267e036098..000000000000 --- a/rust/ql/test/extractor-tests/generated/LifetimeParam/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_lifetime_param.rs:3:1:6:1 | test_lifetime_param | diff --git a/rust/ql/test/extractor-tests/generated/LoopExpr/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/LoopExpr/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 51c4af3241b0..000000000000 --- a/rust/ql/test/extractor-tests/generated/LoopExpr/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -deadEnd -| gen_loop_expr.rs:6:9:6:42 | ExprStmt | diff --git a/rust/ql/test/extractor-tests/generated/MacroCall/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/MacroCall/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 6d53cc3fb6cb..000000000000 --- a/rust/ql/test/extractor-tests/generated/MacroCall/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_macro_call.rs:3:1:6:1 | test_macro_call | diff --git a/rust/ql/test/extractor-tests/generated/MacroDef/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/MacroDef/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 35a5ed182593..000000000000 --- a/rust/ql/test/extractor-tests/generated/MacroDef/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_macro_def.rs:3:1:6:1 | test_macro_def | diff --git a/rust/ql/test/extractor-tests/generated/MacroExpr/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/MacroExpr/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index f1bbf3a66f5a..000000000000 --- a/rust/ql/test/extractor-tests/generated/MacroExpr/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_macro_expr.rs:3:1:6:1 | test_macro_expr | diff --git a/rust/ql/test/extractor-tests/generated/MacroPat/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/MacroPat/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index bc683af91462..000000000000 --- a/rust/ql/test/extractor-tests/generated/MacroPat/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_macro_pat.rs:3:1:6:1 | test_macro_pat | diff --git a/rust/ql/test/extractor-tests/generated/MacroRules/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/MacroRules/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 5705ce551635..000000000000 --- a/rust/ql/test/extractor-tests/generated/MacroRules/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_macro_rules.rs:3:1:6:1 | test_macro_rules | diff --git a/rust/ql/test/extractor-tests/generated/MacroType/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/MacroType/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 12fc80e517d5..000000000000 --- a/rust/ql/test/extractor-tests/generated/MacroType/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_macro_type.rs:3:1:6:1 | test_macro_type | diff --git a/rust/ql/test/extractor-tests/generated/MatchArm/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/MatchArm/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index e558c7c1c28d..000000000000 --- a/rust/ql/test/extractor-tests/generated/MatchArm/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -deadEnd -| gen_match_arm.rs:10:20:10:25 | ... != ... | diff --git a/rust/ql/test/extractor-tests/generated/MatchArmList/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/MatchArmList/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 1f87a7f2ff2f..000000000000 --- a/rust/ql/test/extractor-tests/generated/MatchArmList/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_match_arm_list.rs:3:1:6:1 | test_match_arm_list | diff --git a/rust/ql/test/extractor-tests/generated/MatchExpr/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/MatchExpr/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 8d6730211c8e..000000000000 --- a/rust/ql/test/extractor-tests/generated/MatchExpr/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -deadEnd -| gen_match_expr.rs:10:20:10:25 | ... != ... | diff --git a/rust/ql/test/extractor-tests/generated/MatchGuard/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/MatchGuard/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index c43c4e80a15f..000000000000 --- a/rust/ql/test/extractor-tests/generated/MatchGuard/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_match_guard.rs:3:1:6:1 | test_match_guard | diff --git a/rust/ql/test/extractor-tests/generated/Meta/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/Meta/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 5b99494cfb9b..000000000000 --- a/rust/ql/test/extractor-tests/generated/Meta/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_meta.rs:3:1:6:1 | test_meta | diff --git a/rust/ql/test/extractor-tests/generated/Name/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/Name/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index ab6b629565a7..000000000000 --- a/rust/ql/test/extractor-tests/generated/Name/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_name.rs:3:1:6:1 | test_name | diff --git a/rust/ql/test/extractor-tests/generated/NameRef/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/NameRef/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 00229745d5e8..000000000000 --- a/rust/ql/test/extractor-tests/generated/NameRef/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_name_ref.rs:3:1:6:1 | test_name_ref | diff --git a/rust/ql/test/extractor-tests/generated/NeverType/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/NeverType/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index f439296033cc..000000000000 --- a/rust/ql/test/extractor-tests/generated/NeverType/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_never_type.rs:3:1:6:1 | test_never_type | diff --git a/rust/ql/test/extractor-tests/generated/Param/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/Param/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 4ae2cf3ef7a7..000000000000 --- a/rust/ql/test/extractor-tests/generated/Param/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_param.rs:3:1:6:1 | test_param | diff --git a/rust/ql/test/extractor-tests/generated/ParamList/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/ParamList/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 5ec0293119d0..000000000000 --- a/rust/ql/test/extractor-tests/generated/ParamList/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_param_list.rs:3:1:6:1 | test_param_list | diff --git a/rust/ql/test/extractor-tests/generated/ParenExpr/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/ParenExpr/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index d6456a3eeaf3..000000000000 --- a/rust/ql/test/extractor-tests/generated/ParenExpr/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_paren_expr.rs:3:1:6:1 | test_paren_expr | diff --git a/rust/ql/test/extractor-tests/generated/ParenPat/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/ParenPat/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 8bae5ce6c3bf..000000000000 --- a/rust/ql/test/extractor-tests/generated/ParenPat/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_paren_pat.rs:3:1:6:1 | test_paren_pat | diff --git a/rust/ql/test/extractor-tests/generated/ParenType/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/ParenType/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 2b51b5ff5c74..000000000000 --- a/rust/ql/test/extractor-tests/generated/ParenType/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_paren_type.rs:3:1:6:1 | test_paren_type | diff --git a/rust/ql/test/extractor-tests/generated/PathSegment/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/PathSegment/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index ce4905c17cbb..000000000000 --- a/rust/ql/test/extractor-tests/generated/PathSegment/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_path_segment.rs:3:1:6:1 | test_path_segment | diff --git a/rust/ql/test/extractor-tests/generated/PathType/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/PathType/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index d274a77daf7b..000000000000 --- a/rust/ql/test/extractor-tests/generated/PathType/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_path_type.rs:3:1:6:1 | test_path_type | diff --git a/rust/ql/test/extractor-tests/generated/PtrType/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/PtrType/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index a85b631b54dd..000000000000 --- a/rust/ql/test/extractor-tests/generated/PtrType/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_ptr_type.rs:3:1:6:1 | test_ptr_type | diff --git a/rust/ql/test/extractor-tests/generated/RecordExprFieldList/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/RecordExprFieldList/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 979b32ad4d84..000000000000 --- a/rust/ql/test/extractor-tests/generated/RecordExprFieldList/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_record_expr_field_list.rs:3:1:6:1 | test_record_expr_field_list | diff --git a/rust/ql/test/extractor-tests/generated/RecordField/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/RecordField/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 233c2442b42b..000000000000 --- a/rust/ql/test/extractor-tests/generated/RecordField/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_record_field.rs:3:1:6:1 | test_record_field | diff --git a/rust/ql/test/extractor-tests/generated/RecordFieldList/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/RecordFieldList/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 28fe2e3666a4..000000000000 --- a/rust/ql/test/extractor-tests/generated/RecordFieldList/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_record_field_list.rs:3:1:6:1 | test_record_field_list | diff --git a/rust/ql/test/extractor-tests/generated/RecordPatFieldList/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/RecordPatFieldList/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 90d25f25c4dc..000000000000 --- a/rust/ql/test/extractor-tests/generated/RecordPatFieldList/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_record_pat_field_list.rs:3:1:6:1 | test_record_pat_field_list | diff --git a/rust/ql/test/extractor-tests/generated/RefType/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/RefType/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index c8e70e9406c7..000000000000 --- a/rust/ql/test/extractor-tests/generated/RefType/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_ref_type.rs:3:1:6:1 | test_ref_type | diff --git a/rust/ql/test/extractor-tests/generated/Rename/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/Rename/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index da7a362c6c57..000000000000 --- a/rust/ql/test/extractor-tests/generated/Rename/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_rename.rs:3:1:6:1 | test_rename | diff --git a/rust/ql/test/extractor-tests/generated/RestPat/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/RestPat/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 4a73b0c3aca5..000000000000 --- a/rust/ql/test/extractor-tests/generated/RestPat/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_rest_pat.rs:3:1:6:1 | test_rest_pat | diff --git a/rust/ql/test/extractor-tests/generated/RetType/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/RetType/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index c203f29b4243..000000000000 --- a/rust/ql/test/extractor-tests/generated/RetType/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_ret_type.rs:3:1:6:1 | test_ret_type | diff --git a/rust/ql/test/extractor-tests/generated/ReturnTypeSyntax/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/ReturnTypeSyntax/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 74c6038da131..000000000000 --- a/rust/ql/test/extractor-tests/generated/ReturnTypeSyntax/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_return_type_syntax.rs:3:1:6:1 | test_return_type_syntax | diff --git a/rust/ql/test/extractor-tests/generated/SelfParam/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/SelfParam/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index ffd6ee6bb3a7..000000000000 --- a/rust/ql/test/extractor-tests/generated/SelfParam/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_self_param.rs:3:1:6:1 | test_self_param | diff --git a/rust/ql/test/extractor-tests/generated/SliceType/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/SliceType/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 1785d38746fb..000000000000 --- a/rust/ql/test/extractor-tests/generated/SliceType/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_slice_type.rs:3:1:6:1 | test_slice_type | diff --git a/rust/ql/test/extractor-tests/generated/SourceFile/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/SourceFile/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 77f954842667..000000000000 --- a/rust/ql/test/extractor-tests/generated/SourceFile/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_source_file.rs:3:1:6:1 | test_source_file | diff --git a/rust/ql/test/extractor-tests/generated/Static/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/Static/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 405775d54459..000000000000 --- a/rust/ql/test/extractor-tests/generated/Static/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_static.rs:3:1:6:1 | test_static | diff --git a/rust/ql/test/extractor-tests/generated/StmtList/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/StmtList/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 3772daffc17e..000000000000 --- a/rust/ql/test/extractor-tests/generated/StmtList/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_stmt_list.rs:3:1:6:1 | test_stmt_list | diff --git a/rust/ql/test/extractor-tests/generated/Struct/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/Struct/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 6aedff0227a8..000000000000 --- a/rust/ql/test/extractor-tests/generated/Struct/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_struct.rs:3:1:6:1 | test_struct | diff --git a/rust/ql/test/extractor-tests/generated/TokenTree/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/TokenTree/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index b1414f7d8ac5..000000000000 --- a/rust/ql/test/extractor-tests/generated/TokenTree/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_token_tree.rs:3:1:6:1 | test_token_tree | diff --git a/rust/ql/test/extractor-tests/generated/Trait/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/Trait/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 9988046e52da..000000000000 --- a/rust/ql/test/extractor-tests/generated/Trait/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_trait.rs:3:1:6:1 | test_trait | diff --git a/rust/ql/test/extractor-tests/generated/TraitAlias/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/TraitAlias/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 5216d265777e..000000000000 --- a/rust/ql/test/extractor-tests/generated/TraitAlias/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_trait_alias.rs:3:1:6:1 | test_trait_alias | diff --git a/rust/ql/test/extractor-tests/generated/TryExpr/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/TryExpr/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 9cd4cb86f31a..000000000000 --- a/rust/ql/test/extractor-tests/generated/TryExpr/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_try_expr.rs:3:1:6:1 | test_try_expr | diff --git a/rust/ql/test/extractor-tests/generated/TupleField/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/TupleField/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index ba75cb574e11..000000000000 --- a/rust/ql/test/extractor-tests/generated/TupleField/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_tuple_field.rs:3:1:6:1 | test_tuple_field | diff --git a/rust/ql/test/extractor-tests/generated/TupleFieldList/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/TupleFieldList/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 94ad834a83f7..000000000000 --- a/rust/ql/test/extractor-tests/generated/TupleFieldList/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_tuple_field_list.rs:3:1:6:1 | test_tuple_field_list | diff --git a/rust/ql/test/extractor-tests/generated/TupleType/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/TupleType/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index df23cd353b8e..000000000000 --- a/rust/ql/test/extractor-tests/generated/TupleType/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_tuple_type.rs:3:1:6:1 | test_tuple_type | diff --git a/rust/ql/test/extractor-tests/generated/TypeAlias/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/TypeAlias/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 5473c4f4d29f..000000000000 --- a/rust/ql/test/extractor-tests/generated/TypeAlias/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_type_alias.rs:3:1:6:1 | test_type_alias | diff --git a/rust/ql/test/extractor-tests/generated/TypeArg/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/TypeArg/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index a4ef31c67be5..000000000000 --- a/rust/ql/test/extractor-tests/generated/TypeArg/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_type_arg.rs:3:1:6:1 | test_type_arg | diff --git a/rust/ql/test/extractor-tests/generated/TypeBound/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/TypeBound/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 65b362b2ce06..000000000000 --- a/rust/ql/test/extractor-tests/generated/TypeBound/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_type_bound.rs:3:1:6:1 | test_type_bound | diff --git a/rust/ql/test/extractor-tests/generated/TypeBoundList/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/TypeBoundList/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 11f983ef491e..000000000000 --- a/rust/ql/test/extractor-tests/generated/TypeBoundList/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_type_bound_list.rs:3:1:6:1 | test_type_bound_list | diff --git a/rust/ql/test/extractor-tests/generated/TypeParam/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/TypeParam/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index d852e7f00743..000000000000 --- a/rust/ql/test/extractor-tests/generated/TypeParam/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_type_param.rs:3:1:6:1 | test_type_param | diff --git a/rust/ql/test/extractor-tests/generated/Union/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/Union/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 2e1da077f375..000000000000 --- a/rust/ql/test/extractor-tests/generated/Union/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_union.rs:3:1:6:1 | test_union | diff --git a/rust/ql/test/extractor-tests/generated/Use/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/Use/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index eb0529d66f9a..000000000000 --- a/rust/ql/test/extractor-tests/generated/Use/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_use.rs:3:1:6:1 | test_use | diff --git a/rust/ql/test/extractor-tests/generated/UseTree/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/UseTree/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 0f5a9b35a2df..000000000000 --- a/rust/ql/test/extractor-tests/generated/UseTree/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_use_tree.rs:3:1:6:1 | test_use_tree | diff --git a/rust/ql/test/extractor-tests/generated/UseTreeList/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/UseTreeList/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index d754f9e4cf63..000000000000 --- a/rust/ql/test/extractor-tests/generated/UseTreeList/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_use_tree_list.rs:3:1:6:1 | test_use_tree_list | diff --git a/rust/ql/test/extractor-tests/generated/Variant/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/Variant/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index e60f96aeee22..000000000000 --- a/rust/ql/test/extractor-tests/generated/Variant/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_variant.rs:3:1:6:1 | test_variant | diff --git a/rust/ql/test/extractor-tests/generated/VariantList/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/VariantList/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 16e583712b31..000000000000 --- a/rust/ql/test/extractor-tests/generated/VariantList/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_variant_list.rs:3:1:6:1 | test_variant_list | diff --git a/rust/ql/test/extractor-tests/generated/Visibility/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/Visibility/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 331e57ed0a41..000000000000 --- a/rust/ql/test/extractor-tests/generated/Visibility/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_visibility.rs:3:1:6:1 | test_visibility | diff --git a/rust/ql/test/extractor-tests/generated/WhereClause/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/WhereClause/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 2606d6d4113f..000000000000 --- a/rust/ql/test/extractor-tests/generated/WhereClause/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_where_clause.rs:3:1:6:1 | test_where_clause | diff --git a/rust/ql/test/extractor-tests/generated/WherePred/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/WherePred/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index e5601587a5fe..000000000000 --- a/rust/ql/test/extractor-tests/generated/WherePred/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_where_pred.rs:3:1:6:1 | test_where_pred | diff --git a/rust/ql/test/extractor-tests/generated/WhileExpr/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/extractor-tests/generated/WhileExpr/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index b9d575da0447..000000000000 --- a/rust/ql/test/extractor-tests/generated/WhileExpr/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -scopeNoFirst -| gen_while_expr.rs:3:1:6:1 | test_while_expr | diff --git a/rust/ql/test/library-tests/variables/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/library-tests/variables/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index f7c02f86bb8d..000000000000 --- a/rust/ql/test/library-tests/variables/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,4 +0,0 @@ -deadEnd -| variables.rs:2:5:2:22 | ExprStmt | -| variables.rs:6:5:6:22 | ExprStmt | -| variables.rs:310:5:310:42 | LetStmt | diff --git a/rust/ql/test/query-tests/diagnostics/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/query-tests/diagnostics/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index 8aa73f9d3c1f..000000000000 --- a/rust/ql/test/query-tests/diagnostics/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,4 +0,0 @@ -deadEnd -| error.rs:2:5:2:32 | ExprStmt | -| my_macro.rs:16:9:16:19 | ExprStmt | -| my_struct.rs:17:9:17:34 | ExprStmt | diff --git a/rust/ql/test/query-tests/unusedentities/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/query-tests/unusedentities/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index f88f86c81777..000000000000 --- a/rust/ql/test/query-tests/unusedentities/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,8 +0,0 @@ -deadEnd -| main.rs:14:2:14:23 | ExprStmt | -| main.rs:38:2:38:23 | ExprStmt | -| main.rs:93:2:93:44 | ExprStmt | -| main.rs:107:2:107:20 | LetStmt | -| main.rs:151:2:151:53 | ExprStmt | -scopeNoFirst -| main.rs:125:1:133:1 | statics | From 26c69b8f8a2dc619360ba63e2173c1d14402db5e Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Tue, 1 Oct 2024 14:54:44 +0200 Subject: [PATCH 33/79] Rust: Add more CFG tests --- .../library-tests/controlflow/Cfg.expected | 762 +++++++++--------- .../ql/test/library-tests/controlflow/test.rs | 21 +- 2 files changed, 413 insertions(+), 370 deletions(-) diff --git a/rust/ql/test/library-tests/controlflow/Cfg.expected b/rust/ql/test/library-tests/controlflow/Cfg.expected index 30ffb3673c14..d5097158874d 100644 --- a/rust/ql/test/library-tests/controlflow/Cfg.expected +++ b/rust/ql/test/library-tests/controlflow/Cfg.expected @@ -122,373 +122,397 @@ | test.rs:61:13:61:21 | ... = ... | test.rs:56:17:62:9 | BlockExpr | | | test.rs:61:13:61:22 | ExprStmt | test.rs:61:13:61:13 | PathExpr | | | test.rs:61:17:61:21 | false | test.rs:61:13:61:21 | ... = ... | | -| test.rs:65:5:72:5 | enter test_for | test.rs:66:18:66:18 | 0 | | -| test.rs:65:5:72:5 | exit test_for (normal) | test.rs:65:5:72:5 | exit test_for | | -| test.rs:65:25:72:5 | BlockExpr | test.rs:65:5:72:5 | exit test_for (normal) | | -| test.rs:66:9:71:9 | ForExpr | test.rs:65:25:72:5 | BlockExpr | | -| test.rs:66:13:66:13 | i | test.rs:66:9:71:9 | ForExpr | no-match | -| test.rs:66:13:66:13 | i | test.rs:67:13:69:13 | ExprStmt | match | -| test.rs:66:18:66:18 | 0 | test.rs:66:21:66:22 | 10 | | -| test.rs:66:18:66:22 | RangeExpr | test.rs:66:13:66:13 | i | | -| test.rs:66:21:66:22 | 10 | test.rs:66:18:66:22 | RangeExpr | | -| test.rs:66:24:71:9 | BlockExpr | test.rs:66:13:66:13 | i | | -| test.rs:67:13:69:13 | ExprStmt | test.rs:67:17:67:17 | i | | -| test.rs:67:13:69:13 | IfExpr | test.rs:70:13:70:14 | ExprStmt | | -| test.rs:67:16:67:23 | ParenExpr | test.rs:67:13:69:13 | IfExpr | false | -| test.rs:67:16:67:23 | ParenExpr | test.rs:68:17:68:22 | ExprStmt | true | -| test.rs:67:17:67:17 | i | test.rs:67:22:67:22 | j | | -| test.rs:67:17:67:22 | ... == ... | test.rs:67:16:67:23 | ParenExpr | | -| test.rs:67:22:67:22 | j | test.rs:67:17:67:22 | ... == ... | | -| test.rs:68:17:68:21 | BreakExpr | test.rs:66:9:71:9 | ForExpr | break | -| test.rs:68:17:68:22 | ExprStmt | test.rs:68:17:68:21 | BreakExpr | | -| test.rs:70:13:70:13 | 1 | test.rs:66:24:71:9 | BlockExpr | | -| test.rs:70:13:70:14 | ExprStmt | test.rs:70:13:70:13 | 1 | | -| test.rs:75:1:78:1 | enter test_nested_function | test.rs:76:5:76:28 | LetStmt | | -| test.rs:75:1:78:1 | exit test_nested_function (normal) | test.rs:75:1:78:1 | exit test_nested_function | | -| test.rs:75:40:78:1 | BlockExpr | test.rs:75:1:78:1 | exit test_nested_function (normal) | | -| test.rs:76:5:76:28 | LetStmt | test.rs:76:19:76:27 | ClosureExpr | | -| test.rs:76:9:76:15 | add_one | test.rs:77:5:77:11 | add_one | match, no-match | -| test.rs:76:19:76:27 | ClosureExpr | test.rs:76:9:76:15 | add_one | | -| test.rs:76:19:76:27 | enter ClosureExpr | test.rs:76:23:76:23 | i | | -| test.rs:76:19:76:27 | exit ClosureExpr (normal) | test.rs:76:19:76:27 | exit ClosureExpr | | -| test.rs:76:23:76:23 | i | test.rs:76:27:76:27 | 1 | | -| test.rs:76:23:76:27 | ... + ... | test.rs:76:19:76:27 | exit ClosureExpr (normal) | | -| test.rs:76:27:76:27 | 1 | test.rs:76:23:76:27 | ... + ... | | -| test.rs:77:5:77:11 | add_one | test.rs:77:13:77:19 | add_one | | -| test.rs:77:5:77:23 | CallExpr | test.rs:75:40:78:1 | BlockExpr | | -| test.rs:77:13:77:19 | add_one | test.rs:77:21:77:21 | n | | -| test.rs:77:13:77:22 | CallExpr | test.rs:77:5:77:23 | CallExpr | | -| test.rs:77:21:77:21 | n | test.rs:77:13:77:22 | CallExpr | | -| test.rs:82:5:88:5 | enter test_if_else | test.rs:83:12:83:12 | n | | -| test.rs:82:5:88:5 | exit test_if_else (normal) | test.rs:82:5:88:5 | exit test_if_else | | -| test.rs:82:36:88:5 | BlockExpr | test.rs:82:5:88:5 | exit test_if_else (normal) | | -| test.rs:83:9:87:9 | IfExpr | test.rs:82:36:88:5 | BlockExpr | | -| test.rs:83:12:83:12 | n | test.rs:83:17:83:17 | 0 | | -| test.rs:83:12:83:17 | ... <= ... | test.rs:84:13:84:13 | 0 | true | -| test.rs:83:12:83:17 | ... <= ... | test.rs:86:13:86:13 | n | false | -| test.rs:83:17:83:17 | 0 | test.rs:83:12:83:17 | ... <= ... | | -| test.rs:83:19:85:9 | BlockExpr | test.rs:83:9:87:9 | IfExpr | | -| test.rs:84:13:84:13 | 0 | test.rs:83:19:85:9 | BlockExpr | | -| test.rs:85:16:87:9 | BlockExpr | test.rs:83:9:87:9 | IfExpr | | -| test.rs:86:13:86:13 | n | test.rs:86:17:86:17 | 1 | | -| test.rs:86:13:86:17 | ... - ... | test.rs:85:16:87:9 | BlockExpr | | -| test.rs:86:17:86:17 | 1 | test.rs:86:13:86:17 | ... - ... | | -| test.rs:90:5:96:5 | enter test_if_let_else | test.rs:91:12:91:26 | LetExpr | | -| test.rs:90:5:96:5 | exit test_if_let_else (normal) | test.rs:90:5:96:5 | exit test_if_let_else | | -| test.rs:90:48:96:5 | BlockExpr | test.rs:90:5:96:5 | exit test_if_let_else (normal) | | -| test.rs:91:9:95:9 | IfExpr | test.rs:90:48:96:5 | BlockExpr | | -| test.rs:91:12:91:26 | LetExpr | test.rs:91:16:91:22 | TupleStructPat | | -| test.rs:91:16:91:22 | TupleStructPat | test.rs:92:13:92:13 | n | match | -| test.rs:91:16:91:22 | TupleStructPat | test.rs:94:13:94:13 | 0 | no-match | -| test.rs:91:28:93:9 | BlockExpr | test.rs:91:9:95:9 | IfExpr | | -| test.rs:92:13:92:13 | n | test.rs:91:28:93:9 | BlockExpr | | -| test.rs:93:16:95:9 | BlockExpr | test.rs:91:9:95:9 | IfExpr | | -| test.rs:94:13:94:13 | 0 | test.rs:93:16:95:9 | BlockExpr | | -| test.rs:98:5:103:5 | enter test_if_let | test.rs:99:9:101:9 | ExprStmt | | -| test.rs:98:5:103:5 | exit test_if_let (normal) | test.rs:98:5:103:5 | exit test_if_let | | -| test.rs:98:43:103:5 | BlockExpr | test.rs:98:5:103:5 | exit test_if_let (normal) | | -| test.rs:99:9:101:9 | ExprStmt | test.rs:99:12:99:26 | LetExpr | | -| test.rs:99:9:101:9 | IfExpr | test.rs:102:9:102:9 | 0 | | -| test.rs:99:12:99:26 | LetExpr | test.rs:99:16:99:22 | TupleStructPat | | -| test.rs:99:16:99:22 | TupleStructPat | test.rs:99:9:101:9 | IfExpr | no-match | -| test.rs:99:16:99:22 | TupleStructPat | test.rs:100:13:100:13 | n | match | -| test.rs:99:28:101:9 | BlockExpr | test.rs:99:9:101:9 | IfExpr | | -| test.rs:100:13:100:13 | n | test.rs:99:28:101:9 | BlockExpr | | -| test.rs:102:9:102:9 | 0 | test.rs:98:43:103:5 | BlockExpr | | -| test.rs:105:5:111:5 | enter test_nested_if | test.rs:106:16:106:16 | PathExpr | | -| test.rs:105:5:111:5 | exit test_nested_if (normal) | test.rs:105:5:111:5 | exit test_nested_if | | -| test.rs:105:38:111:5 | BlockExpr | test.rs:105:5:111:5 | exit test_nested_if (normal) | | -| test.rs:106:9:110:9 | IfExpr | test.rs:105:38:111:5 | BlockExpr | | -| test.rs:106:12:106:49 | ParenExpr | test.rs:107:13:107:13 | 1 | true | -| test.rs:106:12:106:49 | ParenExpr | test.rs:109:13:109:13 | 0 | false | -| test.rs:106:13:106:48 | IfExpr | test.rs:106:12:106:49 | ParenExpr | | -| test.rs:106:16:106:16 | PathExpr | test.rs:106:20:106:20 | 0 | | -| test.rs:106:16:106:20 | ... < ... | test.rs:106:24:106:24 | a | true | -| test.rs:106:16:106:20 | ... < ... | test.rs:106:41:106:41 | a | false | -| test.rs:106:20:106:20 | 0 | test.rs:106:16:106:20 | ... < ... | | -| test.rs:106:22:106:32 | BlockExpr | test.rs:106:13:106:48 | IfExpr | | -| test.rs:106:24:106:24 | a | test.rs:106:29:106:30 | 10 | | -| test.rs:106:24:106:30 | ... < ... | test.rs:106:22:106:32 | BlockExpr | | -| test.rs:106:28:106:30 | - ... | test.rs:106:24:106:30 | ... < ... | | -| test.rs:106:29:106:30 | 10 | test.rs:106:28:106:30 | - ... | | -| test.rs:106:39:106:48 | BlockExpr | test.rs:106:13:106:48 | IfExpr | | -| test.rs:106:41:106:41 | a | test.rs:106:45:106:46 | 10 | | -| test.rs:106:41:106:46 | ... > ... | test.rs:106:39:106:48 | BlockExpr | | -| test.rs:106:45:106:46 | 10 | test.rs:106:41:106:46 | ... > ... | | -| test.rs:106:51:108:9 | BlockExpr | test.rs:106:9:110:9 | IfExpr | | -| test.rs:107:13:107:13 | 1 | test.rs:106:51:108:9 | BlockExpr | | -| test.rs:108:16:110:9 | BlockExpr | test.rs:106:9:110:9 | IfExpr | | -| test.rs:109:13:109:13 | 0 | test.rs:108:16:110:9 | BlockExpr | | -| test.rs:113:5:122:5 | enter test_nested_if_match | test.rs:114:19:114:19 | a | | -| test.rs:113:5:122:5 | exit test_nested_if_match (normal) | test.rs:113:5:122:5 | exit test_nested_if_match | | -| test.rs:113:44:122:5 | BlockExpr | test.rs:113:5:122:5 | exit test_nested_if_match (normal) | | -| test.rs:114:9:121:9 | IfExpr | test.rs:113:44:122:5 | BlockExpr | | -| test.rs:114:12:117:10 | ParenExpr | test.rs:118:13:118:13 | 1 | true | -| test.rs:114:12:117:10 | ParenExpr | test.rs:120:13:120:13 | 0 | false | -| test.rs:114:13:117:9 | MatchExpr | test.rs:114:12:117:10 | ParenExpr | | -| test.rs:114:19:114:19 | a | test.rs:115:13:115:13 | LiteralPat | | -| test.rs:115:13:115:13 | LiteralPat | test.rs:115:18:115:21 | true | match | -| test.rs:115:13:115:13 | LiteralPat | test.rs:116:13:116:13 | WildcardPat | no-match | -| test.rs:115:18:115:21 | true | test.rs:114:13:117:9 | MatchExpr | | -| test.rs:116:13:116:13 | WildcardPat | test.rs:116:18:116:22 | false | match | -| test.rs:116:18:116:22 | false | test.rs:114:13:117:9 | MatchExpr | | -| test.rs:117:12:119:9 | BlockExpr | test.rs:114:9:121:9 | IfExpr | | -| test.rs:118:13:118:13 | 1 | test.rs:117:12:119:9 | BlockExpr | | -| test.rs:119:16:121:9 | BlockExpr | test.rs:114:9:121:9 | IfExpr | | -| test.rs:120:13:120:13 | 0 | test.rs:119:16:121:9 | BlockExpr | | -| test.rs:124:5:133:5 | enter test_nested_if_block | test.rs:126:13:126:15 | ExprStmt | | -| test.rs:124:5:133:5 | exit test_nested_if_block (normal) | test.rs:124:5:133:5 | exit test_nested_if_block | | -| test.rs:124:44:133:5 | BlockExpr | test.rs:124:5:133:5 | exit test_nested_if_block (normal) | | -| test.rs:125:9:132:9 | IfExpr | test.rs:124:44:133:5 | BlockExpr | | -| test.rs:125:12:128:9 | BlockExpr | test.rs:129:13:129:13 | 1 | true | -| test.rs:125:12:128:9 | BlockExpr | test.rs:131:13:131:13 | 0 | false | -| test.rs:126:13:126:14 | TupleExpr | test.rs:127:13:127:13 | a | | -| test.rs:126:13:126:15 | ExprStmt | test.rs:126:13:126:14 | TupleExpr | | -| test.rs:127:13:127:13 | a | test.rs:127:17:127:17 | 0 | | -| test.rs:127:13:127:17 | ... > ... | test.rs:125:12:128:9 | BlockExpr | false, true | -| test.rs:127:17:127:17 | 0 | test.rs:127:13:127:17 | ... > ... | | -| test.rs:128:11:130:9 | BlockExpr | test.rs:125:9:132:9 | IfExpr | | -| test.rs:129:13:129:13 | 1 | test.rs:128:11:130:9 | BlockExpr | | -| test.rs:130:16:132:9 | BlockExpr | test.rs:125:9:132:9 | IfExpr | | -| test.rs:131:13:131:13 | 0 | test.rs:130:16:132:9 | BlockExpr | | -| test.rs:135:5:142:5 | enter test_if_assignment | test.rs:136:9:136:26 | LetStmt | | -| test.rs:135:5:142:5 | exit test_if_assignment (normal) | test.rs:135:5:142:5 | exit test_if_assignment | | -| test.rs:135:42:142:5 | BlockExpr | test.rs:135:5:142:5 | exit test_if_assignment (normal) | | -| test.rs:136:9:136:26 | LetStmt | test.rs:136:21:136:25 | false | | -| test.rs:136:13:136:17 | x | test.rs:137:12:137:12 | x | match, no-match | -| test.rs:136:21:136:25 | false | test.rs:136:13:136:17 | x | | -| test.rs:137:9:141:9 | IfExpr | test.rs:135:42:142:5 | BlockExpr | | -| test.rs:137:12:137:12 | x | test.rs:137:16:137:19 | true | | -| test.rs:137:12:137:19 | ... = ... | test.rs:138:13:138:13 | 1 | true | -| test.rs:137:12:137:19 | ... = ... | test.rs:140:13:140:13 | 0 | false | -| test.rs:137:16:137:19 | true | test.rs:137:12:137:19 | ... = ... | | -| test.rs:137:21:139:9 | BlockExpr | test.rs:137:9:141:9 | IfExpr | | -| test.rs:138:13:138:13 | 1 | test.rs:137:21:139:9 | BlockExpr | | -| test.rs:139:16:141:9 | BlockExpr | test.rs:137:9:141:9 | IfExpr | | +| test.rs:65:5:72:5 | enter test_while_let | test.rs:66:9:66:29 | LetStmt | | +| test.rs:66:9:66:29 | LetStmt | test.rs:66:24:66:24 | 1 | | +| test.rs:66:13:66:20 | iter | test.rs:67:15:67:39 | LetExpr | match, no-match | +| test.rs:66:24:66:24 | 1 | test.rs:66:27:66:28 | 10 | | +| test.rs:66:24:66:28 | RangeExpr | test.rs:66:13:66:20 | iter | | +| test.rs:66:27:66:28 | 10 | test.rs:66:24:66:28 | RangeExpr | | +| test.rs:67:15:67:39 | LetExpr | test.rs:67:19:67:25 | TupleStructPat | | +| test.rs:74:5:81:5 | enter test_for | test.rs:75:18:75:18 | 0 | | +| test.rs:74:5:81:5 | exit test_for (normal) | test.rs:74:5:81:5 | exit test_for | | +| test.rs:74:25:81:5 | BlockExpr | test.rs:74:5:81:5 | exit test_for (normal) | | +| test.rs:75:9:80:9 | ForExpr | test.rs:74:25:81:5 | BlockExpr | | +| test.rs:75:13:75:13 | i | test.rs:75:9:80:9 | ForExpr | no-match | +| test.rs:75:13:75:13 | i | test.rs:76:13:78:13 | ExprStmt | match | +| test.rs:75:18:75:18 | 0 | test.rs:75:21:75:22 | 10 | | +| test.rs:75:18:75:22 | RangeExpr | test.rs:75:13:75:13 | i | | +| test.rs:75:21:75:22 | 10 | test.rs:75:18:75:22 | RangeExpr | | +| test.rs:75:24:80:9 | BlockExpr | test.rs:75:13:75:13 | i | | +| test.rs:76:13:78:13 | ExprStmt | test.rs:76:17:76:17 | i | | +| test.rs:76:13:78:13 | IfExpr | test.rs:79:13:79:14 | ExprStmt | | +| test.rs:76:16:76:23 | ParenExpr | test.rs:76:13:78:13 | IfExpr | false | +| test.rs:76:16:76:23 | ParenExpr | test.rs:77:17:77:22 | ExprStmt | true | +| test.rs:76:17:76:17 | i | test.rs:76:22:76:22 | j | | +| test.rs:76:17:76:22 | ... == ... | test.rs:76:16:76:23 | ParenExpr | | +| test.rs:76:22:76:22 | j | test.rs:76:17:76:22 | ... == ... | | +| test.rs:77:17:77:21 | BreakExpr | test.rs:75:9:80:9 | ForExpr | break | +| test.rs:77:17:77:22 | ExprStmt | test.rs:77:17:77:21 | BreakExpr | | +| test.rs:79:13:79:13 | 1 | test.rs:75:24:80:9 | BlockExpr | | +| test.rs:79:13:79:14 | ExprStmt | test.rs:79:13:79:13 | 1 | | +| test.rs:84:1:87:1 | enter test_nested_function | test.rs:85:5:85:28 | LetStmt | | +| test.rs:84:1:87:1 | exit test_nested_function (normal) | test.rs:84:1:87:1 | exit test_nested_function | | +| test.rs:84:40:87:1 | BlockExpr | test.rs:84:1:87:1 | exit test_nested_function (normal) | | +| test.rs:85:5:85:28 | LetStmt | test.rs:85:19:85:27 | ClosureExpr | | +| test.rs:85:9:85:15 | add_one | test.rs:86:5:86:11 | add_one | match, no-match | +| test.rs:85:19:85:27 | ClosureExpr | test.rs:85:9:85:15 | add_one | | +| test.rs:85:19:85:27 | enter ClosureExpr | test.rs:85:23:85:23 | i | | +| test.rs:85:19:85:27 | exit ClosureExpr (normal) | test.rs:85:19:85:27 | exit ClosureExpr | | +| test.rs:85:23:85:23 | i | test.rs:85:27:85:27 | 1 | | +| test.rs:85:23:85:27 | ... + ... | test.rs:85:19:85:27 | exit ClosureExpr (normal) | | +| test.rs:85:27:85:27 | 1 | test.rs:85:23:85:27 | ... + ... | | +| test.rs:86:5:86:11 | add_one | test.rs:86:13:86:19 | add_one | | +| test.rs:86:5:86:23 | CallExpr | test.rs:84:40:87:1 | BlockExpr | | +| test.rs:86:13:86:19 | add_one | test.rs:86:21:86:21 | n | | +| test.rs:86:13:86:22 | CallExpr | test.rs:86:5:86:23 | CallExpr | | +| test.rs:86:21:86:21 | n | test.rs:86:13:86:22 | CallExpr | | +| test.rs:91:5:97:5 | enter test_if_else | test.rs:92:12:92:12 | n | | +| test.rs:91:5:97:5 | exit test_if_else (normal) | test.rs:91:5:97:5 | exit test_if_else | | +| test.rs:91:36:97:5 | BlockExpr | test.rs:91:5:97:5 | exit test_if_else (normal) | | +| test.rs:92:9:96:9 | IfExpr | test.rs:91:36:97:5 | BlockExpr | | +| test.rs:92:12:92:12 | n | test.rs:92:17:92:17 | 0 | | +| test.rs:92:12:92:17 | ... <= ... | test.rs:93:13:93:13 | 0 | true | +| test.rs:92:12:92:17 | ... <= ... | test.rs:95:13:95:13 | n | false | +| test.rs:92:17:92:17 | 0 | test.rs:92:12:92:17 | ... <= ... | | +| test.rs:92:19:94:9 | BlockExpr | test.rs:92:9:96:9 | IfExpr | | +| test.rs:93:13:93:13 | 0 | test.rs:92:19:94:9 | BlockExpr | | +| test.rs:94:16:96:9 | BlockExpr | test.rs:92:9:96:9 | IfExpr | | +| test.rs:95:13:95:13 | n | test.rs:95:17:95:17 | 1 | | +| test.rs:95:13:95:17 | ... - ... | test.rs:94:16:96:9 | BlockExpr | | +| test.rs:95:17:95:17 | 1 | test.rs:95:13:95:17 | ... - ... | | +| test.rs:99:5:105:5 | enter test_if_let_else | test.rs:100:12:100:26 | LetExpr | | +| test.rs:99:5:105:5 | exit test_if_let_else (normal) | test.rs:99:5:105:5 | exit test_if_let_else | | +| test.rs:99:48:105:5 | BlockExpr | test.rs:99:5:105:5 | exit test_if_let_else (normal) | | +| test.rs:100:9:104:9 | IfExpr | test.rs:99:48:105:5 | BlockExpr | | +| test.rs:100:12:100:26 | LetExpr | test.rs:100:16:100:22 | TupleStructPat | | +| test.rs:100:16:100:22 | TupleStructPat | test.rs:101:13:101:13 | n | match | +| test.rs:100:16:100:22 | TupleStructPat | test.rs:103:13:103:13 | 0 | no-match | +| test.rs:100:28:102:9 | BlockExpr | test.rs:100:9:104:9 | IfExpr | | +| test.rs:101:13:101:13 | n | test.rs:100:28:102:9 | BlockExpr | | +| test.rs:102:16:104:9 | BlockExpr | test.rs:100:9:104:9 | IfExpr | | +| test.rs:103:13:103:13 | 0 | test.rs:102:16:104:9 | BlockExpr | | +| test.rs:107:5:112:5 | enter test_if_let | test.rs:108:9:110:9 | ExprStmt | | +| test.rs:107:5:112:5 | exit test_if_let (normal) | test.rs:107:5:112:5 | exit test_if_let | | +| test.rs:107:43:112:5 | BlockExpr | test.rs:107:5:112:5 | exit test_if_let (normal) | | +| test.rs:108:9:110:9 | ExprStmt | test.rs:108:12:108:26 | LetExpr | | +| test.rs:108:9:110:9 | IfExpr | test.rs:111:9:111:9 | 0 | | +| test.rs:108:12:108:26 | LetExpr | test.rs:108:16:108:22 | TupleStructPat | | +| test.rs:108:16:108:22 | TupleStructPat | test.rs:108:9:110:9 | IfExpr | no-match | +| test.rs:108:16:108:22 | TupleStructPat | test.rs:109:13:109:13 | n | match | +| test.rs:108:28:110:9 | BlockExpr | test.rs:108:9:110:9 | IfExpr | | +| test.rs:109:13:109:13 | n | test.rs:108:28:110:9 | BlockExpr | | +| test.rs:111:9:111:9 | 0 | test.rs:107:43:112:5 | BlockExpr | | +| test.rs:114:5:120:5 | enter test_nested_if | test.rs:115:16:115:16 | PathExpr | | +| test.rs:114:5:120:5 | exit test_nested_if (normal) | test.rs:114:5:120:5 | exit test_nested_if | | +| test.rs:114:38:120:5 | BlockExpr | test.rs:114:5:120:5 | exit test_nested_if (normal) | | +| test.rs:115:9:119:9 | IfExpr | test.rs:114:38:120:5 | BlockExpr | | +| test.rs:115:12:115:49 | ParenExpr | test.rs:116:13:116:13 | 1 | true | +| test.rs:115:12:115:49 | ParenExpr | test.rs:118:13:118:13 | 0 | false | +| test.rs:115:13:115:48 | IfExpr | test.rs:115:12:115:49 | ParenExpr | | +| test.rs:115:16:115:16 | PathExpr | test.rs:115:20:115:20 | 0 | | +| test.rs:115:16:115:20 | ... < ... | test.rs:115:24:115:24 | a | true | +| test.rs:115:16:115:20 | ... < ... | test.rs:115:41:115:41 | a | false | +| test.rs:115:20:115:20 | 0 | test.rs:115:16:115:20 | ... < ... | | +| test.rs:115:22:115:32 | BlockExpr | test.rs:115:13:115:48 | IfExpr | | +| test.rs:115:24:115:24 | a | test.rs:115:29:115:30 | 10 | | +| test.rs:115:24:115:30 | ... < ... | test.rs:115:22:115:32 | BlockExpr | | +| test.rs:115:28:115:30 | - ... | test.rs:115:24:115:30 | ... < ... | | +| test.rs:115:29:115:30 | 10 | test.rs:115:28:115:30 | - ... | | +| test.rs:115:39:115:48 | BlockExpr | test.rs:115:13:115:48 | IfExpr | | +| test.rs:115:41:115:41 | a | test.rs:115:45:115:46 | 10 | | +| test.rs:115:41:115:46 | ... > ... | test.rs:115:39:115:48 | BlockExpr | | +| test.rs:115:45:115:46 | 10 | test.rs:115:41:115:46 | ... > ... | | +| test.rs:115:51:117:9 | BlockExpr | test.rs:115:9:119:9 | IfExpr | | +| test.rs:116:13:116:13 | 1 | test.rs:115:51:117:9 | BlockExpr | | +| test.rs:117:16:119:9 | BlockExpr | test.rs:115:9:119:9 | IfExpr | | +| test.rs:118:13:118:13 | 0 | test.rs:117:16:119:9 | BlockExpr | | +| test.rs:122:5:131:5 | enter test_nested_if_match | test.rs:123:19:123:19 | a | | +| test.rs:122:5:131:5 | exit test_nested_if_match (normal) | test.rs:122:5:131:5 | exit test_nested_if_match | | +| test.rs:122:44:131:5 | BlockExpr | test.rs:122:5:131:5 | exit test_nested_if_match (normal) | | +| test.rs:123:9:130:9 | IfExpr | test.rs:122:44:131:5 | BlockExpr | | +| test.rs:123:12:126:10 | ParenExpr | test.rs:127:13:127:13 | 1 | true | +| test.rs:123:12:126:10 | ParenExpr | test.rs:129:13:129:13 | 0 | false | +| test.rs:123:13:126:9 | MatchExpr | test.rs:123:12:126:10 | ParenExpr | | +| test.rs:123:19:123:19 | a | test.rs:124:13:124:13 | LiteralPat | | +| test.rs:124:13:124:13 | LiteralPat | test.rs:124:18:124:21 | true | match | +| test.rs:124:13:124:13 | LiteralPat | test.rs:125:13:125:13 | WildcardPat | no-match | +| test.rs:124:18:124:21 | true | test.rs:123:13:126:9 | MatchExpr | | +| test.rs:125:13:125:13 | WildcardPat | test.rs:125:18:125:22 | false | match | +| test.rs:125:18:125:22 | false | test.rs:123:13:126:9 | MatchExpr | | +| test.rs:126:12:128:9 | BlockExpr | test.rs:123:9:130:9 | IfExpr | | +| test.rs:127:13:127:13 | 1 | test.rs:126:12:128:9 | BlockExpr | | +| test.rs:128:16:130:9 | BlockExpr | test.rs:123:9:130:9 | IfExpr | | +| test.rs:129:13:129:13 | 0 | test.rs:128:16:130:9 | BlockExpr | | +| test.rs:133:5:142:5 | enter test_nested_if_block | test.rs:135:13:135:15 | ExprStmt | | +| test.rs:133:5:142:5 | exit test_nested_if_block (normal) | test.rs:133:5:142:5 | exit test_nested_if_block | | +| test.rs:133:44:142:5 | BlockExpr | test.rs:133:5:142:5 | exit test_nested_if_block (normal) | | +| test.rs:134:9:141:9 | IfExpr | test.rs:133:44:142:5 | BlockExpr | | +| test.rs:134:12:137:9 | BlockExpr | test.rs:138:13:138:13 | 1 | true | +| test.rs:134:12:137:9 | BlockExpr | test.rs:140:13:140:13 | 0 | false | +| test.rs:135:13:135:14 | TupleExpr | test.rs:136:13:136:13 | a | | +| test.rs:135:13:135:15 | ExprStmt | test.rs:135:13:135:14 | TupleExpr | | +| test.rs:136:13:136:13 | a | test.rs:136:17:136:17 | 0 | | +| test.rs:136:13:136:17 | ... > ... | test.rs:134:12:137:9 | BlockExpr | false, true | +| test.rs:136:17:136:17 | 0 | test.rs:136:13:136:17 | ... > ... | | +| test.rs:137:11:139:9 | BlockExpr | test.rs:134:9:141:9 | IfExpr | | +| test.rs:138:13:138:13 | 1 | test.rs:137:11:139:9 | BlockExpr | | +| test.rs:139:16:141:9 | BlockExpr | test.rs:134:9:141:9 | IfExpr | | | test.rs:140:13:140:13 | 0 | test.rs:139:16:141:9 | BlockExpr | | -| test.rs:144:5:155:5 | enter test_if_loop1 | test.rs:146:13:148:14 | ExprStmt | | -| test.rs:144:5:155:5 | exit test_if_loop1 (normal) | test.rs:144:5:155:5 | exit test_if_loop1 | | -| test.rs:144:37:155:5 | BlockExpr | test.rs:144:5:155:5 | exit test_if_loop1 (normal) | | -| test.rs:145:9:154:9 | IfExpr | test.rs:144:37:155:5 | BlockExpr | | -| test.rs:145:12:150:10 | ParenExpr | test.rs:151:13:151:13 | 1 | true | -| test.rs:145:12:150:10 | ParenExpr | test.rs:153:13:153:13 | 0 | false | -| test.rs:145:13:150:9 | LoopExpr | test.rs:145:12:150:10 | ParenExpr | | -| test.rs:145:18:150:9 | BlockExpr | test.rs:146:13:148:14 | ExprStmt | | -| test.rs:146:13:148:13 | IfExpr | test.rs:149:13:149:19 | ExprStmt | | -| test.rs:146:13:148:14 | ExprStmt | test.rs:146:16:146:16 | a | | -| test.rs:146:16:146:16 | a | test.rs:146:20:146:20 | 0 | | -| test.rs:146:16:146:20 | ... > ... | test.rs:146:13:148:13 | IfExpr | false | -| test.rs:146:16:146:20 | ... > ... | test.rs:147:17:147:29 | ExprStmt | true | -| test.rs:146:20:146:20 | 0 | test.rs:146:16:146:20 | ... > ... | | -| test.rs:147:17:147:28 | BreakExpr | test.rs:145:13:150:9 | LoopExpr | break | -| test.rs:147:17:147:29 | ExprStmt | test.rs:147:23:147:23 | a | | -| test.rs:147:23:147:23 | a | test.rs:147:27:147:28 | 10 | | -| test.rs:147:23:147:28 | ... > ... | test.rs:147:17:147:28 | BreakExpr | | -| test.rs:147:27:147:28 | 10 | test.rs:147:23:147:28 | ... > ... | | -| test.rs:149:13:149:13 | a | test.rs:149:17:149:18 | 10 | | -| test.rs:149:13:149:18 | ... < ... | test.rs:145:18:150:9 | BlockExpr | | -| test.rs:149:13:149:19 | ExprStmt | test.rs:149:13:149:13 | a | | -| test.rs:149:17:149:18 | 10 | test.rs:149:13:149:18 | ... < ... | | -| test.rs:150:12:152:9 | BlockExpr | test.rs:145:9:154:9 | IfExpr | | -| test.rs:151:13:151:13 | 1 | test.rs:150:12:152:9 | BlockExpr | | -| test.rs:152:16:154:9 | BlockExpr | test.rs:145:9:154:9 | IfExpr | | -| test.rs:153:13:153:13 | 0 | test.rs:152:16:154:9 | BlockExpr | | -| test.rs:157:5:168:5 | enter test_if_loop2 | test.rs:159:13:161:14 | ExprStmt | | -| test.rs:157:5:168:5 | exit test_if_loop2 (normal) | test.rs:157:5:168:5 | exit test_if_loop2 | | -| test.rs:157:37:168:5 | BlockExpr | test.rs:157:5:168:5 | exit test_if_loop2 (normal) | | -| test.rs:158:9:167:9 | IfExpr | test.rs:157:37:168:5 | BlockExpr | | -| test.rs:158:12:163:10 | ParenExpr | test.rs:164:13:164:13 | 1 | true | -| test.rs:158:12:163:10 | ParenExpr | test.rs:166:13:166:13 | 0 | false | -| test.rs:158:13:163:9 | LoopExpr | test.rs:158:12:163:10 | ParenExpr | | -| test.rs:158:26:163:9 | BlockExpr | test.rs:159:13:161:14 | ExprStmt | | -| test.rs:159:13:161:13 | IfExpr | test.rs:162:13:162:19 | ExprStmt | | -| test.rs:159:13:161:14 | ExprStmt | test.rs:159:16:159:16 | a | | -| test.rs:159:16:159:16 | a | test.rs:159:20:159:20 | 0 | | -| test.rs:159:16:159:20 | ... > ... | test.rs:159:13:161:13 | IfExpr | false | -| test.rs:159:16:159:20 | ... > ... | test.rs:160:17:160:36 | ExprStmt | true | -| test.rs:159:20:159:20 | 0 | test.rs:159:16:159:20 | ... > ... | | -| test.rs:160:17:160:35 | BreakExpr | test.rs:158:13:163:9 | LoopExpr | break('label) | -| test.rs:160:17:160:36 | ExprStmt | test.rs:160:30:160:30 | a | | -| test.rs:160:30:160:30 | a | test.rs:160:34:160:35 | 10 | | -| test.rs:160:30:160:35 | ... > ... | test.rs:160:17:160:35 | BreakExpr | | -| test.rs:160:34:160:35 | 10 | test.rs:160:30:160:35 | ... > ... | | -| test.rs:162:13:162:13 | a | test.rs:162:17:162:18 | 10 | | -| test.rs:162:13:162:18 | ... < ... | test.rs:158:26:163:9 | BlockExpr | | -| test.rs:162:13:162:19 | ExprStmt | test.rs:162:13:162:13 | a | | -| test.rs:162:17:162:18 | 10 | test.rs:162:13:162:18 | ... < ... | | -| test.rs:163:12:165:9 | BlockExpr | test.rs:158:9:167:9 | IfExpr | | -| test.rs:164:13:164:13 | 1 | test.rs:163:12:165:9 | BlockExpr | | -| test.rs:165:16:167:9 | BlockExpr | test.rs:158:9:167:9 | IfExpr | | -| test.rs:166:13:166:13 | 0 | test.rs:165:16:167:9 | BlockExpr | | -| test.rs:170:5:178:5 | enter test_labelled_block | test.rs:172:13:172:31 | ExprStmt | | -| test.rs:170:5:178:5 | exit test_labelled_block (normal) | test.rs:170:5:178:5 | exit test_labelled_block | | -| test.rs:172:13:172:30 | BreakExpr | test.rs:170:5:178:5 | exit test_labelled_block (normal) | break('block) | -| test.rs:172:13:172:31 | ExprStmt | test.rs:172:26:172:26 | a | | -| test.rs:172:26:172:26 | a | test.rs:172:30:172:30 | 0 | | -| test.rs:172:26:172:30 | ... > ... | test.rs:172:13:172:30 | BreakExpr | | -| test.rs:172:30:172:30 | 0 | test.rs:172:26:172:30 | ... > ... | | -| test.rs:183:5:186:5 | enter test_and_operator | test.rs:184:9:184:28 | LetStmt | | -| test.rs:183:5:186:5 | exit test_and_operator (normal) | test.rs:183:5:186:5 | exit test_and_operator | | -| test.rs:183:61:186:5 | BlockExpr | test.rs:183:5:186:5 | exit test_and_operator (normal) | | -| test.rs:184:9:184:28 | LetStmt | test.rs:184:17:184:27 | ... && ... | | -| test.rs:184:13:184:13 | d | test.rs:185:9:185:9 | d | match, no-match | -| test.rs:184:17:184:17 | a | test.rs:184:13:184:13 | d | false | -| test.rs:184:17:184:17 | a | test.rs:184:22:184:22 | b | true | -| test.rs:184:17:184:22 | ... && ... | test.rs:184:17:184:17 | a | | -| test.rs:184:17:184:27 | ... && ... | test.rs:184:17:184:22 | ... && ... | | -| test.rs:184:22:184:22 | b | test.rs:184:13:184:13 | d | false | -| test.rs:184:22:184:22 | b | test.rs:184:27:184:27 | c | true | -| test.rs:184:27:184:27 | c | test.rs:184:13:184:13 | d | | -| test.rs:185:9:185:9 | d | test.rs:183:61:186:5 | BlockExpr | | -| test.rs:188:5:191:5 | enter test_or_operator | test.rs:189:9:189:28 | LetStmt | | -| test.rs:188:5:191:5 | exit test_or_operator (normal) | test.rs:188:5:191:5 | exit test_or_operator | | -| test.rs:188:60:191:5 | BlockExpr | test.rs:188:5:191:5 | exit test_or_operator (normal) | | -| test.rs:189:9:189:28 | LetStmt | test.rs:189:17:189:27 | ... \|\| ... | | -| test.rs:189:13:189:13 | d | test.rs:190:9:190:9 | d | match, no-match | -| test.rs:189:17:189:17 | a | test.rs:189:13:189:13 | d | true | -| test.rs:189:17:189:17 | a | test.rs:189:22:189:22 | b | false | -| test.rs:189:17:189:22 | ... \|\| ... | test.rs:189:17:189:17 | a | | -| test.rs:189:17:189:27 | ... \|\| ... | test.rs:189:17:189:22 | ... \|\| ... | | -| test.rs:189:22:189:22 | b | test.rs:189:13:189:13 | d | true | -| test.rs:189:22:189:22 | b | test.rs:189:27:189:27 | c | false | -| test.rs:189:27:189:27 | c | test.rs:189:13:189:13 | d | | -| test.rs:190:9:190:9 | d | test.rs:188:60:191:5 | BlockExpr | | -| test.rs:193:5:196:5 | enter test_or_operator_2 | test.rs:194:9:194:36 | LetStmt | | -| test.rs:193:5:196:5 | exit test_or_operator_2 (normal) | test.rs:193:5:196:5 | exit test_or_operator_2 | | -| test.rs:193:61:196:5 | BlockExpr | test.rs:193:5:196:5 | exit test_or_operator_2 (normal) | | -| test.rs:194:9:194:36 | LetStmt | test.rs:194:17:194:35 | ... \|\| ... | | -| test.rs:194:13:194:13 | d | test.rs:195:9:195:9 | d | match, no-match | -| test.rs:194:17:194:17 | a | test.rs:194:13:194:13 | d | true | -| test.rs:194:17:194:17 | a | test.rs:194:23:194:23 | b | false | -| test.rs:194:17:194:30 | ... \|\| ... | test.rs:194:17:194:17 | a | | -| test.rs:194:17:194:35 | ... \|\| ... | test.rs:194:17:194:30 | ... \|\| ... | | -| test.rs:194:22:194:30 | ParenExpr | test.rs:194:13:194:13 | d | true | -| test.rs:194:22:194:30 | ParenExpr | test.rs:194:35:194:35 | c | false | -| test.rs:194:23:194:23 | b | test.rs:194:28:194:29 | 28 | | -| test.rs:194:23:194:29 | ... == ... | test.rs:194:22:194:30 | ParenExpr | | -| test.rs:194:28:194:29 | 28 | test.rs:194:23:194:29 | ... == ... | | -| test.rs:194:35:194:35 | c | test.rs:194:13:194:13 | d | | -| test.rs:195:9:195:9 | d | test.rs:193:61:196:5 | BlockExpr | | -| test.rs:198:5:201:5 | enter test_not_operator | test.rs:199:9:199:19 | LetStmt | | -| test.rs:198:5:201:5 | exit test_not_operator (normal) | test.rs:198:5:201:5 | exit test_not_operator | | -| test.rs:198:43:201:5 | BlockExpr | test.rs:198:5:201:5 | exit test_not_operator (normal) | | -| test.rs:199:9:199:19 | LetStmt | test.rs:199:18:199:18 | a | | -| test.rs:199:13:199:13 | d | test.rs:200:9:200:9 | d | match, no-match | -| test.rs:199:17:199:18 | ! ... | test.rs:199:13:199:13 | d | | -| test.rs:199:18:199:18 | a | test.rs:199:17:199:18 | ! ... | | -| test.rs:200:9:200:9 | d | test.rs:198:43:201:5 | BlockExpr | | -| test.rs:203:5:209:5 | enter test_if_and_operator | test.rs:204:12:204:22 | ... && ... | | -| test.rs:203:5:209:5 | exit test_if_and_operator (normal) | test.rs:203:5:209:5 | exit test_if_and_operator | | -| test.rs:203:63:209:5 | BlockExpr | test.rs:203:5:209:5 | exit test_if_and_operator (normal) | | -| test.rs:204:9:208:9 | IfExpr | test.rs:203:63:209:5 | BlockExpr | | -| test.rs:204:12:204:12 | a | test.rs:204:17:204:17 | b | true | -| test.rs:204:12:204:12 | a | test.rs:207:13:207:17 | false | false | -| test.rs:204:12:204:17 | ... && ... | test.rs:204:12:204:12 | a | | -| test.rs:204:12:204:22 | ... && ... | test.rs:204:12:204:17 | ... && ... | | -| test.rs:204:17:204:17 | b | test.rs:204:22:204:22 | c | true | -| test.rs:204:17:204:17 | b | test.rs:207:13:207:17 | false | false | -| test.rs:204:22:204:22 | c | test.rs:205:13:205:16 | true | true | -| test.rs:204:22:204:22 | c | test.rs:207:13:207:17 | false | false | -| test.rs:204:24:206:9 | BlockExpr | test.rs:204:9:208:9 | IfExpr | | -| test.rs:205:13:205:16 | true | test.rs:204:24:206:9 | BlockExpr | | -| test.rs:206:16:208:9 | BlockExpr | test.rs:204:9:208:9 | IfExpr | | -| test.rs:207:13:207:17 | false | test.rs:206:16:208:9 | BlockExpr | | -| test.rs:211:5:217:5 | enter test_if_or_operator | test.rs:212:12:212:22 | ... \|\| ... | | -| test.rs:211:5:217:5 | exit test_if_or_operator (normal) | test.rs:211:5:217:5 | exit test_if_or_operator | | -| test.rs:211:62:217:5 | BlockExpr | test.rs:211:5:217:5 | exit test_if_or_operator (normal) | | -| test.rs:212:9:216:9 | IfExpr | test.rs:211:62:217:5 | BlockExpr | | -| test.rs:212:12:212:12 | a | test.rs:212:17:212:17 | b | false | -| test.rs:212:12:212:12 | a | test.rs:213:13:213:16 | true | true | -| test.rs:212:12:212:17 | ... \|\| ... | test.rs:212:12:212:12 | a | | -| test.rs:212:12:212:22 | ... \|\| ... | test.rs:212:12:212:17 | ... \|\| ... | | -| test.rs:212:17:212:17 | b | test.rs:212:22:212:22 | c | false | -| test.rs:212:17:212:17 | b | test.rs:213:13:213:16 | true | true | -| test.rs:212:22:212:22 | c | test.rs:213:13:213:16 | true | true | -| test.rs:212:22:212:22 | c | test.rs:215:13:215:17 | false | false | -| test.rs:212:24:214:9 | BlockExpr | test.rs:212:9:216:9 | IfExpr | | -| test.rs:213:13:213:16 | true | test.rs:212:24:214:9 | BlockExpr | | -| test.rs:214:16:216:9 | BlockExpr | test.rs:212:9:216:9 | IfExpr | | -| test.rs:215:13:215:17 | false | test.rs:214:16:216:9 | BlockExpr | | -| test.rs:219:5:225:5 | enter test_if_not_operator | test.rs:220:13:220:13 | a | | -| test.rs:219:5:225:5 | exit test_if_not_operator (normal) | test.rs:219:5:225:5 | exit test_if_not_operator | | -| test.rs:219:46:225:5 | BlockExpr | test.rs:219:5:225:5 | exit test_if_not_operator (normal) | | -| test.rs:220:9:224:9 | IfExpr | test.rs:219:46:225:5 | BlockExpr | | -| test.rs:220:12:220:13 | ! ... | test.rs:221:13:221:16 | true | true | -| test.rs:220:12:220:13 | ! ... | test.rs:223:13:223:17 | false | false | -| test.rs:220:13:220:13 | a | test.rs:220:12:220:13 | ! ... | false, true | -| test.rs:220:15:222:9 | BlockExpr | test.rs:220:9:224:9 | IfExpr | | -| test.rs:221:13:221:16 | true | test.rs:220:15:222:9 | BlockExpr | | -| test.rs:222:16:224:9 | BlockExpr | test.rs:220:9:224:9 | IfExpr | | -| test.rs:223:13:223:17 | false | test.rs:222:16:224:9 | BlockExpr | | -| test.rs:228:1:234:1 | enter test_match | test.rs:229:11:229:21 | maybe_digit | | -| test.rs:228:1:234:1 | exit test_match (normal) | test.rs:228:1:234:1 | exit test_match | | -| test.rs:228:48:234:1 | BlockExpr | test.rs:228:1:234:1 | exit test_match (normal) | | -| test.rs:229:5:233:5 | MatchExpr | test.rs:228:48:234:1 | BlockExpr | | -| test.rs:229:11:229:21 | maybe_digit | test.rs:230:9:230:23 | TupleStructPat | | -| test.rs:230:9:230:23 | TupleStructPat | test.rs:230:28:230:28 | x | match | -| test.rs:230:9:230:23 | TupleStructPat | test.rs:231:9:231:23 | TupleStructPat | no-match | -| test.rs:230:28:230:28 | x | test.rs:230:32:230:33 | 10 | | -| test.rs:230:28:230:33 | ... < ... | test.rs:230:38:230:38 | x | true | -| test.rs:230:28:230:33 | ... < ... | test.rs:231:9:231:23 | TupleStructPat | false | -| test.rs:230:32:230:33 | 10 | test.rs:230:28:230:33 | ... < ... | | -| test.rs:230:38:230:38 | x | test.rs:230:42:230:42 | 5 | | -| test.rs:230:38:230:42 | ... + ... | test.rs:229:5:233:5 | MatchExpr | | -| test.rs:230:42:230:42 | 5 | test.rs:230:38:230:42 | ... + ... | | -| test.rs:231:9:231:23 | TupleStructPat | test.rs:231:28:231:28 | x | match | -| test.rs:231:9:231:23 | TupleStructPat | test.rs:232:9:232:20 | PathPat | no-match | -| test.rs:231:28:231:28 | x | test.rs:229:5:233:5 | MatchExpr | | -| test.rs:232:9:232:20 | PathPat | test.rs:232:25:232:25 | 5 | match | -| test.rs:232:25:232:25 | 5 | test.rs:229:5:233:5 | MatchExpr | | -| test.rs:237:5:242:5 | enter test_infinite_loop | test.rs:238:9:240:9 | ExprStmt | | -| test.rs:238:9:240:9 | ExprStmt | test.rs:239:13:239:13 | 1 | | -| test.rs:238:14:240:9 | BlockExpr | test.rs:239:13:239:13 | 1 | | -| test.rs:239:13:239:13 | 1 | test.rs:238:14:240:9 | BlockExpr | | -| test.rs:244:5:247:5 | enter test_let_match | test.rs:245:9:245:49 | LetStmt | | -| test.rs:244:5:247:5 | exit test_let_match (normal) | test.rs:244:5:247:5 | exit test_let_match | | -| test.rs:244:39:247:5 | BlockExpr | test.rs:244:5:247:5 | exit test_let_match (normal) | | -| test.rs:245:9:245:49 | LetStmt | test.rs:245:23:245:23 | a | | -| test.rs:245:13:245:19 | TupleStructPat | test.rs:245:32:245:46 | "Expected some" | no-match | -| test.rs:245:13:245:19 | TupleStructPat | test.rs:246:9:246:9 | n | match | -| test.rs:245:23:245:23 | a | test.rs:245:13:245:19 | TupleStructPat | | -| test.rs:245:32:245:46 | "Expected some" | test.rs:245:30:245:48 | BlockExpr | | -| test.rs:246:9:246:9 | n | test.rs:244:39:247:5 | BlockExpr | | -| test.rs:250:1:255:1 | enter dead_code | test.rs:251:5:253:5 | ExprStmt | | -| test.rs:250:1:255:1 | exit dead_code (normal) | test.rs:250:1:255:1 | exit dead_code | | -| test.rs:251:5:253:5 | ExprStmt | test.rs:251:9:251:12 | true | | -| test.rs:251:8:251:13 | ParenExpr | test.rs:252:9:252:17 | ExprStmt | true | -| test.rs:251:9:251:12 | true | test.rs:251:8:251:13 | ParenExpr | | -| test.rs:252:9:252:16 | ReturnExpr | test.rs:250:1:255:1 | exit dead_code (normal) | return | -| test.rs:252:9:252:17 | ExprStmt | test.rs:252:16:252:16 | 0 | | -| test.rs:252:16:252:16 | 0 | test.rs:252:9:252:16 | ReturnExpr | | -| test.rs:257:1:270:1 | enter labelled_block | test.rs:258:5:269:6 | LetStmt | | -| test.rs:257:1:270:1 | exit labelled_block (normal) | test.rs:257:1:270:1 | exit labelled_block | | -| test.rs:257:28:270:1 | BlockExpr | test.rs:257:1:270:1 | exit labelled_block (normal) | | -| test.rs:258:5:269:6 | LetStmt | test.rs:259:9:259:19 | ExprStmt | | -| test.rs:258:9:258:14 | result | test.rs:257:28:270:1 | BlockExpr | match, no-match | -| test.rs:258:18:269:5 | BlockExpr | test.rs:258:9:258:14 | result | | -| test.rs:259:9:259:16 | PathExpr | test.rs:259:9:259:18 | CallExpr | | -| test.rs:259:9:259:18 | CallExpr | test.rs:260:9:262:9 | ExprStmt | | -| test.rs:259:9:259:19 | ExprStmt | test.rs:259:9:259:16 | PathExpr | | -| test.rs:260:9:262:9 | ExprStmt | test.rs:260:12:260:28 | PathExpr | | -| test.rs:260:9:262:9 | IfExpr | test.rs:263:9:263:24 | ExprStmt | | -| test.rs:260:12:260:28 | PathExpr | test.rs:260:12:260:30 | CallExpr | | -| test.rs:260:12:260:30 | CallExpr | test.rs:260:9:262:9 | IfExpr | false | -| test.rs:260:12:260:30 | CallExpr | test.rs:261:13:261:27 | ExprStmt | true | -| test.rs:261:13:261:26 | BreakExpr | test.rs:257:1:270:1 | exit labelled_block (normal) | break('block) | -| test.rs:261:13:261:27 | ExprStmt | test.rs:261:26:261:26 | 1 | | -| test.rs:261:26:261:26 | 1 | test.rs:261:13:261:26 | BreakExpr | | -| test.rs:263:9:263:21 | PathExpr | test.rs:263:9:263:23 | CallExpr | | -| test.rs:263:9:263:23 | CallExpr | test.rs:264:9:266:9 | ExprStmt | | -| test.rs:263:9:263:24 | ExprStmt | test.rs:263:9:263:21 | PathExpr | | -| test.rs:264:9:266:9 | ExprStmt | test.rs:264:12:264:28 | PathExpr | | -| test.rs:264:9:266:9 | IfExpr | test.rs:267:9:267:24 | ExprStmt | | -| test.rs:264:12:264:28 | PathExpr | test.rs:264:12:264:30 | CallExpr | | -| test.rs:264:12:264:30 | CallExpr | test.rs:264:9:266:9 | IfExpr | false | -| test.rs:264:12:264:30 | CallExpr | test.rs:265:13:265:27 | ExprStmt | true | -| test.rs:265:13:265:26 | BreakExpr | test.rs:257:1:270:1 | exit labelled_block (normal) | break('block) | -| test.rs:265:13:265:27 | ExprStmt | test.rs:265:26:265:26 | 2 | | -| test.rs:265:26:265:26 | 2 | test.rs:265:13:265:26 | BreakExpr | | -| test.rs:267:9:267:21 | PathExpr | test.rs:267:9:267:23 | CallExpr | | -| test.rs:267:9:267:23 | CallExpr | test.rs:268:9:268:9 | 3 | | -| test.rs:267:9:267:24 | ExprStmt | test.rs:267:9:267:21 | PathExpr | | -| test.rs:268:9:268:9 | 3 | test.rs:258:18:269:5 | BlockExpr | | +| test.rs:144:5:151:5 | enter test_if_assignment | test.rs:145:9:145:26 | LetStmt | | +| test.rs:144:5:151:5 | exit test_if_assignment (normal) | test.rs:144:5:151:5 | exit test_if_assignment | | +| test.rs:144:42:151:5 | BlockExpr | test.rs:144:5:151:5 | exit test_if_assignment (normal) | | +| test.rs:145:9:145:26 | LetStmt | test.rs:145:21:145:25 | false | | +| test.rs:145:13:145:17 | x | test.rs:146:12:146:12 | x | match, no-match | +| test.rs:145:21:145:25 | false | test.rs:145:13:145:17 | x | | +| test.rs:146:9:150:9 | IfExpr | test.rs:144:42:151:5 | BlockExpr | | +| test.rs:146:12:146:12 | x | test.rs:146:16:146:19 | true | | +| test.rs:146:12:146:19 | ... = ... | test.rs:147:13:147:13 | 1 | true | +| test.rs:146:12:146:19 | ... = ... | test.rs:149:13:149:13 | 0 | false | +| test.rs:146:16:146:19 | true | test.rs:146:12:146:19 | ... = ... | | +| test.rs:146:21:148:9 | BlockExpr | test.rs:146:9:150:9 | IfExpr | | +| test.rs:147:13:147:13 | 1 | test.rs:146:21:148:9 | BlockExpr | | +| test.rs:148:16:150:9 | BlockExpr | test.rs:146:9:150:9 | IfExpr | | +| test.rs:149:13:149:13 | 0 | test.rs:148:16:150:9 | BlockExpr | | +| test.rs:153:5:164:5 | enter test_if_loop1 | test.rs:155:13:157:14 | ExprStmt | | +| test.rs:153:5:164:5 | exit test_if_loop1 (normal) | test.rs:153:5:164:5 | exit test_if_loop1 | | +| test.rs:153:37:164:5 | BlockExpr | test.rs:153:5:164:5 | exit test_if_loop1 (normal) | | +| test.rs:154:9:163:9 | IfExpr | test.rs:153:37:164:5 | BlockExpr | | +| test.rs:154:12:159:10 | ParenExpr | test.rs:160:13:160:13 | 1 | true | +| test.rs:154:12:159:10 | ParenExpr | test.rs:162:13:162:13 | 0 | false | +| test.rs:154:13:159:9 | LoopExpr | test.rs:154:12:159:10 | ParenExpr | | +| test.rs:154:18:159:9 | BlockExpr | test.rs:155:13:157:14 | ExprStmt | | +| test.rs:155:13:157:13 | IfExpr | test.rs:158:13:158:19 | ExprStmt | | +| test.rs:155:13:157:14 | ExprStmt | test.rs:155:16:155:16 | a | | +| test.rs:155:16:155:16 | a | test.rs:155:20:155:20 | 0 | | +| test.rs:155:16:155:20 | ... > ... | test.rs:155:13:157:13 | IfExpr | false | +| test.rs:155:16:155:20 | ... > ... | test.rs:156:17:156:29 | ExprStmt | true | +| test.rs:155:20:155:20 | 0 | test.rs:155:16:155:20 | ... > ... | | +| test.rs:156:17:156:28 | BreakExpr | test.rs:154:13:159:9 | LoopExpr | break | +| test.rs:156:17:156:29 | ExprStmt | test.rs:156:23:156:23 | a | | +| test.rs:156:23:156:23 | a | test.rs:156:27:156:28 | 10 | | +| test.rs:156:23:156:28 | ... > ... | test.rs:156:17:156:28 | BreakExpr | | +| test.rs:156:27:156:28 | 10 | test.rs:156:23:156:28 | ... > ... | | +| test.rs:158:13:158:13 | a | test.rs:158:17:158:18 | 10 | | +| test.rs:158:13:158:18 | ... < ... | test.rs:154:18:159:9 | BlockExpr | | +| test.rs:158:13:158:19 | ExprStmt | test.rs:158:13:158:13 | a | | +| test.rs:158:17:158:18 | 10 | test.rs:158:13:158:18 | ... < ... | | +| test.rs:159:12:161:9 | BlockExpr | test.rs:154:9:163:9 | IfExpr | | +| test.rs:160:13:160:13 | 1 | test.rs:159:12:161:9 | BlockExpr | | +| test.rs:161:16:163:9 | BlockExpr | test.rs:154:9:163:9 | IfExpr | | +| test.rs:162:13:162:13 | 0 | test.rs:161:16:163:9 | BlockExpr | | +| test.rs:166:5:177:5 | enter test_if_loop2 | test.rs:168:13:170:14 | ExprStmt | | +| test.rs:166:5:177:5 | exit test_if_loop2 (normal) | test.rs:166:5:177:5 | exit test_if_loop2 | | +| test.rs:166:37:177:5 | BlockExpr | test.rs:166:5:177:5 | exit test_if_loop2 (normal) | | +| test.rs:167:9:176:9 | IfExpr | test.rs:166:37:177:5 | BlockExpr | | +| test.rs:167:12:172:10 | ParenExpr | test.rs:173:13:173:13 | 1 | true | +| test.rs:167:12:172:10 | ParenExpr | test.rs:175:13:175:13 | 0 | false | +| test.rs:167:13:172:9 | LoopExpr | test.rs:167:12:172:10 | ParenExpr | | +| test.rs:167:26:172:9 | BlockExpr | test.rs:168:13:170:14 | ExprStmt | | +| test.rs:168:13:170:13 | IfExpr | test.rs:171:13:171:19 | ExprStmt | | +| test.rs:168:13:170:14 | ExprStmt | test.rs:168:16:168:16 | a | | +| test.rs:168:16:168:16 | a | test.rs:168:20:168:20 | 0 | | +| test.rs:168:16:168:20 | ... > ... | test.rs:168:13:170:13 | IfExpr | false | +| test.rs:168:16:168:20 | ... > ... | test.rs:169:17:169:36 | ExprStmt | true | +| test.rs:168:20:168:20 | 0 | test.rs:168:16:168:20 | ... > ... | | +| test.rs:169:17:169:35 | BreakExpr | test.rs:167:13:172:9 | LoopExpr | break('label) | +| test.rs:169:17:169:36 | ExprStmt | test.rs:169:30:169:30 | a | | +| test.rs:169:30:169:30 | a | test.rs:169:34:169:35 | 10 | | +| test.rs:169:30:169:35 | ... > ... | test.rs:169:17:169:35 | BreakExpr | | +| test.rs:169:34:169:35 | 10 | test.rs:169:30:169:35 | ... > ... | | +| test.rs:171:13:171:13 | a | test.rs:171:17:171:18 | 10 | | +| test.rs:171:13:171:18 | ... < ... | test.rs:167:26:172:9 | BlockExpr | | +| test.rs:171:13:171:19 | ExprStmt | test.rs:171:13:171:13 | a | | +| test.rs:171:17:171:18 | 10 | test.rs:171:13:171:18 | ... < ... | | +| test.rs:172:12:174:9 | BlockExpr | test.rs:167:9:176:9 | IfExpr | | +| test.rs:173:13:173:13 | 1 | test.rs:172:12:174:9 | BlockExpr | | +| test.rs:174:16:176:9 | BlockExpr | test.rs:167:9:176:9 | IfExpr | | +| test.rs:175:13:175:13 | 0 | test.rs:174:16:176:9 | BlockExpr | | +| test.rs:179:5:187:5 | enter test_labelled_block | test.rs:181:13:181:31 | ExprStmt | | +| test.rs:179:5:187:5 | exit test_labelled_block (normal) | test.rs:179:5:187:5 | exit test_labelled_block | | +| test.rs:181:13:181:30 | BreakExpr | test.rs:179:5:187:5 | exit test_labelled_block (normal) | break('block) | +| test.rs:181:13:181:31 | ExprStmt | test.rs:181:26:181:26 | a | | +| test.rs:181:26:181:26 | a | test.rs:181:30:181:30 | 0 | | +| test.rs:181:26:181:30 | ... > ... | test.rs:181:13:181:30 | BreakExpr | | +| test.rs:181:30:181:30 | 0 | test.rs:181:26:181:30 | ... > ... | | +| test.rs:192:5:195:5 | enter test_and_operator | test.rs:193:9:193:28 | LetStmt | | +| test.rs:192:5:195:5 | exit test_and_operator (normal) | test.rs:192:5:195:5 | exit test_and_operator | | +| test.rs:192:61:195:5 | BlockExpr | test.rs:192:5:195:5 | exit test_and_operator (normal) | | +| test.rs:193:9:193:28 | LetStmt | test.rs:193:17:193:27 | ... && ... | | +| test.rs:193:13:193:13 | d | test.rs:194:9:194:9 | d | match, no-match | +| test.rs:193:17:193:17 | a | test.rs:193:13:193:13 | d | false | +| test.rs:193:17:193:17 | a | test.rs:193:22:193:22 | b | true | +| test.rs:193:17:193:22 | ... && ... | test.rs:193:17:193:17 | a | | +| test.rs:193:17:193:27 | ... && ... | test.rs:193:17:193:22 | ... && ... | | +| test.rs:193:22:193:22 | b | test.rs:193:13:193:13 | d | false | +| test.rs:193:22:193:22 | b | test.rs:193:27:193:27 | c | true | +| test.rs:193:27:193:27 | c | test.rs:193:13:193:13 | d | | +| test.rs:194:9:194:9 | d | test.rs:192:61:195:5 | BlockExpr | | +| test.rs:197:5:200:5 | enter test_or_operator | test.rs:198:9:198:28 | LetStmt | | +| test.rs:197:5:200:5 | exit test_or_operator (normal) | test.rs:197:5:200:5 | exit test_or_operator | | +| test.rs:197:60:200:5 | BlockExpr | test.rs:197:5:200:5 | exit test_or_operator (normal) | | +| test.rs:198:9:198:28 | LetStmt | test.rs:198:17:198:27 | ... \|\| ... | | +| test.rs:198:13:198:13 | d | test.rs:199:9:199:9 | d | match, no-match | +| test.rs:198:17:198:17 | a | test.rs:198:13:198:13 | d | true | +| test.rs:198:17:198:17 | a | test.rs:198:22:198:22 | b | false | +| test.rs:198:17:198:22 | ... \|\| ... | test.rs:198:17:198:17 | a | | +| test.rs:198:17:198:27 | ... \|\| ... | test.rs:198:17:198:22 | ... \|\| ... | | +| test.rs:198:22:198:22 | b | test.rs:198:13:198:13 | d | true | +| test.rs:198:22:198:22 | b | test.rs:198:27:198:27 | c | false | +| test.rs:198:27:198:27 | c | test.rs:198:13:198:13 | d | | +| test.rs:199:9:199:9 | d | test.rs:197:60:200:5 | BlockExpr | | +| test.rs:202:5:205:5 | enter test_or_operator_2 | test.rs:203:9:203:36 | LetStmt | | +| test.rs:202:5:205:5 | exit test_or_operator_2 (normal) | test.rs:202:5:205:5 | exit test_or_operator_2 | | +| test.rs:202:61:205:5 | BlockExpr | test.rs:202:5:205:5 | exit test_or_operator_2 (normal) | | +| test.rs:203:9:203:36 | LetStmt | test.rs:203:17:203:35 | ... \|\| ... | | +| test.rs:203:13:203:13 | d | test.rs:204:9:204:9 | d | match, no-match | +| test.rs:203:17:203:17 | a | test.rs:203:13:203:13 | d | true | +| test.rs:203:17:203:17 | a | test.rs:203:23:203:23 | b | false | +| test.rs:203:17:203:30 | ... \|\| ... | test.rs:203:17:203:17 | a | | +| test.rs:203:17:203:35 | ... \|\| ... | test.rs:203:17:203:30 | ... \|\| ... | | +| test.rs:203:22:203:30 | ParenExpr | test.rs:203:13:203:13 | d | true | +| test.rs:203:22:203:30 | ParenExpr | test.rs:203:35:203:35 | c | false | +| test.rs:203:23:203:23 | b | test.rs:203:28:203:29 | 28 | | +| test.rs:203:23:203:29 | ... == ... | test.rs:203:22:203:30 | ParenExpr | | +| test.rs:203:28:203:29 | 28 | test.rs:203:23:203:29 | ... == ... | | +| test.rs:203:35:203:35 | c | test.rs:203:13:203:13 | d | | +| test.rs:204:9:204:9 | d | test.rs:202:61:205:5 | BlockExpr | | +| test.rs:207:5:210:5 | enter test_not_operator | test.rs:208:9:208:19 | LetStmt | | +| test.rs:207:5:210:5 | exit test_not_operator (normal) | test.rs:207:5:210:5 | exit test_not_operator | | +| test.rs:207:43:210:5 | BlockExpr | test.rs:207:5:210:5 | exit test_not_operator (normal) | | +| test.rs:208:9:208:19 | LetStmt | test.rs:208:18:208:18 | a | | +| test.rs:208:13:208:13 | d | test.rs:209:9:209:9 | d | match, no-match | +| test.rs:208:17:208:18 | ! ... | test.rs:208:13:208:13 | d | | +| test.rs:208:18:208:18 | a | test.rs:208:17:208:18 | ! ... | | +| test.rs:209:9:209:9 | d | test.rs:207:43:210:5 | BlockExpr | | +| test.rs:212:5:218:5 | enter test_if_and_operator | test.rs:213:12:213:22 | ... && ... | | +| test.rs:212:5:218:5 | exit test_if_and_operator (normal) | test.rs:212:5:218:5 | exit test_if_and_operator | | +| test.rs:212:63:218:5 | BlockExpr | test.rs:212:5:218:5 | exit test_if_and_operator (normal) | | +| test.rs:213:9:217:9 | IfExpr | test.rs:212:63:218:5 | BlockExpr | | +| test.rs:213:12:213:12 | a | test.rs:213:17:213:17 | b | true | +| test.rs:213:12:213:12 | a | test.rs:216:13:216:17 | false | false | +| test.rs:213:12:213:17 | ... && ... | test.rs:213:12:213:12 | a | | +| test.rs:213:12:213:22 | ... && ... | test.rs:213:12:213:17 | ... && ... | | +| test.rs:213:17:213:17 | b | test.rs:213:22:213:22 | c | true | +| test.rs:213:17:213:17 | b | test.rs:216:13:216:17 | false | false | +| test.rs:213:22:213:22 | c | test.rs:214:13:214:16 | true | true | +| test.rs:213:22:213:22 | c | test.rs:216:13:216:17 | false | false | +| test.rs:213:24:215:9 | BlockExpr | test.rs:213:9:217:9 | IfExpr | | +| test.rs:214:13:214:16 | true | test.rs:213:24:215:9 | BlockExpr | | +| test.rs:215:16:217:9 | BlockExpr | test.rs:213:9:217:9 | IfExpr | | +| test.rs:216:13:216:17 | false | test.rs:215:16:217:9 | BlockExpr | | +| test.rs:220:5:226:5 | enter test_if_or_operator | test.rs:221:12:221:22 | ... \|\| ... | | +| test.rs:220:5:226:5 | exit test_if_or_operator (normal) | test.rs:220:5:226:5 | exit test_if_or_operator | | +| test.rs:220:62:226:5 | BlockExpr | test.rs:220:5:226:5 | exit test_if_or_operator (normal) | | +| test.rs:221:9:225:9 | IfExpr | test.rs:220:62:226:5 | BlockExpr | | +| test.rs:221:12:221:12 | a | test.rs:221:17:221:17 | b | false | +| test.rs:221:12:221:12 | a | test.rs:222:13:222:16 | true | true | +| test.rs:221:12:221:17 | ... \|\| ... | test.rs:221:12:221:12 | a | | +| test.rs:221:12:221:22 | ... \|\| ... | test.rs:221:12:221:17 | ... \|\| ... | | +| test.rs:221:17:221:17 | b | test.rs:221:22:221:22 | c | false | +| test.rs:221:17:221:17 | b | test.rs:222:13:222:16 | true | true | +| test.rs:221:22:221:22 | c | test.rs:222:13:222:16 | true | true | +| test.rs:221:22:221:22 | c | test.rs:224:13:224:17 | false | false | +| test.rs:221:24:223:9 | BlockExpr | test.rs:221:9:225:9 | IfExpr | | +| test.rs:222:13:222:16 | true | test.rs:221:24:223:9 | BlockExpr | | +| test.rs:223:16:225:9 | BlockExpr | test.rs:221:9:225:9 | IfExpr | | +| test.rs:224:13:224:17 | false | test.rs:223:16:225:9 | BlockExpr | | +| test.rs:228:5:234:5 | enter test_if_not_operator | test.rs:229:13:229:13 | a | | +| test.rs:228:5:234:5 | exit test_if_not_operator (normal) | test.rs:228:5:234:5 | exit test_if_not_operator | | +| test.rs:228:46:234:5 | BlockExpr | test.rs:228:5:234:5 | exit test_if_not_operator (normal) | | +| test.rs:229:9:233:9 | IfExpr | test.rs:228:46:234:5 | BlockExpr | | +| test.rs:229:12:229:13 | ! ... | test.rs:230:13:230:16 | true | true | +| test.rs:229:12:229:13 | ! ... | test.rs:232:13:232:17 | false | false | +| test.rs:229:13:229:13 | a | test.rs:229:12:229:13 | ! ... | false, true | +| test.rs:229:15:231:9 | BlockExpr | test.rs:229:9:233:9 | IfExpr | | +| test.rs:230:13:230:16 | true | test.rs:229:15:231:9 | BlockExpr | | +| test.rs:231:16:233:9 | BlockExpr | test.rs:229:9:233:9 | IfExpr | | +| test.rs:232:13:232:17 | false | test.rs:231:16:233:9 | BlockExpr | | +| test.rs:237:1:243:1 | enter test_match | test.rs:238:11:238:21 | maybe_digit | | +| test.rs:237:1:243:1 | exit test_match (normal) | test.rs:237:1:243:1 | exit test_match | | +| test.rs:237:48:243:1 | BlockExpr | test.rs:237:1:243:1 | exit test_match (normal) | | +| test.rs:238:5:242:5 | MatchExpr | test.rs:237:48:243:1 | BlockExpr | | +| test.rs:238:11:238:21 | maybe_digit | test.rs:239:9:239:23 | TupleStructPat | | +| test.rs:239:9:239:23 | TupleStructPat | test.rs:239:28:239:28 | x | match | +| test.rs:239:9:239:23 | TupleStructPat | test.rs:240:9:240:23 | TupleStructPat | no-match | +| test.rs:239:28:239:28 | x | test.rs:239:32:239:33 | 10 | | +| test.rs:239:28:239:33 | ... < ... | test.rs:239:38:239:38 | x | true | +| test.rs:239:28:239:33 | ... < ... | test.rs:240:9:240:23 | TupleStructPat | false | +| test.rs:239:32:239:33 | 10 | test.rs:239:28:239:33 | ... < ... | | +| test.rs:239:38:239:38 | x | test.rs:239:42:239:42 | 5 | | +| test.rs:239:38:239:42 | ... + ... | test.rs:238:5:242:5 | MatchExpr | | +| test.rs:239:42:239:42 | 5 | test.rs:239:38:239:42 | ... + ... | | +| test.rs:240:9:240:23 | TupleStructPat | test.rs:240:28:240:28 | x | match | +| test.rs:240:9:240:23 | TupleStructPat | test.rs:241:9:241:20 | PathPat | no-match | +| test.rs:240:28:240:28 | x | test.rs:238:5:242:5 | MatchExpr | | +| test.rs:241:9:241:20 | PathPat | test.rs:241:25:241:25 | 5 | match | +| test.rs:241:25:241:25 | 5 | test.rs:238:5:242:5 | MatchExpr | | +| test.rs:246:5:251:5 | enter test_infinite_loop | test.rs:247:9:249:9 | ExprStmt | | +| test.rs:247:9:249:9 | ExprStmt | test.rs:248:13:248:13 | 1 | | +| test.rs:247:14:249:9 | BlockExpr | test.rs:248:13:248:13 | 1 | | +| test.rs:248:13:248:13 | 1 | test.rs:247:14:249:9 | BlockExpr | | +| test.rs:253:5:256:5 | enter test_let_match | test.rs:254:9:254:49 | LetStmt | | +| test.rs:253:5:256:5 | exit test_let_match (normal) | test.rs:253:5:256:5 | exit test_let_match | | +| test.rs:253:39:256:5 | BlockExpr | test.rs:253:5:256:5 | exit test_let_match (normal) | | +| test.rs:254:9:254:49 | LetStmt | test.rs:254:23:254:23 | a | | +| test.rs:254:13:254:19 | TupleStructPat | test.rs:254:32:254:46 | "Expected some" | no-match | +| test.rs:254:13:254:19 | TupleStructPat | test.rs:255:9:255:9 | n | match | +| test.rs:254:23:254:23 | a | test.rs:254:13:254:19 | TupleStructPat | | +| test.rs:254:32:254:46 | "Expected some" | test.rs:254:30:254:48 | BlockExpr | | +| test.rs:255:9:255:9 | n | test.rs:253:39:256:5 | BlockExpr | | +| test.rs:259:1:264:1 | enter dead_code | test.rs:260:5:262:5 | ExprStmt | | +| test.rs:259:1:264:1 | exit dead_code (normal) | test.rs:259:1:264:1 | exit dead_code | | +| test.rs:260:5:262:5 | ExprStmt | test.rs:260:9:260:12 | true | | +| test.rs:260:8:260:13 | ParenExpr | test.rs:261:9:261:17 | ExprStmt | true | +| test.rs:260:9:260:12 | true | test.rs:260:8:260:13 | ParenExpr | | +| test.rs:261:9:261:16 | ReturnExpr | test.rs:259:1:264:1 | exit dead_code (normal) | return | +| test.rs:261:9:261:17 | ExprStmt | test.rs:261:16:261:16 | 0 | | +| test.rs:261:16:261:16 | 0 | test.rs:261:9:261:16 | ReturnExpr | | +| test.rs:266:1:279:1 | enter labelled_block1 | test.rs:267:5:278:6 | LetStmt | | +| test.rs:266:1:279:1 | exit labelled_block1 (normal) | test.rs:266:1:279:1 | exit labelled_block1 | | +| test.rs:266:29:279:1 | BlockExpr | test.rs:266:1:279:1 | exit labelled_block1 (normal) | | +| test.rs:267:5:278:6 | LetStmt | test.rs:268:9:268:19 | ExprStmt | | +| test.rs:267:9:267:14 | result | test.rs:266:29:279:1 | BlockExpr | match, no-match | +| test.rs:267:18:278:5 | BlockExpr | test.rs:267:9:267:14 | result | | +| test.rs:268:9:268:16 | PathExpr | test.rs:268:9:268:18 | CallExpr | | +| test.rs:268:9:268:18 | CallExpr | test.rs:269:9:271:9 | ExprStmt | | +| test.rs:268:9:268:19 | ExprStmt | test.rs:268:9:268:16 | PathExpr | | +| test.rs:269:9:271:9 | ExprStmt | test.rs:269:12:269:28 | PathExpr | | +| test.rs:269:9:271:9 | IfExpr | test.rs:272:9:272:24 | ExprStmt | | +| test.rs:269:12:269:28 | PathExpr | test.rs:269:12:269:30 | CallExpr | | +| test.rs:269:12:269:30 | CallExpr | test.rs:269:9:271:9 | IfExpr | false | +| test.rs:269:12:269:30 | CallExpr | test.rs:270:13:270:27 | ExprStmt | true | +| test.rs:270:13:270:26 | BreakExpr | test.rs:266:1:279:1 | exit labelled_block1 (normal) | break('block) | +| test.rs:270:13:270:27 | ExprStmt | test.rs:270:26:270:26 | 1 | | +| test.rs:270:26:270:26 | 1 | test.rs:270:13:270:26 | BreakExpr | | +| test.rs:272:9:272:21 | PathExpr | test.rs:272:9:272:23 | CallExpr | | +| test.rs:272:9:272:23 | CallExpr | test.rs:273:9:275:9 | ExprStmt | | +| test.rs:272:9:272:24 | ExprStmt | test.rs:272:9:272:21 | PathExpr | | +| test.rs:273:9:275:9 | ExprStmt | test.rs:273:12:273:28 | PathExpr | | +| test.rs:273:9:275:9 | IfExpr | test.rs:276:9:276:24 | ExprStmt | | +| test.rs:273:12:273:28 | PathExpr | test.rs:273:12:273:30 | CallExpr | | +| test.rs:273:12:273:30 | CallExpr | test.rs:273:9:275:9 | IfExpr | false | +| test.rs:273:12:273:30 | CallExpr | test.rs:274:13:274:27 | ExprStmt | true | +| test.rs:274:13:274:26 | BreakExpr | test.rs:266:1:279:1 | exit labelled_block1 (normal) | break('block) | +| test.rs:274:13:274:27 | ExprStmt | test.rs:274:26:274:26 | 2 | | +| test.rs:274:26:274:26 | 2 | test.rs:274:13:274:26 | BreakExpr | | +| test.rs:276:9:276:21 | PathExpr | test.rs:276:9:276:23 | CallExpr | | +| test.rs:276:9:276:23 | CallExpr | test.rs:277:9:277:9 | 3 | | +| test.rs:276:9:276:24 | ExprStmt | test.rs:276:9:276:21 | PathExpr | | +| test.rs:277:9:277:9 | 3 | test.rs:267:18:278:5 | BlockExpr | | +| test.rs:281:1:289:1 | enter labelled_block2 | test.rs:282:5:288:6 | LetStmt | | +| test.rs:281:1:289:1 | exit labelled_block2 (normal) | test.rs:281:1:289:1 | exit labelled_block2 | | +| test.rs:281:29:289:1 | BlockExpr | test.rs:281:1:289:1 | exit labelled_block2 (normal) | | +| test.rs:282:5:288:6 | LetStmt | test.rs:283:9:283:34 | LetStmt | | +| test.rs:282:9:282:14 | result | test.rs:281:29:289:1 | BlockExpr | match, no-match | +| test.rs:282:18:288:5 | BlockExpr | test.rs:282:9:282:14 | result | | +| test.rs:283:9:283:34 | LetStmt | test.rs:283:30:283:33 | PathExpr | | +| test.rs:283:13:283:13 | x | test.rs:284:9:286:10 | LetStmt | match, no-match | +| test.rs:283:30:283:33 | PathExpr | test.rs:283:13:283:13 | x | | +| test.rs:284:9:286:10 | LetStmt | test.rs:284:23:284:23 | x | | +| test.rs:284:13:284:19 | TupleStructPat | test.rs:285:13:285:27 | ExprStmt | no-match | +| test.rs:284:13:284:19 | TupleStructPat | test.rs:287:9:287:9 | x | match | +| test.rs:284:23:284:23 | x | test.rs:284:13:284:19 | TupleStructPat | | +| test.rs:285:13:285:26 | BreakExpr | test.rs:281:1:289:1 | exit labelled_block2 (normal) | break('block) | +| test.rs:285:13:285:27 | ExprStmt | test.rs:285:26:285:26 | 1 | | +| test.rs:285:26:285:26 | 1 | test.rs:285:13:285:26 | BreakExpr | | +| test.rs:287:9:287:9 | x | test.rs:282:18:288:5 | BlockExpr | | diff --git a/rust/ql/test/library-tests/controlflow/test.rs b/rust/ql/test/library-tests/controlflow/test.rs index dd1659ee997b..22d8b9f24a60 100644 --- a/rust/ql/test/library-tests/controlflow/test.rs +++ b/rust/ql/test/library-tests/controlflow/test.rs @@ -62,6 +62,15 @@ mod loop_expression { } } + fn test_while_let() { + let mut iter = 1..10; + while let Some(x) = iter.next() { + if (i = 5) { + break; + } + } + } + fn test_for(j: i64) { for i in 0..10 { if (i == j) { @@ -254,7 +263,7 @@ fn dead_code() -> i64 { return 1; } -fn labelled_block() -> i64 { +fn labelled_block1() -> i64 { let result = 'block: { do_thing(); if condition_not_met() { @@ -268,3 +277,13 @@ fn labelled_block() -> i64 { 3 }; } + +fn labelled_block2() -> i64 { + let result = 'block: { + let x: Option = None; + let Some(y) = x else { + break 'block 1; + }; + x + }; +} From 071076875cf5a6f7e133f08fab6ed403ffbf3f64 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Tue, 1 Oct 2024 15:02:00 +0200 Subject: [PATCH 34/79] Rust: Make more CFG nodes leaves --- .../internal/ControlFlowGraphImpl.qll | 26 ++----------------- 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll b/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll index 177651bf1ca8..62a58df2d1f0 100644 --- a/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll +++ b/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll @@ -230,6 +230,8 @@ class IndexExprTree extends StandardPostOrderTree instanceof IndexExpr { } } +class ItemTree extends LeafTree, Item { } + // `LetExpr` is a pre-order tree such that the pattern itself ends up // dominating successors in the graph in the same way that patterns do in // `match` expressions. @@ -472,18 +474,6 @@ class ParenExprTree extends StandardPostOrderTree, ParenExpr { // This covers all patterns as they all extend `Pat` class PatExprTree extends LeafTree instanceof Pat { } -class PathTree extends StandardPostOrderTree, Path { - override AstNode getChildNode(int i) { - i = 0 and result = this.getQualifier() - or - i = 1 and result = this.getPart() - } -} - -class PathSegmentTree extends StandardPostOrderTree, PathSegment { - override AstNode getChildNode(int i) { i = 0 and result = this.getNameRef() } -} - class PathExprTree extends LeafTree instanceof PathExpr { } class PrefixExprTree extends StandardPostOrderTree instanceof PrefixExpr { @@ -522,14 +512,6 @@ class ReturnExprTree extends PostOrderTree instanceof ReturnExpr { } } -class StaticTree extends StandardPostOrderTree, Static { - override AstNode getChildNode(int i) { - i = 0 and result = this.getName() - or - i = 1 and result = this.getBody() - } -} - class TupleExprTree extends StandardPostOrderTree instanceof TupleExpr { override AstNode getChildNode(int i) { result = super.getField(i) } } @@ -538,10 +520,6 @@ class TypeRefTree extends LeafTree instanceof TypeRef { } class UnderscoreExprTree extends LeafTree instanceof UnderscoreExpr { } -class UseTree_ extends StandardPreOrderTree, Use { - override AstNode getChildNode(int i) { i = 0 and result = this.getUseTree().getPath() } -} - // NOTE: `yield` is a reserved but unused keyword. class YieldExprTree extends StandardPostOrderTree instanceof YieldExpr { override AstNode getChildNode(int i) { i = 0 and result = super.getExpr() } From 85957767c99b5c78900886f6be95b11af650b9a0 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Tue, 1 Oct 2024 15:07:35 +0200 Subject: [PATCH 35/79] Rust: Fix CFG for `while let` loops --- .../controlflow/internal/ControlFlowGraphImpl.qll | 12 +++++++++--- .../ql/test/library-tests/controlflow/Cfg.expected | 14 ++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll b/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll index 62a58df2d1f0..c32e828a5584 100644 --- a/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll +++ b/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll @@ -193,7 +193,7 @@ class IfExprTree extends PostOrderTree instanceof IfExpr { child = [super.getCondition(), super.getThen(), super.getElse()] } - ConditionalCompletion conditionCompletion(Completion c) { + private ConditionalCompletion conditionCompletion(Completion c) { if super.getCondition() instanceof LetExpr then result = c.(MatchCompletion) else result = c.(BooleanCompletion) @@ -345,15 +345,21 @@ class WhileExprTree extends LoopingExprTree instanceof WhileExpr { override predicate first(AstNode node) { first(super.getCondition(), node) } + private ConditionalCompletion conditionCompletion(Completion c) { + if super.getCondition() instanceof LetExpr + then result = c.(MatchCompletion) + else result = c.(BooleanCompletion) + } + override predicate succ(AstNode pred, AstNode succ, Completion c) { super.succ(pred, succ, c) or last(super.getCondition(), pred, c) and - c.(BooleanCompletion).succeeded() and + this.conditionCompletion(c).succeeded() and first(this.getLoopBody(), succ) or last(super.getCondition(), pred, c) and - c.(BooleanCompletion).failed() and + this.conditionCompletion(c).failed() and succ = this } diff --git a/rust/ql/test/library-tests/controlflow/Cfg.expected b/rust/ql/test/library-tests/controlflow/Cfg.expected index d5097158874d..c04e7e20be2f 100644 --- a/rust/ql/test/library-tests/controlflow/Cfg.expected +++ b/rust/ql/test/library-tests/controlflow/Cfg.expected @@ -123,12 +123,26 @@ | test.rs:61:13:61:22 | ExprStmt | test.rs:61:13:61:13 | PathExpr | | | test.rs:61:17:61:21 | false | test.rs:61:13:61:21 | ... = ... | | | test.rs:65:5:72:5 | enter test_while_let | test.rs:66:9:66:29 | LetStmt | | +| test.rs:65:5:72:5 | exit test_while_let (normal) | test.rs:65:5:72:5 | exit test_while_let | | +| test.rs:65:25:72:5 | BlockExpr | test.rs:65:5:72:5 | exit test_while_let (normal) | | | test.rs:66:9:66:29 | LetStmt | test.rs:66:24:66:24 | 1 | | | test.rs:66:13:66:20 | iter | test.rs:67:15:67:39 | LetExpr | match, no-match | | test.rs:66:24:66:24 | 1 | test.rs:66:27:66:28 | 10 | | | test.rs:66:24:66:28 | RangeExpr | test.rs:66:13:66:20 | iter | | | test.rs:66:27:66:28 | 10 | test.rs:66:24:66:28 | RangeExpr | | +| test.rs:67:9:71:9 | WhileExpr | test.rs:65:25:72:5 | BlockExpr | | | test.rs:67:15:67:39 | LetExpr | test.rs:67:19:67:25 | TupleStructPat | | +| test.rs:67:19:67:25 | TupleStructPat | test.rs:67:9:71:9 | WhileExpr | no-match | +| test.rs:67:19:67:25 | TupleStructPat | test.rs:68:17:68:17 | PathExpr | match | +| test.rs:67:41:71:9 | BlockExpr | test.rs:67:15:67:39 | LetExpr | | +| test.rs:68:13:70:13 | IfExpr | test.rs:67:41:71:9 | BlockExpr | | +| test.rs:68:16:68:22 | ParenExpr | test.rs:68:13:70:13 | IfExpr | false | +| test.rs:68:16:68:22 | ParenExpr | test.rs:69:17:69:22 | ExprStmt | true | +| test.rs:68:17:68:17 | PathExpr | test.rs:68:21:68:21 | 5 | | +| test.rs:68:17:68:21 | ... = ... | test.rs:68:16:68:22 | ParenExpr | | +| test.rs:68:21:68:21 | 5 | test.rs:68:17:68:21 | ... = ... | | +| test.rs:69:17:69:21 | BreakExpr | test.rs:67:9:71:9 | WhileExpr | break | +| test.rs:69:17:69:22 | ExprStmt | test.rs:69:17:69:21 | BreakExpr | | | test.rs:74:5:81:5 | enter test_for | test.rs:75:18:75:18 | 0 | | | test.rs:74:5:81:5 | exit test_for (normal) | test.rs:74:5:81:5 | exit test_for | | | test.rs:74:25:81:5 | BlockExpr | test.rs:74:5:81:5 | exit test_for (normal) | | From e8cb3490e6aac54fe2da5a7de908399b34aca237 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Tue, 1 Oct 2024 20:21:49 +0200 Subject: [PATCH 36/79] Rust: Refine `deadEnd` consistency check --- rust/ql/consistency-queries/CfgConsistency.ql | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rust/ql/consistency-queries/CfgConsistency.ql b/rust/ql/consistency-queries/CfgConsistency.ql index 52b44170a397..68e0e82076eb 100644 --- a/rust/ql/consistency-queries/CfgConsistency.ql +++ b/rust/ql/consistency-queries/CfgConsistency.ql @@ -26,8 +26,13 @@ query predicate scopeNoFirst(CfgScope scope) { not scope = any(ClosureExpr c | not exists(c.getBody())) } +/** Holds if `be` is the `else` branch of a `let` statement that results in a panic. */ +private predicate letElsePanic(BlockExpr be) { + be = any(LetStmt let).getLetElse().getBlockExpr() and + exists(Completion c | CfgImpl::last(be, _, c) | completionIsNormal(c)) +} + query predicate deadEnd(CfgImpl::Node node) { Consistency::deadEnd(node) and - // `else` blocks in `let` statements diverge, so they are by definition dead ends - not node.getAstNode() = any(LetStmt let).getLetElse().getBlockExpr() + not letElsePanic(node.getAstNode()) } From 8b66dc16adbb77b62bfa9d5cfe2a47a7e639ac12 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Tue, 1 Oct 2024 20:47:42 +0200 Subject: [PATCH 37/79] Rust: Fix CFG for labelled block expressions --- .../internal/ControlFlowGraphImpl.qll | 30 +++++++++++++++++-- .../library-tests/controlflow/Cfg.expected | 17 ++++++++--- 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll b/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll index c32e828a5584..89d6750f1e28 100644 --- a/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll +++ b/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll @@ -136,7 +136,7 @@ class LogicalAndBinaryOpExprTree extends PreOrderTree, LogicalAndExpr { } } -class BlockExprBaseTree extends StandardPostOrderTree instanceof BlockExpr { +class BlockExprTree extends StandardPostOrderTree, BlockExpr { override AstNode getChildNode(int i) { result = super.getStmtList().getStatement(i) or @@ -144,6 +144,32 @@ class BlockExprBaseTree extends StandardPostOrderTree instanceof BlockExpr { (exists(super.getStmtList().getStatement(i - 1)) or i = 0) and result = super.getStmtList().getTailExpr() } + + override predicate propagatesAbnormal(AstNode child) { none() } + + /** Holds if this block captures the break completion `c`. */ + private predicate capturesBreakCompletion(LoopJumpCompletion c) { + c.isBreak() and + c.getLabelName() = this.getLabel().getLifetime().getText() + } + + override predicate succ(AstNode pred, AstNode succ, Completion c) { + super.succ(pred, succ, c) + or + // Edge for exiting the block with a break expressions + last(this.getChildNode(_), pred, c) and + this.capturesBreakCompletion(c) and + succ = this + } + + override predicate last(AstNode last, Completion c) { + super.last(last, c) + or + // Any abnormal completions that this block does not capture should propagate + last(this.getChildNode(_), last, c) and + not completionIsNormal(c) and + not this.capturesBreakCompletion(c) + } } class BreakExprTree extends PostOrderTree instanceof BreakExpr { @@ -293,7 +319,7 @@ abstract class LoopingExprTree extends PostOrderTree { abstract predicate entry(AstNode node); /** Holds if this loop captures the `c` completion. */ - predicate capturesLoopJumpCompletion(LoopJumpCompletion c) { + private predicate capturesLoopJumpCompletion(LoopJumpCompletion c) { not c.hasLabel() or c.getLabelName() = this.getLabel().getLifetime().getText() diff --git a/rust/ql/test/library-tests/controlflow/Cfg.expected b/rust/ql/test/library-tests/controlflow/Cfg.expected index c04e7e20be2f..e9e0addf52be 100644 --- a/rust/ql/test/library-tests/controlflow/Cfg.expected +++ b/rust/ql/test/library-tests/controlflow/Cfg.expected @@ -343,11 +343,20 @@ | test.rs:175:13:175:13 | 0 | test.rs:174:16:176:9 | BlockExpr | | | test.rs:179:5:187:5 | enter test_labelled_block | test.rs:181:13:181:31 | ExprStmt | | | test.rs:179:5:187:5 | exit test_labelled_block (normal) | test.rs:179:5:187:5 | exit test_labelled_block | | -| test.rs:181:13:181:30 | BreakExpr | test.rs:179:5:187:5 | exit test_labelled_block (normal) | break('block) | +| test.rs:179:43:187:5 | BlockExpr | test.rs:179:5:187:5 | exit test_labelled_block (normal) | | +| test.rs:180:9:186:9 | IfExpr | test.rs:179:43:187:5 | BlockExpr | | +| test.rs:180:12:182:10 | ParenExpr | test.rs:183:13:183:13 | 1 | true | +| test.rs:180:12:182:10 | ParenExpr | test.rs:185:13:185:13 | 0 | false | +| test.rs:180:13:182:9 | BlockExpr | test.rs:180:12:182:10 | ParenExpr | | +| test.rs:181:13:181:30 | BreakExpr | test.rs:180:13:182:9 | BlockExpr | break('block) | | test.rs:181:13:181:31 | ExprStmt | test.rs:181:26:181:26 | a | | | test.rs:181:26:181:26 | a | test.rs:181:30:181:30 | 0 | | | test.rs:181:26:181:30 | ... > ... | test.rs:181:13:181:30 | BreakExpr | | | test.rs:181:30:181:30 | 0 | test.rs:181:26:181:30 | ... > ... | | +| test.rs:182:12:184:9 | BlockExpr | test.rs:180:9:186:9 | IfExpr | | +| test.rs:183:13:183:13 | 1 | test.rs:182:12:184:9 | BlockExpr | | +| test.rs:184:16:186:9 | BlockExpr | test.rs:180:9:186:9 | IfExpr | | +| test.rs:185:13:185:13 | 0 | test.rs:184:16:186:9 | BlockExpr | | | test.rs:192:5:195:5 | enter test_and_operator | test.rs:193:9:193:28 | LetStmt | | | test.rs:192:5:195:5 | exit test_and_operator (normal) | test.rs:192:5:195:5 | exit test_and_operator | | | test.rs:192:61:195:5 | BlockExpr | test.rs:192:5:195:5 | exit test_and_operator (normal) | | @@ -495,7 +504,7 @@ | test.rs:269:12:269:28 | PathExpr | test.rs:269:12:269:30 | CallExpr | | | test.rs:269:12:269:30 | CallExpr | test.rs:269:9:271:9 | IfExpr | false | | test.rs:269:12:269:30 | CallExpr | test.rs:270:13:270:27 | ExprStmt | true | -| test.rs:270:13:270:26 | BreakExpr | test.rs:266:1:279:1 | exit labelled_block1 (normal) | break('block) | +| test.rs:270:13:270:26 | BreakExpr | test.rs:267:18:278:5 | BlockExpr | break('block) | | test.rs:270:13:270:27 | ExprStmt | test.rs:270:26:270:26 | 1 | | | test.rs:270:26:270:26 | 1 | test.rs:270:13:270:26 | BreakExpr | | | test.rs:272:9:272:21 | PathExpr | test.rs:272:9:272:23 | CallExpr | | @@ -506,7 +515,7 @@ | test.rs:273:12:273:28 | PathExpr | test.rs:273:12:273:30 | CallExpr | | | test.rs:273:12:273:30 | CallExpr | test.rs:273:9:275:9 | IfExpr | false | | test.rs:273:12:273:30 | CallExpr | test.rs:274:13:274:27 | ExprStmt | true | -| test.rs:274:13:274:26 | BreakExpr | test.rs:266:1:279:1 | exit labelled_block1 (normal) | break('block) | +| test.rs:274:13:274:26 | BreakExpr | test.rs:267:18:278:5 | BlockExpr | break('block) | | test.rs:274:13:274:27 | ExprStmt | test.rs:274:26:274:26 | 2 | | | test.rs:274:26:274:26 | 2 | test.rs:274:13:274:26 | BreakExpr | | | test.rs:276:9:276:21 | PathExpr | test.rs:276:9:276:23 | CallExpr | | @@ -526,7 +535,7 @@ | test.rs:284:13:284:19 | TupleStructPat | test.rs:285:13:285:27 | ExprStmt | no-match | | test.rs:284:13:284:19 | TupleStructPat | test.rs:287:9:287:9 | x | match | | test.rs:284:23:284:23 | x | test.rs:284:13:284:19 | TupleStructPat | | -| test.rs:285:13:285:26 | BreakExpr | test.rs:281:1:289:1 | exit labelled_block2 (normal) | break('block) | +| test.rs:285:13:285:26 | BreakExpr | test.rs:282:18:288:5 | BlockExpr | break('block) | | test.rs:285:13:285:27 | ExprStmt | test.rs:285:26:285:26 | 1 | | | test.rs:285:26:285:26 | 1 | test.rs:285:13:285:26 | BreakExpr | | | test.rs:287:9:287:9 | x | test.rs:282:18:288:5 | BlockExpr | | From c4eafb2cf3c91f8bac9e7059c01a2b0fda961f94 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Tue, 1 Oct 2024 21:13:38 +0200 Subject: [PATCH 38/79] Rust: Skip `ParenExpr`s in the CFG --- rust/ql/consistency-queries/CfgConsistency.ql | 1 + .../rust/controlflow/internal/Completion.qll | 2 + .../internal/ControlFlowGraphImpl.qll | 14 ++++- .../library-tests/controlflow/Cfg.expected | 56 ++++++++----------- 4 files changed, 38 insertions(+), 35 deletions(-) diff --git a/rust/ql/consistency-queries/CfgConsistency.ql b/rust/ql/consistency-queries/CfgConsistency.ql index 68e0e82076eb..6964b7bbcb18 100644 --- a/rust/ql/consistency-queries/CfgConsistency.ql +++ b/rust/ql/consistency-queries/CfgConsistency.ql @@ -11,6 +11,7 @@ import codeql.rust.controlflow.internal.Completion query predicate nonPostOrderExpr(Expr e, string cls) { cls = e.getPrimaryQlClasses() and not e instanceof LetExpr and + not e instanceof ParenExpr and not e instanceof LogicalAndExpr and // todo not e instanceof LogicalOrExpr and exists(AstNode last, Completion c | diff --git a/rust/ql/lib/codeql/rust/controlflow/internal/Completion.qll b/rust/ql/lib/codeql/rust/controlflow/internal/Completion.qll index facb3849f71f..4034db5fe288 100644 --- a/rust/ql/lib/codeql/rust/controlflow/internal/Completion.qll +++ b/rust/ql/lib/codeql/rust/controlflow/internal/Completion.qll @@ -94,6 +94,8 @@ class BooleanCompletion extends ConditionalCompletion, TBooleanCompletion { ) or exists(Expr parent | this.isValidForSpecific0(parent) | + e = parent.(ParenExpr).getExpr() + or parent = any(PrefixExpr expr | expr.getOperatorName() = "!" and diff --git a/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll b/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll index 89d6750f1e28..236d848c70e4 100644 --- a/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll +++ b/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll @@ -499,8 +499,18 @@ class NameRefTree extends LeafTree, NameRef { } class OffsetOfExprTree extends LeafTree instanceof OffsetOfExpr { } -class ParenExprTree extends StandardPostOrderTree, ParenExpr { - override AstNode getChildNode(int i) { i = 0 and result = super.getExpr() } +class ParenExprTree extends ControlFlowTree, ParenExpr { + private ControlFlowTree expr; + + ParenExprTree() { expr = super.getExpr() } + + override predicate propagatesAbnormal(AstNode child) { expr.propagatesAbnormal(child) } + + override predicate first(AstNode first) { expr.first(first) } + + override predicate last(AstNode last, Completion c) { expr.last(last, c) } + + override predicate succ(AstNode pred, AstNode succ, Completion c) { none() } } // This covers all patterns as they all extend `Pat` diff --git a/rust/ql/test/library-tests/controlflow/Cfg.expected b/rust/ql/test/library-tests/controlflow/Cfg.expected index e9e0addf52be..aff1576a8294 100644 --- a/rust/ql/test/library-tests/controlflow/Cfg.expected +++ b/rust/ql/test/library-tests/controlflow/Cfg.expected @@ -111,10 +111,9 @@ | test.rs:57:13:57:14 | ExprStmt | test.rs:57:13:57:13 | 1 | | | test.rs:58:13:60:13 | ExprStmt | test.rs:58:17:58:17 | i | | | test.rs:58:13:60:13 | IfExpr | test.rs:61:13:61:22 | ExprStmt | | -| test.rs:58:16:58:22 | ParenExpr | test.rs:58:13:60:13 | IfExpr | false | -| test.rs:58:16:58:22 | ParenExpr | test.rs:59:17:59:22 | ExprStmt | true | | test.rs:58:17:58:17 | i | test.rs:58:21:58:21 | 0 | | -| test.rs:58:17:58:21 | ... > ... | test.rs:58:16:58:22 | ParenExpr | | +| test.rs:58:17:58:21 | ... > ... | test.rs:58:13:60:13 | IfExpr | false | +| test.rs:58:17:58:21 | ... > ... | test.rs:59:17:59:22 | ExprStmt | true | | test.rs:58:21:58:21 | 0 | test.rs:58:17:58:21 | ... > ... | | | test.rs:59:17:59:21 | BreakExpr | test.rs:56:9:62:9 | WhileExpr | break | | test.rs:59:17:59:22 | ExprStmt | test.rs:59:17:59:21 | BreakExpr | | @@ -136,10 +135,9 @@ | test.rs:67:19:67:25 | TupleStructPat | test.rs:68:17:68:17 | PathExpr | match | | test.rs:67:41:71:9 | BlockExpr | test.rs:67:15:67:39 | LetExpr | | | test.rs:68:13:70:13 | IfExpr | test.rs:67:41:71:9 | BlockExpr | | -| test.rs:68:16:68:22 | ParenExpr | test.rs:68:13:70:13 | IfExpr | false | -| test.rs:68:16:68:22 | ParenExpr | test.rs:69:17:69:22 | ExprStmt | true | | test.rs:68:17:68:17 | PathExpr | test.rs:68:21:68:21 | 5 | | -| test.rs:68:17:68:21 | ... = ... | test.rs:68:16:68:22 | ParenExpr | | +| test.rs:68:17:68:21 | ... = ... | test.rs:68:13:70:13 | IfExpr | false | +| test.rs:68:17:68:21 | ... = ... | test.rs:69:17:69:22 | ExprStmt | true | | test.rs:68:21:68:21 | 5 | test.rs:68:17:68:21 | ... = ... | | | test.rs:69:17:69:21 | BreakExpr | test.rs:67:9:71:9 | WhileExpr | break | | test.rs:69:17:69:22 | ExprStmt | test.rs:69:17:69:21 | BreakExpr | | @@ -155,10 +153,9 @@ | test.rs:75:24:80:9 | BlockExpr | test.rs:75:13:75:13 | i | | | test.rs:76:13:78:13 | ExprStmt | test.rs:76:17:76:17 | i | | | test.rs:76:13:78:13 | IfExpr | test.rs:79:13:79:14 | ExprStmt | | -| test.rs:76:16:76:23 | ParenExpr | test.rs:76:13:78:13 | IfExpr | false | -| test.rs:76:16:76:23 | ParenExpr | test.rs:77:17:77:22 | ExprStmt | true | | test.rs:76:17:76:17 | i | test.rs:76:22:76:22 | j | | -| test.rs:76:17:76:22 | ... == ... | test.rs:76:16:76:23 | ParenExpr | | +| test.rs:76:17:76:22 | ... == ... | test.rs:76:13:78:13 | IfExpr | false | +| test.rs:76:17:76:22 | ... == ... | test.rs:77:17:77:22 | ExprStmt | true | | test.rs:76:22:76:22 | j | test.rs:76:17:76:22 | ... == ... | | | test.rs:77:17:77:21 | BreakExpr | test.rs:75:9:80:9 | ForExpr | break | | test.rs:77:17:77:22 | ExprStmt | test.rs:77:17:77:21 | BreakExpr | | @@ -220,21 +217,20 @@ | test.rs:114:5:120:5 | exit test_nested_if (normal) | test.rs:114:5:120:5 | exit test_nested_if | | | test.rs:114:38:120:5 | BlockExpr | test.rs:114:5:120:5 | exit test_nested_if (normal) | | | test.rs:115:9:119:9 | IfExpr | test.rs:114:38:120:5 | BlockExpr | | -| test.rs:115:12:115:49 | ParenExpr | test.rs:116:13:116:13 | 1 | true | -| test.rs:115:12:115:49 | ParenExpr | test.rs:118:13:118:13 | 0 | false | -| test.rs:115:13:115:48 | IfExpr | test.rs:115:12:115:49 | ParenExpr | | +| test.rs:115:13:115:48 | IfExpr | test.rs:116:13:116:13 | 1 | true | +| test.rs:115:13:115:48 | IfExpr | test.rs:118:13:118:13 | 0 | false | | test.rs:115:16:115:16 | PathExpr | test.rs:115:20:115:20 | 0 | | | test.rs:115:16:115:20 | ... < ... | test.rs:115:24:115:24 | a | true | | test.rs:115:16:115:20 | ... < ... | test.rs:115:41:115:41 | a | false | | test.rs:115:20:115:20 | 0 | test.rs:115:16:115:20 | ... < ... | | -| test.rs:115:22:115:32 | BlockExpr | test.rs:115:13:115:48 | IfExpr | | +| test.rs:115:22:115:32 | BlockExpr | test.rs:115:13:115:48 | IfExpr | false, true | | test.rs:115:24:115:24 | a | test.rs:115:29:115:30 | 10 | | -| test.rs:115:24:115:30 | ... < ... | test.rs:115:22:115:32 | BlockExpr | | +| test.rs:115:24:115:30 | ... < ... | test.rs:115:22:115:32 | BlockExpr | false, true | | test.rs:115:28:115:30 | - ... | test.rs:115:24:115:30 | ... < ... | | | test.rs:115:29:115:30 | 10 | test.rs:115:28:115:30 | - ... | | -| test.rs:115:39:115:48 | BlockExpr | test.rs:115:13:115:48 | IfExpr | | +| test.rs:115:39:115:48 | BlockExpr | test.rs:115:13:115:48 | IfExpr | false, true | | test.rs:115:41:115:41 | a | test.rs:115:45:115:46 | 10 | | -| test.rs:115:41:115:46 | ... > ... | test.rs:115:39:115:48 | BlockExpr | | +| test.rs:115:41:115:46 | ... > ... | test.rs:115:39:115:48 | BlockExpr | false, true | | test.rs:115:45:115:46 | 10 | test.rs:115:41:115:46 | ... > ... | | | test.rs:115:51:117:9 | BlockExpr | test.rs:115:9:119:9 | IfExpr | | | test.rs:116:13:116:13 | 1 | test.rs:115:51:117:9 | BlockExpr | | @@ -244,9 +240,8 @@ | test.rs:122:5:131:5 | exit test_nested_if_match (normal) | test.rs:122:5:131:5 | exit test_nested_if_match | | | test.rs:122:44:131:5 | BlockExpr | test.rs:122:5:131:5 | exit test_nested_if_match (normal) | | | test.rs:123:9:130:9 | IfExpr | test.rs:122:44:131:5 | BlockExpr | | -| test.rs:123:12:126:10 | ParenExpr | test.rs:127:13:127:13 | 1 | true | -| test.rs:123:12:126:10 | ParenExpr | test.rs:129:13:129:13 | 0 | false | -| test.rs:123:13:126:9 | MatchExpr | test.rs:123:12:126:10 | ParenExpr | | +| test.rs:123:13:126:9 | MatchExpr | test.rs:127:13:127:13 | 1 | true | +| test.rs:123:13:126:9 | MatchExpr | test.rs:129:13:129:13 | 0 | false | | test.rs:123:19:123:19 | a | test.rs:124:13:124:13 | LiteralPat | | | test.rs:124:13:124:13 | LiteralPat | test.rs:124:18:124:21 | true | match | | test.rs:124:13:124:13 | LiteralPat | test.rs:125:13:125:13 | WildcardPat | no-match | @@ -291,9 +286,8 @@ | test.rs:153:5:164:5 | exit test_if_loop1 (normal) | test.rs:153:5:164:5 | exit test_if_loop1 | | | test.rs:153:37:164:5 | BlockExpr | test.rs:153:5:164:5 | exit test_if_loop1 (normal) | | | test.rs:154:9:163:9 | IfExpr | test.rs:153:37:164:5 | BlockExpr | | -| test.rs:154:12:159:10 | ParenExpr | test.rs:160:13:160:13 | 1 | true | -| test.rs:154:12:159:10 | ParenExpr | test.rs:162:13:162:13 | 0 | false | -| test.rs:154:13:159:9 | LoopExpr | test.rs:154:12:159:10 | ParenExpr | | +| test.rs:154:13:159:9 | LoopExpr | test.rs:160:13:160:13 | 1 | true | +| test.rs:154:13:159:9 | LoopExpr | test.rs:162:13:162:13 | 0 | false | | test.rs:154:18:159:9 | BlockExpr | test.rs:155:13:157:14 | ExprStmt | | | test.rs:155:13:157:13 | IfExpr | test.rs:158:13:158:19 | ExprStmt | | | test.rs:155:13:157:14 | ExprStmt | test.rs:155:16:155:16 | a | | @@ -318,9 +312,8 @@ | test.rs:166:5:177:5 | exit test_if_loop2 (normal) | test.rs:166:5:177:5 | exit test_if_loop2 | | | test.rs:166:37:177:5 | BlockExpr | test.rs:166:5:177:5 | exit test_if_loop2 (normal) | | | test.rs:167:9:176:9 | IfExpr | test.rs:166:37:177:5 | BlockExpr | | -| test.rs:167:12:172:10 | ParenExpr | test.rs:173:13:173:13 | 1 | true | -| test.rs:167:12:172:10 | ParenExpr | test.rs:175:13:175:13 | 0 | false | -| test.rs:167:13:172:9 | LoopExpr | test.rs:167:12:172:10 | ParenExpr | | +| test.rs:167:13:172:9 | LoopExpr | test.rs:173:13:173:13 | 1 | true | +| test.rs:167:13:172:9 | LoopExpr | test.rs:175:13:175:13 | 0 | false | | test.rs:167:26:172:9 | BlockExpr | test.rs:168:13:170:14 | ExprStmt | | | test.rs:168:13:170:13 | IfExpr | test.rs:171:13:171:19 | ExprStmt | | | test.rs:168:13:170:14 | ExprStmt | test.rs:168:16:168:16 | a | | @@ -345,9 +338,8 @@ | test.rs:179:5:187:5 | exit test_labelled_block (normal) | test.rs:179:5:187:5 | exit test_labelled_block | | | test.rs:179:43:187:5 | BlockExpr | test.rs:179:5:187:5 | exit test_labelled_block (normal) | | | test.rs:180:9:186:9 | IfExpr | test.rs:179:43:187:5 | BlockExpr | | -| test.rs:180:12:182:10 | ParenExpr | test.rs:183:13:183:13 | 1 | true | -| test.rs:180:12:182:10 | ParenExpr | test.rs:185:13:185:13 | 0 | false | -| test.rs:180:13:182:9 | BlockExpr | test.rs:180:12:182:10 | ParenExpr | | +| test.rs:180:13:182:9 | BlockExpr | test.rs:183:13:183:13 | 1 | true | +| test.rs:180:13:182:9 | BlockExpr | test.rs:185:13:185:13 | 0 | false | | test.rs:181:13:181:30 | BreakExpr | test.rs:180:13:182:9 | BlockExpr | break('block) | | test.rs:181:13:181:31 | ExprStmt | test.rs:181:26:181:26 | a | | | test.rs:181:26:181:26 | a | test.rs:181:30:181:30 | 0 | | @@ -392,10 +384,9 @@ | test.rs:203:17:203:17 | a | test.rs:203:23:203:23 | b | false | | test.rs:203:17:203:30 | ... \|\| ... | test.rs:203:17:203:17 | a | | | test.rs:203:17:203:35 | ... \|\| ... | test.rs:203:17:203:30 | ... \|\| ... | | -| test.rs:203:22:203:30 | ParenExpr | test.rs:203:13:203:13 | d | true | -| test.rs:203:22:203:30 | ParenExpr | test.rs:203:35:203:35 | c | false | | test.rs:203:23:203:23 | b | test.rs:203:28:203:29 | 28 | | -| test.rs:203:23:203:29 | ... == ... | test.rs:203:22:203:30 | ParenExpr | | +| test.rs:203:23:203:29 | ... == ... | test.rs:203:13:203:13 | d | true | +| test.rs:203:23:203:29 | ... == ... | test.rs:203:35:203:35 | c | false | | test.rs:203:28:203:29 | 28 | test.rs:203:23:203:29 | ... == ... | | | test.rs:203:35:203:35 | c | test.rs:203:13:203:13 | d | | | test.rs:204:9:204:9 | d | test.rs:202:61:205:5 | BlockExpr | | @@ -485,8 +476,7 @@ | test.rs:259:1:264:1 | enter dead_code | test.rs:260:5:262:5 | ExprStmt | | | test.rs:259:1:264:1 | exit dead_code (normal) | test.rs:259:1:264:1 | exit dead_code | | | test.rs:260:5:262:5 | ExprStmt | test.rs:260:9:260:12 | true | | -| test.rs:260:8:260:13 | ParenExpr | test.rs:261:9:261:17 | ExprStmt | true | -| test.rs:260:9:260:12 | true | test.rs:260:8:260:13 | ParenExpr | | +| test.rs:260:9:260:12 | true | test.rs:261:9:261:17 | ExprStmt | true | | test.rs:261:9:261:16 | ReturnExpr | test.rs:259:1:264:1 | exit dead_code (normal) | return | | test.rs:261:9:261:17 | ExprStmt | test.rs:261:16:261:16 | 0 | | | test.rs:261:16:261:16 | 0 | test.rs:261:9:261:16 | ReturnExpr | | From 8f0b7f0969fd9d0f1cdd2811fdc807d4e3283e7f Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Tue, 1 Oct 2024 21:27:36 +0200 Subject: [PATCH 39/79] Rust: Use `propagatesAbnormal` in two places --- .../internal/ControlFlowGraphImpl.qll | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll b/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll index 236d848c70e4..da156cd7767c 100644 --- a/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll +++ b/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll @@ -369,6 +369,8 @@ class WhileExprTree extends LoopingExprTree instanceof WhileExpr { override predicate entry(AstNode node) { this.first(node) } + override predicate propagatesAbnormal(AstNode child) { child = super.getCondition() } + override predicate first(AstNode node) { first(super.getCondition(), node) } private ConditionalCompletion conditionCompletion(Completion c) { @@ -388,13 +390,6 @@ class WhileExprTree extends LoopingExprTree instanceof WhileExpr { this.conditionCompletion(c).failed() and succ = this } - - override predicate last(AstNode last, Completion c) { - super.last(last, c) - or - last(super.getCondition(), last, c) and - not completionIsNormal(c) - } } class ForExprTree extends LoopingExprTree instanceof ForExpr { @@ -404,6 +399,8 @@ class ForExprTree extends LoopingExprTree instanceof ForExpr { override predicate entry(AstNode n) { first(super.getPat(), n) } + override predicate propagatesAbnormal(AstNode child) { child = super.getIterable() } + override predicate first(AstNode node) { first(super.getIterable(), node) } override predicate succ(AstNode pred, AstNode succ, Completion c) { @@ -421,13 +418,6 @@ class ForExprTree extends LoopingExprTree instanceof ForExpr { c.(MatchCompletion).failed() and succ = this } - - override predicate last(AstNode last, Completion c) { - super.last(last, c) - or - last(super.getIterable(), last, c) and - not completionIsNormal(c) - } } // TODO: replace with expanded macro once the extractor supports it From 2458d1642670d0ceb8edcf47bcf34006ef2be84e Mon Sep 17 00:00:00 2001 From: Chad Bentz <1760475+felickz@users.noreply.github.com> Date: Tue, 1 Oct 2024 23:04:22 -0400 Subject: [PATCH 40/79] Clarify threat model flow sources comment in LogForgingQuery.qll --- .../semmle/code/csharp/security/dataflow/LogForgingQuery.qll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/LogForgingQuery.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/LogForgingQuery.qll index 8181c9bcb74a..ebb481d2525e 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/dataflow/LogForgingQuery.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/LogForgingQuery.qll @@ -42,7 +42,7 @@ private module LogForgingConfig implements DataFlow::ConfigSig { */ module LogForging = TaintTracking::Global; -/** A source of remote user input. */ +/** A source supported by the current threat model. */ private class ThreatModelSource extends Source instanceof ActiveThreatModelSource { } private class HtmlSanitizer extends Sanitizer { From d3695dce4dcfc0332389f1afe9e03dd588f98862 Mon Sep 17 00:00:00 2001 From: Calum Grant Date: Wed, 2 Oct 2024 08:14:23 +0100 Subject: [PATCH 41/79] C++: Add change note --- cpp/ql/src/change-notes/2024-10-02-uninitialized-local.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 cpp/ql/src/change-notes/2024-10-02-uninitialized-local.md diff --git a/cpp/ql/src/change-notes/2024-10-02-uninitialized-local.md b/cpp/ql/src/change-notes/2024-10-02-uninitialized-local.md new file mode 100644 index 000000000000..e34a942f38a6 --- /dev/null +++ b/cpp/ql/src/change-notes/2024-10-02-uninitialized-local.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Fixed false positives in the `cpp/uninitialized-local` ("Potentially uninitialized local variable") query if there are extraction errors in the function. From 69e0ad01818ee0f0237a1ccee26d732dbf29e43c Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Wed, 2 Oct 2024 10:55:52 +0200 Subject: [PATCH 42/79] Rust: Refactor CFG implementation for loops --- .../controlflow/internal/ControlFlowGraphImpl.qll | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll b/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll index da156cd7767c..971e4910fabe 100644 --- a/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll +++ b/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll @@ -316,7 +316,11 @@ abstract class LoopingExprTree extends PostOrderTree { abstract Label getLabel(); - abstract predicate entry(AstNode node); + /** + * Gets the node to execute when continuing the loop; either after + * executing the last node in the body or after an explicit `continue`. + */ + abstract AstNode getLoopContinue(); /** Holds if this loop captures the `c` completion. */ private predicate capturesLoopJumpCompletion(LoopJumpCompletion c) { @@ -339,7 +343,7 @@ abstract class LoopingExprTree extends PostOrderTree { or c.(LoopJumpCompletion).isContinue() and this.capturesLoopJumpCompletion(c) ) and - this.entry(succ) + first(this.getLoopContinue(), succ) } override predicate last(AstNode last, Completion c) { @@ -357,7 +361,7 @@ class LoopExprTree extends LoopingExprTree instanceof LoopExpr { override Label getLabel() { result = LoopExpr.super.getLabel() } - override predicate entry(AstNode node) { this.first(node) } + override AstNode getLoopContinue() { result = this.getLoopBody() } override predicate first(AstNode node) { first(this.getLoopBody(), node) } } @@ -367,7 +371,7 @@ class WhileExprTree extends LoopingExprTree instanceof WhileExpr { override Label getLabel() { result = WhileExpr.super.getLabel() } - override predicate entry(AstNode node) { this.first(node) } + override AstNode getLoopContinue() { result = super.getCondition() } override predicate propagatesAbnormal(AstNode child) { child = super.getCondition() } @@ -397,7 +401,7 @@ class ForExprTree extends LoopingExprTree instanceof ForExpr { override Label getLabel() { result = ForExpr.super.getLabel() } - override predicate entry(AstNode n) { first(super.getPat(), n) } + override AstNode getLoopContinue() { result = super.getPat() } override predicate propagatesAbnormal(AstNode child) { child = super.getIterable() } From 9c7216fe4ffde832c9980572629f4a64c7bda734 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Wed, 2 Oct 2024 10:59:26 +0200 Subject: [PATCH 43/79] Rust: Add another CFG test --- .../library-tests/controlflow/Cfg.expected | 880 +++++++++--------- .../ql/test/library-tests/controlflow/test.rs | 14 + 2 files changed, 462 insertions(+), 432 deletions(-) diff --git a/rust/ql/test/library-tests/controlflow/Cfg.expected b/rust/ql/test/library-tests/controlflow/Cfg.expected index aff1576a8294..0e7bf44925cc 100644 --- a/rust/ql/test/library-tests/controlflow/Cfg.expected +++ b/rust/ql/test/library-tests/controlflow/Cfg.expected @@ -97,435 +97,451 @@ | test.rs:47:21:47:36 | ExprStmt | test.rs:47:21:47:35 | ContinueExpr | | | test.rs:49:17:49:31 | ContinueExpr | test.rs:44:17:48:17 | ExprStmt | continue('inner) | | test.rs:49:17:49:32 | ExprStmt | test.rs:49:17:49:31 | ContinueExpr | | -| test.rs:54:5:63:5 | enter test_while | test.rs:55:9:55:25 | LetStmt | | -| test.rs:54:5:63:5 | exit test_while (normal) | test.rs:54:5:63:5 | exit test_while | | -| test.rs:54:27:63:5 | BlockExpr | test.rs:54:5:63:5 | exit test_while (normal) | | -| test.rs:55:9:55:25 | LetStmt | test.rs:55:21:55:24 | true | | -| test.rs:55:13:55:17 | b | test.rs:56:15:56:15 | b | match, no-match | -| test.rs:55:21:55:24 | true | test.rs:55:13:55:17 | b | | -| test.rs:56:9:62:9 | WhileExpr | test.rs:54:27:63:5 | BlockExpr | | -| test.rs:56:15:56:15 | b | test.rs:56:9:62:9 | WhileExpr | false | -| test.rs:56:15:56:15 | b | test.rs:57:13:57:14 | ExprStmt | true | -| test.rs:56:17:62:9 | BlockExpr | test.rs:56:15:56:15 | b | | -| test.rs:57:13:57:13 | 1 | test.rs:58:13:60:13 | ExprStmt | | -| test.rs:57:13:57:14 | ExprStmt | test.rs:57:13:57:13 | 1 | | -| test.rs:58:13:60:13 | ExprStmt | test.rs:58:17:58:17 | i | | -| test.rs:58:13:60:13 | IfExpr | test.rs:61:13:61:22 | ExprStmt | | -| test.rs:58:17:58:17 | i | test.rs:58:21:58:21 | 0 | | -| test.rs:58:17:58:21 | ... > ... | test.rs:58:13:60:13 | IfExpr | false | -| test.rs:58:17:58:21 | ... > ... | test.rs:59:17:59:22 | ExprStmt | true | -| test.rs:58:21:58:21 | 0 | test.rs:58:17:58:21 | ... > ... | | -| test.rs:59:17:59:21 | BreakExpr | test.rs:56:9:62:9 | WhileExpr | break | -| test.rs:59:17:59:22 | ExprStmt | test.rs:59:17:59:21 | BreakExpr | | -| test.rs:61:13:61:13 | PathExpr | test.rs:61:17:61:21 | false | | -| test.rs:61:13:61:21 | ... = ... | test.rs:56:17:62:9 | BlockExpr | | -| test.rs:61:13:61:22 | ExprStmt | test.rs:61:13:61:13 | PathExpr | | -| test.rs:61:17:61:21 | false | test.rs:61:13:61:21 | ... = ... | | -| test.rs:65:5:72:5 | enter test_while_let | test.rs:66:9:66:29 | LetStmt | | -| test.rs:65:5:72:5 | exit test_while_let (normal) | test.rs:65:5:72:5 | exit test_while_let | | -| test.rs:65:25:72:5 | BlockExpr | test.rs:65:5:72:5 | exit test_while_let (normal) | | -| test.rs:66:9:66:29 | LetStmt | test.rs:66:24:66:24 | 1 | | -| test.rs:66:13:66:20 | iter | test.rs:67:15:67:39 | LetExpr | match, no-match | -| test.rs:66:24:66:24 | 1 | test.rs:66:27:66:28 | 10 | | -| test.rs:66:24:66:28 | RangeExpr | test.rs:66:13:66:20 | iter | | -| test.rs:66:27:66:28 | 10 | test.rs:66:24:66:28 | RangeExpr | | -| test.rs:67:9:71:9 | WhileExpr | test.rs:65:25:72:5 | BlockExpr | | -| test.rs:67:15:67:39 | LetExpr | test.rs:67:19:67:25 | TupleStructPat | | -| test.rs:67:19:67:25 | TupleStructPat | test.rs:67:9:71:9 | WhileExpr | no-match | -| test.rs:67:19:67:25 | TupleStructPat | test.rs:68:17:68:17 | PathExpr | match | -| test.rs:67:41:71:9 | BlockExpr | test.rs:67:15:67:39 | LetExpr | | -| test.rs:68:13:70:13 | IfExpr | test.rs:67:41:71:9 | BlockExpr | | -| test.rs:68:17:68:17 | PathExpr | test.rs:68:21:68:21 | 5 | | -| test.rs:68:17:68:21 | ... = ... | test.rs:68:13:70:13 | IfExpr | false | -| test.rs:68:17:68:21 | ... = ... | test.rs:69:17:69:22 | ExprStmt | true | -| test.rs:68:21:68:21 | 5 | test.rs:68:17:68:21 | ... = ... | | -| test.rs:69:17:69:21 | BreakExpr | test.rs:67:9:71:9 | WhileExpr | break | -| test.rs:69:17:69:22 | ExprStmt | test.rs:69:17:69:21 | BreakExpr | | -| test.rs:74:5:81:5 | enter test_for | test.rs:75:18:75:18 | 0 | | -| test.rs:74:5:81:5 | exit test_for (normal) | test.rs:74:5:81:5 | exit test_for | | -| test.rs:74:25:81:5 | BlockExpr | test.rs:74:5:81:5 | exit test_for (normal) | | -| test.rs:75:9:80:9 | ForExpr | test.rs:74:25:81:5 | BlockExpr | | -| test.rs:75:13:75:13 | i | test.rs:75:9:80:9 | ForExpr | no-match | -| test.rs:75:13:75:13 | i | test.rs:76:13:78:13 | ExprStmt | match | -| test.rs:75:18:75:18 | 0 | test.rs:75:21:75:22 | 10 | | -| test.rs:75:18:75:22 | RangeExpr | test.rs:75:13:75:13 | i | | -| test.rs:75:21:75:22 | 10 | test.rs:75:18:75:22 | RangeExpr | | -| test.rs:75:24:80:9 | BlockExpr | test.rs:75:13:75:13 | i | | -| test.rs:76:13:78:13 | ExprStmt | test.rs:76:17:76:17 | i | | -| test.rs:76:13:78:13 | IfExpr | test.rs:79:13:79:14 | ExprStmt | | -| test.rs:76:17:76:17 | i | test.rs:76:22:76:22 | j | | -| test.rs:76:17:76:22 | ... == ... | test.rs:76:13:78:13 | IfExpr | false | -| test.rs:76:17:76:22 | ... == ... | test.rs:77:17:77:22 | ExprStmt | true | -| test.rs:76:22:76:22 | j | test.rs:76:17:76:22 | ... == ... | | -| test.rs:77:17:77:21 | BreakExpr | test.rs:75:9:80:9 | ForExpr | break | -| test.rs:77:17:77:22 | ExprStmt | test.rs:77:17:77:21 | BreakExpr | | -| test.rs:79:13:79:13 | 1 | test.rs:75:24:80:9 | BlockExpr | | -| test.rs:79:13:79:14 | ExprStmt | test.rs:79:13:79:13 | 1 | | -| test.rs:84:1:87:1 | enter test_nested_function | test.rs:85:5:85:28 | LetStmt | | -| test.rs:84:1:87:1 | exit test_nested_function (normal) | test.rs:84:1:87:1 | exit test_nested_function | | -| test.rs:84:40:87:1 | BlockExpr | test.rs:84:1:87:1 | exit test_nested_function (normal) | | -| test.rs:85:5:85:28 | LetStmt | test.rs:85:19:85:27 | ClosureExpr | | -| test.rs:85:9:85:15 | add_one | test.rs:86:5:86:11 | add_one | match, no-match | -| test.rs:85:19:85:27 | ClosureExpr | test.rs:85:9:85:15 | add_one | | -| test.rs:85:19:85:27 | enter ClosureExpr | test.rs:85:23:85:23 | i | | -| test.rs:85:19:85:27 | exit ClosureExpr (normal) | test.rs:85:19:85:27 | exit ClosureExpr | | -| test.rs:85:23:85:23 | i | test.rs:85:27:85:27 | 1 | | -| test.rs:85:23:85:27 | ... + ... | test.rs:85:19:85:27 | exit ClosureExpr (normal) | | -| test.rs:85:27:85:27 | 1 | test.rs:85:23:85:27 | ... + ... | | -| test.rs:86:5:86:11 | add_one | test.rs:86:13:86:19 | add_one | | -| test.rs:86:5:86:23 | CallExpr | test.rs:84:40:87:1 | BlockExpr | | -| test.rs:86:13:86:19 | add_one | test.rs:86:21:86:21 | n | | -| test.rs:86:13:86:22 | CallExpr | test.rs:86:5:86:23 | CallExpr | | -| test.rs:86:21:86:21 | n | test.rs:86:13:86:22 | CallExpr | | -| test.rs:91:5:97:5 | enter test_if_else | test.rs:92:12:92:12 | n | | -| test.rs:91:5:97:5 | exit test_if_else (normal) | test.rs:91:5:97:5 | exit test_if_else | | -| test.rs:91:36:97:5 | BlockExpr | test.rs:91:5:97:5 | exit test_if_else (normal) | | -| test.rs:92:9:96:9 | IfExpr | test.rs:91:36:97:5 | BlockExpr | | -| test.rs:92:12:92:12 | n | test.rs:92:17:92:17 | 0 | | -| test.rs:92:12:92:17 | ... <= ... | test.rs:93:13:93:13 | 0 | true | -| test.rs:92:12:92:17 | ... <= ... | test.rs:95:13:95:13 | n | false | -| test.rs:92:17:92:17 | 0 | test.rs:92:12:92:17 | ... <= ... | | -| test.rs:92:19:94:9 | BlockExpr | test.rs:92:9:96:9 | IfExpr | | -| test.rs:93:13:93:13 | 0 | test.rs:92:19:94:9 | BlockExpr | | -| test.rs:94:16:96:9 | BlockExpr | test.rs:92:9:96:9 | IfExpr | | -| test.rs:95:13:95:13 | n | test.rs:95:17:95:17 | 1 | | -| test.rs:95:13:95:17 | ... - ... | test.rs:94:16:96:9 | BlockExpr | | -| test.rs:95:17:95:17 | 1 | test.rs:95:13:95:17 | ... - ... | | -| test.rs:99:5:105:5 | enter test_if_let_else | test.rs:100:12:100:26 | LetExpr | | -| test.rs:99:5:105:5 | exit test_if_let_else (normal) | test.rs:99:5:105:5 | exit test_if_let_else | | -| test.rs:99:48:105:5 | BlockExpr | test.rs:99:5:105:5 | exit test_if_let_else (normal) | | -| test.rs:100:9:104:9 | IfExpr | test.rs:99:48:105:5 | BlockExpr | | -| test.rs:100:12:100:26 | LetExpr | test.rs:100:16:100:22 | TupleStructPat | | -| test.rs:100:16:100:22 | TupleStructPat | test.rs:101:13:101:13 | n | match | -| test.rs:100:16:100:22 | TupleStructPat | test.rs:103:13:103:13 | 0 | no-match | -| test.rs:100:28:102:9 | BlockExpr | test.rs:100:9:104:9 | IfExpr | | -| test.rs:101:13:101:13 | n | test.rs:100:28:102:9 | BlockExpr | | -| test.rs:102:16:104:9 | BlockExpr | test.rs:100:9:104:9 | IfExpr | | -| test.rs:103:13:103:13 | 0 | test.rs:102:16:104:9 | BlockExpr | | -| test.rs:107:5:112:5 | enter test_if_let | test.rs:108:9:110:9 | ExprStmt | | -| test.rs:107:5:112:5 | exit test_if_let (normal) | test.rs:107:5:112:5 | exit test_if_let | | -| test.rs:107:43:112:5 | BlockExpr | test.rs:107:5:112:5 | exit test_if_let (normal) | | -| test.rs:108:9:110:9 | ExprStmt | test.rs:108:12:108:26 | LetExpr | | -| test.rs:108:9:110:9 | IfExpr | test.rs:111:9:111:9 | 0 | | -| test.rs:108:12:108:26 | LetExpr | test.rs:108:16:108:22 | TupleStructPat | | -| test.rs:108:16:108:22 | TupleStructPat | test.rs:108:9:110:9 | IfExpr | no-match | -| test.rs:108:16:108:22 | TupleStructPat | test.rs:109:13:109:13 | n | match | -| test.rs:108:28:110:9 | BlockExpr | test.rs:108:9:110:9 | IfExpr | | -| test.rs:109:13:109:13 | n | test.rs:108:28:110:9 | BlockExpr | | -| test.rs:111:9:111:9 | 0 | test.rs:107:43:112:5 | BlockExpr | | -| test.rs:114:5:120:5 | enter test_nested_if | test.rs:115:16:115:16 | PathExpr | | -| test.rs:114:5:120:5 | exit test_nested_if (normal) | test.rs:114:5:120:5 | exit test_nested_if | | -| test.rs:114:38:120:5 | BlockExpr | test.rs:114:5:120:5 | exit test_nested_if (normal) | | -| test.rs:115:9:119:9 | IfExpr | test.rs:114:38:120:5 | BlockExpr | | -| test.rs:115:13:115:48 | IfExpr | test.rs:116:13:116:13 | 1 | true | -| test.rs:115:13:115:48 | IfExpr | test.rs:118:13:118:13 | 0 | false | -| test.rs:115:16:115:16 | PathExpr | test.rs:115:20:115:20 | 0 | | -| test.rs:115:16:115:20 | ... < ... | test.rs:115:24:115:24 | a | true | -| test.rs:115:16:115:20 | ... < ... | test.rs:115:41:115:41 | a | false | -| test.rs:115:20:115:20 | 0 | test.rs:115:16:115:20 | ... < ... | | -| test.rs:115:22:115:32 | BlockExpr | test.rs:115:13:115:48 | IfExpr | false, true | -| test.rs:115:24:115:24 | a | test.rs:115:29:115:30 | 10 | | -| test.rs:115:24:115:30 | ... < ... | test.rs:115:22:115:32 | BlockExpr | false, true | -| test.rs:115:28:115:30 | - ... | test.rs:115:24:115:30 | ... < ... | | -| test.rs:115:29:115:30 | 10 | test.rs:115:28:115:30 | - ... | | -| test.rs:115:39:115:48 | BlockExpr | test.rs:115:13:115:48 | IfExpr | false, true | -| test.rs:115:41:115:41 | a | test.rs:115:45:115:46 | 10 | | -| test.rs:115:41:115:46 | ... > ... | test.rs:115:39:115:48 | BlockExpr | false, true | -| test.rs:115:45:115:46 | 10 | test.rs:115:41:115:46 | ... > ... | | -| test.rs:115:51:117:9 | BlockExpr | test.rs:115:9:119:9 | IfExpr | | -| test.rs:116:13:116:13 | 1 | test.rs:115:51:117:9 | BlockExpr | | -| test.rs:117:16:119:9 | BlockExpr | test.rs:115:9:119:9 | IfExpr | | -| test.rs:118:13:118:13 | 0 | test.rs:117:16:119:9 | BlockExpr | | -| test.rs:122:5:131:5 | enter test_nested_if_match | test.rs:123:19:123:19 | a | | -| test.rs:122:5:131:5 | exit test_nested_if_match (normal) | test.rs:122:5:131:5 | exit test_nested_if_match | | -| test.rs:122:44:131:5 | BlockExpr | test.rs:122:5:131:5 | exit test_nested_if_match (normal) | | -| test.rs:123:9:130:9 | IfExpr | test.rs:122:44:131:5 | BlockExpr | | -| test.rs:123:13:126:9 | MatchExpr | test.rs:127:13:127:13 | 1 | true | -| test.rs:123:13:126:9 | MatchExpr | test.rs:129:13:129:13 | 0 | false | -| test.rs:123:19:123:19 | a | test.rs:124:13:124:13 | LiteralPat | | -| test.rs:124:13:124:13 | LiteralPat | test.rs:124:18:124:21 | true | match | -| test.rs:124:13:124:13 | LiteralPat | test.rs:125:13:125:13 | WildcardPat | no-match | -| test.rs:124:18:124:21 | true | test.rs:123:13:126:9 | MatchExpr | | -| test.rs:125:13:125:13 | WildcardPat | test.rs:125:18:125:22 | false | match | -| test.rs:125:18:125:22 | false | test.rs:123:13:126:9 | MatchExpr | | -| test.rs:126:12:128:9 | BlockExpr | test.rs:123:9:130:9 | IfExpr | | -| test.rs:127:13:127:13 | 1 | test.rs:126:12:128:9 | BlockExpr | | -| test.rs:128:16:130:9 | BlockExpr | test.rs:123:9:130:9 | IfExpr | | -| test.rs:129:13:129:13 | 0 | test.rs:128:16:130:9 | BlockExpr | | -| test.rs:133:5:142:5 | enter test_nested_if_block | test.rs:135:13:135:15 | ExprStmt | | -| test.rs:133:5:142:5 | exit test_nested_if_block (normal) | test.rs:133:5:142:5 | exit test_nested_if_block | | -| test.rs:133:44:142:5 | BlockExpr | test.rs:133:5:142:5 | exit test_nested_if_block (normal) | | -| test.rs:134:9:141:9 | IfExpr | test.rs:133:44:142:5 | BlockExpr | | -| test.rs:134:12:137:9 | BlockExpr | test.rs:138:13:138:13 | 1 | true | -| test.rs:134:12:137:9 | BlockExpr | test.rs:140:13:140:13 | 0 | false | -| test.rs:135:13:135:14 | TupleExpr | test.rs:136:13:136:13 | a | | -| test.rs:135:13:135:15 | ExprStmt | test.rs:135:13:135:14 | TupleExpr | | -| test.rs:136:13:136:13 | a | test.rs:136:17:136:17 | 0 | | -| test.rs:136:13:136:17 | ... > ... | test.rs:134:12:137:9 | BlockExpr | false, true | -| test.rs:136:17:136:17 | 0 | test.rs:136:13:136:17 | ... > ... | | -| test.rs:137:11:139:9 | BlockExpr | test.rs:134:9:141:9 | IfExpr | | -| test.rs:138:13:138:13 | 1 | test.rs:137:11:139:9 | BlockExpr | | -| test.rs:139:16:141:9 | BlockExpr | test.rs:134:9:141:9 | IfExpr | | -| test.rs:140:13:140:13 | 0 | test.rs:139:16:141:9 | BlockExpr | | -| test.rs:144:5:151:5 | enter test_if_assignment | test.rs:145:9:145:26 | LetStmt | | -| test.rs:144:5:151:5 | exit test_if_assignment (normal) | test.rs:144:5:151:5 | exit test_if_assignment | | -| test.rs:144:42:151:5 | BlockExpr | test.rs:144:5:151:5 | exit test_if_assignment (normal) | | -| test.rs:145:9:145:26 | LetStmt | test.rs:145:21:145:25 | false | | -| test.rs:145:13:145:17 | x | test.rs:146:12:146:12 | x | match, no-match | -| test.rs:145:21:145:25 | false | test.rs:145:13:145:17 | x | | -| test.rs:146:9:150:9 | IfExpr | test.rs:144:42:151:5 | BlockExpr | | -| test.rs:146:12:146:12 | x | test.rs:146:16:146:19 | true | | -| test.rs:146:12:146:19 | ... = ... | test.rs:147:13:147:13 | 1 | true | -| test.rs:146:12:146:19 | ... = ... | test.rs:149:13:149:13 | 0 | false | -| test.rs:146:16:146:19 | true | test.rs:146:12:146:19 | ... = ... | | -| test.rs:146:21:148:9 | BlockExpr | test.rs:146:9:150:9 | IfExpr | | -| test.rs:147:13:147:13 | 1 | test.rs:146:21:148:9 | BlockExpr | | -| test.rs:148:16:150:9 | BlockExpr | test.rs:146:9:150:9 | IfExpr | | -| test.rs:149:13:149:13 | 0 | test.rs:148:16:150:9 | BlockExpr | | -| test.rs:153:5:164:5 | enter test_if_loop1 | test.rs:155:13:157:14 | ExprStmt | | -| test.rs:153:5:164:5 | exit test_if_loop1 (normal) | test.rs:153:5:164:5 | exit test_if_loop1 | | -| test.rs:153:37:164:5 | BlockExpr | test.rs:153:5:164:5 | exit test_if_loop1 (normal) | | -| test.rs:154:9:163:9 | IfExpr | test.rs:153:37:164:5 | BlockExpr | | -| test.rs:154:13:159:9 | LoopExpr | test.rs:160:13:160:13 | 1 | true | -| test.rs:154:13:159:9 | LoopExpr | test.rs:162:13:162:13 | 0 | false | -| test.rs:154:18:159:9 | BlockExpr | test.rs:155:13:157:14 | ExprStmt | | -| test.rs:155:13:157:13 | IfExpr | test.rs:158:13:158:19 | ExprStmt | | -| test.rs:155:13:157:14 | ExprStmt | test.rs:155:16:155:16 | a | | -| test.rs:155:16:155:16 | a | test.rs:155:20:155:20 | 0 | | -| test.rs:155:16:155:20 | ... > ... | test.rs:155:13:157:13 | IfExpr | false | -| test.rs:155:16:155:20 | ... > ... | test.rs:156:17:156:29 | ExprStmt | true | -| test.rs:155:20:155:20 | 0 | test.rs:155:16:155:20 | ... > ... | | -| test.rs:156:17:156:28 | BreakExpr | test.rs:154:13:159:9 | LoopExpr | break | -| test.rs:156:17:156:29 | ExprStmt | test.rs:156:23:156:23 | a | | -| test.rs:156:23:156:23 | a | test.rs:156:27:156:28 | 10 | | -| test.rs:156:23:156:28 | ... > ... | test.rs:156:17:156:28 | BreakExpr | | -| test.rs:156:27:156:28 | 10 | test.rs:156:23:156:28 | ... > ... | | -| test.rs:158:13:158:13 | a | test.rs:158:17:158:18 | 10 | | -| test.rs:158:13:158:18 | ... < ... | test.rs:154:18:159:9 | BlockExpr | | -| test.rs:158:13:158:19 | ExprStmt | test.rs:158:13:158:13 | a | | -| test.rs:158:17:158:18 | 10 | test.rs:158:13:158:18 | ... < ... | | -| test.rs:159:12:161:9 | BlockExpr | test.rs:154:9:163:9 | IfExpr | | -| test.rs:160:13:160:13 | 1 | test.rs:159:12:161:9 | BlockExpr | | -| test.rs:161:16:163:9 | BlockExpr | test.rs:154:9:163:9 | IfExpr | | -| test.rs:162:13:162:13 | 0 | test.rs:161:16:163:9 | BlockExpr | | -| test.rs:166:5:177:5 | enter test_if_loop2 | test.rs:168:13:170:14 | ExprStmt | | -| test.rs:166:5:177:5 | exit test_if_loop2 (normal) | test.rs:166:5:177:5 | exit test_if_loop2 | | -| test.rs:166:37:177:5 | BlockExpr | test.rs:166:5:177:5 | exit test_if_loop2 (normal) | | -| test.rs:167:9:176:9 | IfExpr | test.rs:166:37:177:5 | BlockExpr | | -| test.rs:167:13:172:9 | LoopExpr | test.rs:173:13:173:13 | 1 | true | -| test.rs:167:13:172:9 | LoopExpr | test.rs:175:13:175:13 | 0 | false | -| test.rs:167:26:172:9 | BlockExpr | test.rs:168:13:170:14 | ExprStmt | | -| test.rs:168:13:170:13 | IfExpr | test.rs:171:13:171:19 | ExprStmt | | -| test.rs:168:13:170:14 | ExprStmt | test.rs:168:16:168:16 | a | | -| test.rs:168:16:168:16 | a | test.rs:168:20:168:20 | 0 | | -| test.rs:168:16:168:20 | ... > ... | test.rs:168:13:170:13 | IfExpr | false | -| test.rs:168:16:168:20 | ... > ... | test.rs:169:17:169:36 | ExprStmt | true | -| test.rs:168:20:168:20 | 0 | test.rs:168:16:168:20 | ... > ... | | -| test.rs:169:17:169:35 | BreakExpr | test.rs:167:13:172:9 | LoopExpr | break('label) | -| test.rs:169:17:169:36 | ExprStmt | test.rs:169:30:169:30 | a | | -| test.rs:169:30:169:30 | a | test.rs:169:34:169:35 | 10 | | -| test.rs:169:30:169:35 | ... > ... | test.rs:169:17:169:35 | BreakExpr | | -| test.rs:169:34:169:35 | 10 | test.rs:169:30:169:35 | ... > ... | | -| test.rs:171:13:171:13 | a | test.rs:171:17:171:18 | 10 | | -| test.rs:171:13:171:18 | ... < ... | test.rs:167:26:172:9 | BlockExpr | | -| test.rs:171:13:171:19 | ExprStmt | test.rs:171:13:171:13 | a | | -| test.rs:171:17:171:18 | 10 | test.rs:171:13:171:18 | ... < ... | | -| test.rs:172:12:174:9 | BlockExpr | test.rs:167:9:176:9 | IfExpr | | -| test.rs:173:13:173:13 | 1 | test.rs:172:12:174:9 | BlockExpr | | -| test.rs:174:16:176:9 | BlockExpr | test.rs:167:9:176:9 | IfExpr | | -| test.rs:175:13:175:13 | 0 | test.rs:174:16:176:9 | BlockExpr | | -| test.rs:179:5:187:5 | enter test_labelled_block | test.rs:181:13:181:31 | ExprStmt | | -| test.rs:179:5:187:5 | exit test_labelled_block (normal) | test.rs:179:5:187:5 | exit test_labelled_block | | -| test.rs:179:43:187:5 | BlockExpr | test.rs:179:5:187:5 | exit test_labelled_block (normal) | | -| test.rs:180:9:186:9 | IfExpr | test.rs:179:43:187:5 | BlockExpr | | -| test.rs:180:13:182:9 | BlockExpr | test.rs:183:13:183:13 | 1 | true | -| test.rs:180:13:182:9 | BlockExpr | test.rs:185:13:185:13 | 0 | false | -| test.rs:181:13:181:30 | BreakExpr | test.rs:180:13:182:9 | BlockExpr | break('block) | -| test.rs:181:13:181:31 | ExprStmt | test.rs:181:26:181:26 | a | | -| test.rs:181:26:181:26 | a | test.rs:181:30:181:30 | 0 | | -| test.rs:181:26:181:30 | ... > ... | test.rs:181:13:181:30 | BreakExpr | | -| test.rs:181:30:181:30 | 0 | test.rs:181:26:181:30 | ... > ... | | -| test.rs:182:12:184:9 | BlockExpr | test.rs:180:9:186:9 | IfExpr | | -| test.rs:183:13:183:13 | 1 | test.rs:182:12:184:9 | BlockExpr | | -| test.rs:184:16:186:9 | BlockExpr | test.rs:180:9:186:9 | IfExpr | | -| test.rs:185:13:185:13 | 0 | test.rs:184:16:186:9 | BlockExpr | | -| test.rs:192:5:195:5 | enter test_and_operator | test.rs:193:9:193:28 | LetStmt | | -| test.rs:192:5:195:5 | exit test_and_operator (normal) | test.rs:192:5:195:5 | exit test_and_operator | | -| test.rs:192:61:195:5 | BlockExpr | test.rs:192:5:195:5 | exit test_and_operator (normal) | | -| test.rs:193:9:193:28 | LetStmt | test.rs:193:17:193:27 | ... && ... | | -| test.rs:193:13:193:13 | d | test.rs:194:9:194:9 | d | match, no-match | -| test.rs:193:17:193:17 | a | test.rs:193:13:193:13 | d | false | -| test.rs:193:17:193:17 | a | test.rs:193:22:193:22 | b | true | -| test.rs:193:17:193:22 | ... && ... | test.rs:193:17:193:17 | a | | -| test.rs:193:17:193:27 | ... && ... | test.rs:193:17:193:22 | ... && ... | | -| test.rs:193:22:193:22 | b | test.rs:193:13:193:13 | d | false | -| test.rs:193:22:193:22 | b | test.rs:193:27:193:27 | c | true | -| test.rs:193:27:193:27 | c | test.rs:193:13:193:13 | d | | -| test.rs:194:9:194:9 | d | test.rs:192:61:195:5 | BlockExpr | | -| test.rs:197:5:200:5 | enter test_or_operator | test.rs:198:9:198:28 | LetStmt | | -| test.rs:197:5:200:5 | exit test_or_operator (normal) | test.rs:197:5:200:5 | exit test_or_operator | | -| test.rs:197:60:200:5 | BlockExpr | test.rs:197:5:200:5 | exit test_or_operator (normal) | | -| test.rs:198:9:198:28 | LetStmt | test.rs:198:17:198:27 | ... \|\| ... | | -| test.rs:198:13:198:13 | d | test.rs:199:9:199:9 | d | match, no-match | -| test.rs:198:17:198:17 | a | test.rs:198:13:198:13 | d | true | -| test.rs:198:17:198:17 | a | test.rs:198:22:198:22 | b | false | -| test.rs:198:17:198:22 | ... \|\| ... | test.rs:198:17:198:17 | a | | -| test.rs:198:17:198:27 | ... \|\| ... | test.rs:198:17:198:22 | ... \|\| ... | | -| test.rs:198:22:198:22 | b | test.rs:198:13:198:13 | d | true | -| test.rs:198:22:198:22 | b | test.rs:198:27:198:27 | c | false | -| test.rs:198:27:198:27 | c | test.rs:198:13:198:13 | d | | -| test.rs:199:9:199:9 | d | test.rs:197:60:200:5 | BlockExpr | | -| test.rs:202:5:205:5 | enter test_or_operator_2 | test.rs:203:9:203:36 | LetStmt | | -| test.rs:202:5:205:5 | exit test_or_operator_2 (normal) | test.rs:202:5:205:5 | exit test_or_operator_2 | | -| test.rs:202:61:205:5 | BlockExpr | test.rs:202:5:205:5 | exit test_or_operator_2 (normal) | | -| test.rs:203:9:203:36 | LetStmt | test.rs:203:17:203:35 | ... \|\| ... | | -| test.rs:203:13:203:13 | d | test.rs:204:9:204:9 | d | match, no-match | -| test.rs:203:17:203:17 | a | test.rs:203:13:203:13 | d | true | -| test.rs:203:17:203:17 | a | test.rs:203:23:203:23 | b | false | -| test.rs:203:17:203:30 | ... \|\| ... | test.rs:203:17:203:17 | a | | -| test.rs:203:17:203:35 | ... \|\| ... | test.rs:203:17:203:30 | ... \|\| ... | | -| test.rs:203:23:203:23 | b | test.rs:203:28:203:29 | 28 | | -| test.rs:203:23:203:29 | ... == ... | test.rs:203:13:203:13 | d | true | -| test.rs:203:23:203:29 | ... == ... | test.rs:203:35:203:35 | c | false | -| test.rs:203:28:203:29 | 28 | test.rs:203:23:203:29 | ... == ... | | -| test.rs:203:35:203:35 | c | test.rs:203:13:203:13 | d | | -| test.rs:204:9:204:9 | d | test.rs:202:61:205:5 | BlockExpr | | -| test.rs:207:5:210:5 | enter test_not_operator | test.rs:208:9:208:19 | LetStmt | | -| test.rs:207:5:210:5 | exit test_not_operator (normal) | test.rs:207:5:210:5 | exit test_not_operator | | -| test.rs:207:43:210:5 | BlockExpr | test.rs:207:5:210:5 | exit test_not_operator (normal) | | -| test.rs:208:9:208:19 | LetStmt | test.rs:208:18:208:18 | a | | -| test.rs:208:13:208:13 | d | test.rs:209:9:209:9 | d | match, no-match | -| test.rs:208:17:208:18 | ! ... | test.rs:208:13:208:13 | d | | -| test.rs:208:18:208:18 | a | test.rs:208:17:208:18 | ! ... | | -| test.rs:209:9:209:9 | d | test.rs:207:43:210:5 | BlockExpr | | -| test.rs:212:5:218:5 | enter test_if_and_operator | test.rs:213:12:213:22 | ... && ... | | -| test.rs:212:5:218:5 | exit test_if_and_operator (normal) | test.rs:212:5:218:5 | exit test_if_and_operator | | -| test.rs:212:63:218:5 | BlockExpr | test.rs:212:5:218:5 | exit test_if_and_operator (normal) | | -| test.rs:213:9:217:9 | IfExpr | test.rs:212:63:218:5 | BlockExpr | | -| test.rs:213:12:213:12 | a | test.rs:213:17:213:17 | b | true | -| test.rs:213:12:213:12 | a | test.rs:216:13:216:17 | false | false | -| test.rs:213:12:213:17 | ... && ... | test.rs:213:12:213:12 | a | | -| test.rs:213:12:213:22 | ... && ... | test.rs:213:12:213:17 | ... && ... | | -| test.rs:213:17:213:17 | b | test.rs:213:22:213:22 | c | true | -| test.rs:213:17:213:17 | b | test.rs:216:13:216:17 | false | false | -| test.rs:213:22:213:22 | c | test.rs:214:13:214:16 | true | true | -| test.rs:213:22:213:22 | c | test.rs:216:13:216:17 | false | false | -| test.rs:213:24:215:9 | BlockExpr | test.rs:213:9:217:9 | IfExpr | | -| test.rs:214:13:214:16 | true | test.rs:213:24:215:9 | BlockExpr | | -| test.rs:215:16:217:9 | BlockExpr | test.rs:213:9:217:9 | IfExpr | | -| test.rs:216:13:216:17 | false | test.rs:215:16:217:9 | BlockExpr | | -| test.rs:220:5:226:5 | enter test_if_or_operator | test.rs:221:12:221:22 | ... \|\| ... | | -| test.rs:220:5:226:5 | exit test_if_or_operator (normal) | test.rs:220:5:226:5 | exit test_if_or_operator | | -| test.rs:220:62:226:5 | BlockExpr | test.rs:220:5:226:5 | exit test_if_or_operator (normal) | | -| test.rs:221:9:225:9 | IfExpr | test.rs:220:62:226:5 | BlockExpr | | -| test.rs:221:12:221:12 | a | test.rs:221:17:221:17 | b | false | -| test.rs:221:12:221:12 | a | test.rs:222:13:222:16 | true | true | -| test.rs:221:12:221:17 | ... \|\| ... | test.rs:221:12:221:12 | a | | -| test.rs:221:12:221:22 | ... \|\| ... | test.rs:221:12:221:17 | ... \|\| ... | | -| test.rs:221:17:221:17 | b | test.rs:221:22:221:22 | c | false | -| test.rs:221:17:221:17 | b | test.rs:222:13:222:16 | true | true | -| test.rs:221:22:221:22 | c | test.rs:222:13:222:16 | true | true | -| test.rs:221:22:221:22 | c | test.rs:224:13:224:17 | false | false | -| test.rs:221:24:223:9 | BlockExpr | test.rs:221:9:225:9 | IfExpr | | -| test.rs:222:13:222:16 | true | test.rs:221:24:223:9 | BlockExpr | | -| test.rs:223:16:225:9 | BlockExpr | test.rs:221:9:225:9 | IfExpr | | -| test.rs:224:13:224:17 | false | test.rs:223:16:225:9 | BlockExpr | | -| test.rs:228:5:234:5 | enter test_if_not_operator | test.rs:229:13:229:13 | a | | -| test.rs:228:5:234:5 | exit test_if_not_operator (normal) | test.rs:228:5:234:5 | exit test_if_not_operator | | -| test.rs:228:46:234:5 | BlockExpr | test.rs:228:5:234:5 | exit test_if_not_operator (normal) | | -| test.rs:229:9:233:9 | IfExpr | test.rs:228:46:234:5 | BlockExpr | | -| test.rs:229:12:229:13 | ! ... | test.rs:230:13:230:16 | true | true | -| test.rs:229:12:229:13 | ! ... | test.rs:232:13:232:17 | false | false | -| test.rs:229:13:229:13 | a | test.rs:229:12:229:13 | ! ... | false, true | -| test.rs:229:15:231:9 | BlockExpr | test.rs:229:9:233:9 | IfExpr | | -| test.rs:230:13:230:16 | true | test.rs:229:15:231:9 | BlockExpr | | -| test.rs:231:16:233:9 | BlockExpr | test.rs:229:9:233:9 | IfExpr | | -| test.rs:232:13:232:17 | false | test.rs:231:16:233:9 | BlockExpr | | -| test.rs:237:1:243:1 | enter test_match | test.rs:238:11:238:21 | maybe_digit | | -| test.rs:237:1:243:1 | exit test_match (normal) | test.rs:237:1:243:1 | exit test_match | | -| test.rs:237:48:243:1 | BlockExpr | test.rs:237:1:243:1 | exit test_match (normal) | | -| test.rs:238:5:242:5 | MatchExpr | test.rs:237:48:243:1 | BlockExpr | | -| test.rs:238:11:238:21 | maybe_digit | test.rs:239:9:239:23 | TupleStructPat | | -| test.rs:239:9:239:23 | TupleStructPat | test.rs:239:28:239:28 | x | match | -| test.rs:239:9:239:23 | TupleStructPat | test.rs:240:9:240:23 | TupleStructPat | no-match | -| test.rs:239:28:239:28 | x | test.rs:239:32:239:33 | 10 | | -| test.rs:239:28:239:33 | ... < ... | test.rs:239:38:239:38 | x | true | -| test.rs:239:28:239:33 | ... < ... | test.rs:240:9:240:23 | TupleStructPat | false | -| test.rs:239:32:239:33 | 10 | test.rs:239:28:239:33 | ... < ... | | -| test.rs:239:38:239:38 | x | test.rs:239:42:239:42 | 5 | | -| test.rs:239:38:239:42 | ... + ... | test.rs:238:5:242:5 | MatchExpr | | -| test.rs:239:42:239:42 | 5 | test.rs:239:38:239:42 | ... + ... | | -| test.rs:240:9:240:23 | TupleStructPat | test.rs:240:28:240:28 | x | match | -| test.rs:240:9:240:23 | TupleStructPat | test.rs:241:9:241:20 | PathPat | no-match | -| test.rs:240:28:240:28 | x | test.rs:238:5:242:5 | MatchExpr | | -| test.rs:241:9:241:20 | PathPat | test.rs:241:25:241:25 | 5 | match | -| test.rs:241:25:241:25 | 5 | test.rs:238:5:242:5 | MatchExpr | | -| test.rs:246:5:251:5 | enter test_infinite_loop | test.rs:247:9:249:9 | ExprStmt | | -| test.rs:247:9:249:9 | ExprStmt | test.rs:248:13:248:13 | 1 | | -| test.rs:247:14:249:9 | BlockExpr | test.rs:248:13:248:13 | 1 | | -| test.rs:248:13:248:13 | 1 | test.rs:247:14:249:9 | BlockExpr | | -| test.rs:253:5:256:5 | enter test_let_match | test.rs:254:9:254:49 | LetStmt | | -| test.rs:253:5:256:5 | exit test_let_match (normal) | test.rs:253:5:256:5 | exit test_let_match | | -| test.rs:253:39:256:5 | BlockExpr | test.rs:253:5:256:5 | exit test_let_match (normal) | | -| test.rs:254:9:254:49 | LetStmt | test.rs:254:23:254:23 | a | | -| test.rs:254:13:254:19 | TupleStructPat | test.rs:254:32:254:46 | "Expected some" | no-match | -| test.rs:254:13:254:19 | TupleStructPat | test.rs:255:9:255:9 | n | match | -| test.rs:254:23:254:23 | a | test.rs:254:13:254:19 | TupleStructPat | | -| test.rs:254:32:254:46 | "Expected some" | test.rs:254:30:254:48 | BlockExpr | | -| test.rs:255:9:255:9 | n | test.rs:253:39:256:5 | BlockExpr | | -| test.rs:259:1:264:1 | enter dead_code | test.rs:260:5:262:5 | ExprStmt | | -| test.rs:259:1:264:1 | exit dead_code (normal) | test.rs:259:1:264:1 | exit dead_code | | -| test.rs:260:5:262:5 | ExprStmt | test.rs:260:9:260:12 | true | | -| test.rs:260:9:260:12 | true | test.rs:261:9:261:17 | ExprStmt | true | -| test.rs:261:9:261:16 | ReturnExpr | test.rs:259:1:264:1 | exit dead_code (normal) | return | -| test.rs:261:9:261:17 | ExprStmt | test.rs:261:16:261:16 | 0 | | -| test.rs:261:16:261:16 | 0 | test.rs:261:9:261:16 | ReturnExpr | | -| test.rs:266:1:279:1 | enter labelled_block1 | test.rs:267:5:278:6 | LetStmt | | -| test.rs:266:1:279:1 | exit labelled_block1 (normal) | test.rs:266:1:279:1 | exit labelled_block1 | | -| test.rs:266:29:279:1 | BlockExpr | test.rs:266:1:279:1 | exit labelled_block1 (normal) | | -| test.rs:267:5:278:6 | LetStmt | test.rs:268:9:268:19 | ExprStmt | | -| test.rs:267:9:267:14 | result | test.rs:266:29:279:1 | BlockExpr | match, no-match | -| test.rs:267:18:278:5 | BlockExpr | test.rs:267:9:267:14 | result | | -| test.rs:268:9:268:16 | PathExpr | test.rs:268:9:268:18 | CallExpr | | -| test.rs:268:9:268:18 | CallExpr | test.rs:269:9:271:9 | ExprStmt | | -| test.rs:268:9:268:19 | ExprStmt | test.rs:268:9:268:16 | PathExpr | | -| test.rs:269:9:271:9 | ExprStmt | test.rs:269:12:269:28 | PathExpr | | -| test.rs:269:9:271:9 | IfExpr | test.rs:272:9:272:24 | ExprStmt | | -| test.rs:269:12:269:28 | PathExpr | test.rs:269:12:269:30 | CallExpr | | -| test.rs:269:12:269:30 | CallExpr | test.rs:269:9:271:9 | IfExpr | false | -| test.rs:269:12:269:30 | CallExpr | test.rs:270:13:270:27 | ExprStmt | true | -| test.rs:270:13:270:26 | BreakExpr | test.rs:267:18:278:5 | BlockExpr | break('block) | -| test.rs:270:13:270:27 | ExprStmt | test.rs:270:26:270:26 | 1 | | -| test.rs:270:26:270:26 | 1 | test.rs:270:13:270:26 | BreakExpr | | -| test.rs:272:9:272:21 | PathExpr | test.rs:272:9:272:23 | CallExpr | | -| test.rs:272:9:272:23 | CallExpr | test.rs:273:9:275:9 | ExprStmt | | -| test.rs:272:9:272:24 | ExprStmt | test.rs:272:9:272:21 | PathExpr | | -| test.rs:273:9:275:9 | ExprStmt | test.rs:273:12:273:28 | PathExpr | | -| test.rs:273:9:275:9 | IfExpr | test.rs:276:9:276:24 | ExprStmt | | -| test.rs:273:12:273:28 | PathExpr | test.rs:273:12:273:30 | CallExpr | | -| test.rs:273:12:273:30 | CallExpr | test.rs:273:9:275:9 | IfExpr | false | -| test.rs:273:12:273:30 | CallExpr | test.rs:274:13:274:27 | ExprStmt | true | -| test.rs:274:13:274:26 | BreakExpr | test.rs:267:18:278:5 | BlockExpr | break('block) | -| test.rs:274:13:274:27 | ExprStmt | test.rs:274:26:274:26 | 2 | | -| test.rs:274:26:274:26 | 2 | test.rs:274:13:274:26 | BreakExpr | | -| test.rs:276:9:276:21 | PathExpr | test.rs:276:9:276:23 | CallExpr | | -| test.rs:276:9:276:23 | CallExpr | test.rs:277:9:277:9 | 3 | | -| test.rs:276:9:276:24 | ExprStmt | test.rs:276:9:276:21 | PathExpr | | -| test.rs:277:9:277:9 | 3 | test.rs:267:18:278:5 | BlockExpr | | -| test.rs:281:1:289:1 | enter labelled_block2 | test.rs:282:5:288:6 | LetStmt | | -| test.rs:281:1:289:1 | exit labelled_block2 (normal) | test.rs:281:1:289:1 | exit labelled_block2 | | -| test.rs:281:29:289:1 | BlockExpr | test.rs:281:1:289:1 | exit labelled_block2 (normal) | | -| test.rs:282:5:288:6 | LetStmt | test.rs:283:9:283:34 | LetStmt | | -| test.rs:282:9:282:14 | result | test.rs:281:29:289:1 | BlockExpr | match, no-match | -| test.rs:282:18:288:5 | BlockExpr | test.rs:282:9:282:14 | result | | -| test.rs:283:9:283:34 | LetStmt | test.rs:283:30:283:33 | PathExpr | | -| test.rs:283:13:283:13 | x | test.rs:284:9:286:10 | LetStmt | match, no-match | -| test.rs:283:30:283:33 | PathExpr | test.rs:283:13:283:13 | x | | -| test.rs:284:9:286:10 | LetStmt | test.rs:284:23:284:23 | x | | -| test.rs:284:13:284:19 | TupleStructPat | test.rs:285:13:285:27 | ExprStmt | no-match | -| test.rs:284:13:284:19 | TupleStructPat | test.rs:287:9:287:9 | x | match | -| test.rs:284:23:284:23 | x | test.rs:284:13:284:19 | TupleStructPat | | -| test.rs:285:13:285:26 | BreakExpr | test.rs:282:18:288:5 | BlockExpr | break('block) | -| test.rs:285:13:285:27 | ExprStmt | test.rs:285:26:285:26 | 1 | | -| test.rs:285:26:285:26 | 1 | test.rs:285:13:285:26 | BreakExpr | | -| test.rs:287:9:287:9 | x | test.rs:282:18:288:5 | BlockExpr | | +| test.rs:54:5:66:5 | enter test_loop_label_shadowing | test.rs:56:13:56:14 | ExprStmt | | +| test.rs:56:13:56:13 | 1 | test.rs:58:17:62:17 | ExprStmt | | +| test.rs:56:13:56:14 | ExprStmt | test.rs:56:13:56:13 | 1 | | +| test.rs:58:17:62:17 | ExprStmt | test.rs:58:20:58:20 | b | | +| test.rs:58:17:62:17 | IfExpr | test.rs:63:17:63:31 | ExprStmt | | +| test.rs:58:20:58:20 | b | test.rs:59:21:59:29 | ExprStmt | true | +| test.rs:58:20:58:20 | b | test.rs:60:27:60:27 | b | false | +| test.rs:59:21:59:28 | ContinueExpr | test.rs:58:17:62:17 | ExprStmt | continue | +| test.rs:59:21:59:29 | ExprStmt | test.rs:59:21:59:28 | ContinueExpr | | +| test.rs:60:24:62:17 | IfExpr | test.rs:58:17:62:17 | IfExpr | | +| test.rs:60:27:60:27 | b | test.rs:60:24:62:17 | IfExpr | false | +| test.rs:60:27:60:27 | b | test.rs:61:21:61:35 | ExprStmt | true | +| test.rs:61:21:61:34 | ContinueExpr | test.rs:58:17:62:17 | ExprStmt | continue('loop) | +| test.rs:61:21:61:35 | ExprStmt | test.rs:61:21:61:34 | ContinueExpr | | +| test.rs:63:17:63:30 | ContinueExpr | test.rs:58:17:62:17 | ExprStmt | continue('loop) | +| test.rs:63:17:63:31 | ExprStmt | test.rs:63:17:63:30 | ContinueExpr | | +| test.rs:68:5:77:5 | enter test_while | test.rs:69:9:69:25 | LetStmt | | +| test.rs:68:5:77:5 | exit test_while (normal) | test.rs:68:5:77:5 | exit test_while | | +| test.rs:68:27:77:5 | BlockExpr | test.rs:68:5:77:5 | exit test_while (normal) | | +| test.rs:69:9:69:25 | LetStmt | test.rs:69:21:69:24 | true | | +| test.rs:69:13:69:17 | b | test.rs:70:15:70:15 | b | match, no-match | +| test.rs:69:21:69:24 | true | test.rs:69:13:69:17 | b | | +| test.rs:70:9:76:9 | WhileExpr | test.rs:68:27:77:5 | BlockExpr | | +| test.rs:70:15:70:15 | b | test.rs:70:9:76:9 | WhileExpr | false | +| test.rs:70:15:70:15 | b | test.rs:71:13:71:14 | ExprStmt | true | +| test.rs:70:17:76:9 | BlockExpr | test.rs:70:15:70:15 | b | | +| test.rs:71:13:71:13 | 1 | test.rs:72:13:74:13 | ExprStmt | | +| test.rs:71:13:71:14 | ExprStmt | test.rs:71:13:71:13 | 1 | | +| test.rs:72:13:74:13 | ExprStmt | test.rs:72:17:72:17 | i | | +| test.rs:72:13:74:13 | IfExpr | test.rs:75:13:75:22 | ExprStmt | | +| test.rs:72:17:72:17 | i | test.rs:72:21:72:21 | 0 | | +| test.rs:72:17:72:21 | ... > ... | test.rs:72:13:74:13 | IfExpr | false | +| test.rs:72:17:72:21 | ... > ... | test.rs:73:17:73:22 | ExprStmt | true | +| test.rs:72:21:72:21 | 0 | test.rs:72:17:72:21 | ... > ... | | +| test.rs:73:17:73:21 | BreakExpr | test.rs:70:9:76:9 | WhileExpr | break | +| test.rs:73:17:73:22 | ExprStmt | test.rs:73:17:73:21 | BreakExpr | | +| test.rs:75:13:75:13 | PathExpr | test.rs:75:17:75:21 | false | | +| test.rs:75:13:75:21 | ... = ... | test.rs:70:17:76:9 | BlockExpr | | +| test.rs:75:13:75:22 | ExprStmt | test.rs:75:13:75:13 | PathExpr | | +| test.rs:75:17:75:21 | false | test.rs:75:13:75:21 | ... = ... | | +| test.rs:79:5:86:5 | enter test_while_let | test.rs:80:9:80:29 | LetStmt | | +| test.rs:79:5:86:5 | exit test_while_let (normal) | test.rs:79:5:86:5 | exit test_while_let | | +| test.rs:79:25:86:5 | BlockExpr | test.rs:79:5:86:5 | exit test_while_let (normal) | | +| test.rs:80:9:80:29 | LetStmt | test.rs:80:24:80:24 | 1 | | +| test.rs:80:13:80:20 | iter | test.rs:81:15:81:39 | LetExpr | match, no-match | +| test.rs:80:24:80:24 | 1 | test.rs:80:27:80:28 | 10 | | +| test.rs:80:24:80:28 | RangeExpr | test.rs:80:13:80:20 | iter | | +| test.rs:80:27:80:28 | 10 | test.rs:80:24:80:28 | RangeExpr | | +| test.rs:81:9:85:9 | WhileExpr | test.rs:79:25:86:5 | BlockExpr | | +| test.rs:81:15:81:39 | LetExpr | test.rs:81:19:81:25 | TupleStructPat | | +| test.rs:81:19:81:25 | TupleStructPat | test.rs:81:9:85:9 | WhileExpr | no-match | +| test.rs:81:19:81:25 | TupleStructPat | test.rs:82:17:82:17 | PathExpr | match | +| test.rs:81:41:85:9 | BlockExpr | test.rs:81:15:81:39 | LetExpr | | +| test.rs:82:13:84:13 | IfExpr | test.rs:81:41:85:9 | BlockExpr | | +| test.rs:82:17:82:17 | PathExpr | test.rs:82:21:82:21 | 5 | | +| test.rs:82:17:82:21 | ... = ... | test.rs:82:13:84:13 | IfExpr | false | +| test.rs:82:17:82:21 | ... = ... | test.rs:83:17:83:22 | ExprStmt | true | +| test.rs:82:21:82:21 | 5 | test.rs:82:17:82:21 | ... = ... | | +| test.rs:83:17:83:21 | BreakExpr | test.rs:81:9:85:9 | WhileExpr | break | +| test.rs:83:17:83:22 | ExprStmt | test.rs:83:17:83:21 | BreakExpr | | +| test.rs:88:5:95:5 | enter test_for | test.rs:89:18:89:18 | 0 | | +| test.rs:88:5:95:5 | exit test_for (normal) | test.rs:88:5:95:5 | exit test_for | | +| test.rs:88:25:95:5 | BlockExpr | test.rs:88:5:95:5 | exit test_for (normal) | | +| test.rs:89:9:94:9 | ForExpr | test.rs:88:25:95:5 | BlockExpr | | +| test.rs:89:13:89:13 | i | test.rs:89:9:94:9 | ForExpr | no-match | +| test.rs:89:13:89:13 | i | test.rs:90:13:92:13 | ExprStmt | match | +| test.rs:89:18:89:18 | 0 | test.rs:89:21:89:22 | 10 | | +| test.rs:89:18:89:22 | RangeExpr | test.rs:89:13:89:13 | i | | +| test.rs:89:21:89:22 | 10 | test.rs:89:18:89:22 | RangeExpr | | +| test.rs:89:24:94:9 | BlockExpr | test.rs:89:13:89:13 | i | | +| test.rs:90:13:92:13 | ExprStmt | test.rs:90:17:90:17 | i | | +| test.rs:90:13:92:13 | IfExpr | test.rs:93:13:93:14 | ExprStmt | | +| test.rs:90:17:90:17 | i | test.rs:90:22:90:22 | j | | +| test.rs:90:17:90:22 | ... == ... | test.rs:90:13:92:13 | IfExpr | false | +| test.rs:90:17:90:22 | ... == ... | test.rs:91:17:91:22 | ExprStmt | true | +| test.rs:90:22:90:22 | j | test.rs:90:17:90:22 | ... == ... | | +| test.rs:91:17:91:21 | BreakExpr | test.rs:89:9:94:9 | ForExpr | break | +| test.rs:91:17:91:22 | ExprStmt | test.rs:91:17:91:21 | BreakExpr | | +| test.rs:93:13:93:13 | 1 | test.rs:89:24:94:9 | BlockExpr | | +| test.rs:93:13:93:14 | ExprStmt | test.rs:93:13:93:13 | 1 | | +| test.rs:98:1:101:1 | enter test_nested_function | test.rs:99:5:99:28 | LetStmt | | +| test.rs:98:1:101:1 | exit test_nested_function (normal) | test.rs:98:1:101:1 | exit test_nested_function | | +| test.rs:98:40:101:1 | BlockExpr | test.rs:98:1:101:1 | exit test_nested_function (normal) | | +| test.rs:99:5:99:28 | LetStmt | test.rs:99:19:99:27 | ClosureExpr | | +| test.rs:99:9:99:15 | add_one | test.rs:100:5:100:11 | add_one | match, no-match | +| test.rs:99:19:99:27 | ClosureExpr | test.rs:99:9:99:15 | add_one | | +| test.rs:99:19:99:27 | enter ClosureExpr | test.rs:99:23:99:23 | i | | +| test.rs:99:19:99:27 | exit ClosureExpr (normal) | test.rs:99:19:99:27 | exit ClosureExpr | | +| test.rs:99:23:99:23 | i | test.rs:99:27:99:27 | 1 | | +| test.rs:99:23:99:27 | ... + ... | test.rs:99:19:99:27 | exit ClosureExpr (normal) | | +| test.rs:99:27:99:27 | 1 | test.rs:99:23:99:27 | ... + ... | | +| test.rs:100:5:100:11 | add_one | test.rs:100:13:100:19 | add_one | | +| test.rs:100:5:100:23 | CallExpr | test.rs:98:40:101:1 | BlockExpr | | +| test.rs:100:13:100:19 | add_one | test.rs:100:21:100:21 | n | | +| test.rs:100:13:100:22 | CallExpr | test.rs:100:5:100:23 | CallExpr | | +| test.rs:100:21:100:21 | n | test.rs:100:13:100:22 | CallExpr | | +| test.rs:105:5:111:5 | enter test_if_else | test.rs:106:12:106:12 | n | | +| test.rs:105:5:111:5 | exit test_if_else (normal) | test.rs:105:5:111:5 | exit test_if_else | | +| test.rs:105:36:111:5 | BlockExpr | test.rs:105:5:111:5 | exit test_if_else (normal) | | +| test.rs:106:9:110:9 | IfExpr | test.rs:105:36:111:5 | BlockExpr | | +| test.rs:106:12:106:12 | n | test.rs:106:17:106:17 | 0 | | +| test.rs:106:12:106:17 | ... <= ... | test.rs:107:13:107:13 | 0 | true | +| test.rs:106:12:106:17 | ... <= ... | test.rs:109:13:109:13 | n | false | +| test.rs:106:17:106:17 | 0 | test.rs:106:12:106:17 | ... <= ... | | +| test.rs:106:19:108:9 | BlockExpr | test.rs:106:9:110:9 | IfExpr | | +| test.rs:107:13:107:13 | 0 | test.rs:106:19:108:9 | BlockExpr | | +| test.rs:108:16:110:9 | BlockExpr | test.rs:106:9:110:9 | IfExpr | | +| test.rs:109:13:109:13 | n | test.rs:109:17:109:17 | 1 | | +| test.rs:109:13:109:17 | ... - ... | test.rs:108:16:110:9 | BlockExpr | | +| test.rs:109:17:109:17 | 1 | test.rs:109:13:109:17 | ... - ... | | +| test.rs:113:5:119:5 | enter test_if_let_else | test.rs:114:12:114:26 | LetExpr | | +| test.rs:113:5:119:5 | exit test_if_let_else (normal) | test.rs:113:5:119:5 | exit test_if_let_else | | +| test.rs:113:48:119:5 | BlockExpr | test.rs:113:5:119:5 | exit test_if_let_else (normal) | | +| test.rs:114:9:118:9 | IfExpr | test.rs:113:48:119:5 | BlockExpr | | +| test.rs:114:12:114:26 | LetExpr | test.rs:114:16:114:22 | TupleStructPat | | +| test.rs:114:16:114:22 | TupleStructPat | test.rs:115:13:115:13 | n | match | +| test.rs:114:16:114:22 | TupleStructPat | test.rs:117:13:117:13 | 0 | no-match | +| test.rs:114:28:116:9 | BlockExpr | test.rs:114:9:118:9 | IfExpr | | +| test.rs:115:13:115:13 | n | test.rs:114:28:116:9 | BlockExpr | | +| test.rs:116:16:118:9 | BlockExpr | test.rs:114:9:118:9 | IfExpr | | +| test.rs:117:13:117:13 | 0 | test.rs:116:16:118:9 | BlockExpr | | +| test.rs:121:5:126:5 | enter test_if_let | test.rs:122:9:124:9 | ExprStmt | | +| test.rs:121:5:126:5 | exit test_if_let (normal) | test.rs:121:5:126:5 | exit test_if_let | | +| test.rs:121:43:126:5 | BlockExpr | test.rs:121:5:126:5 | exit test_if_let (normal) | | +| test.rs:122:9:124:9 | ExprStmt | test.rs:122:12:122:26 | LetExpr | | +| test.rs:122:9:124:9 | IfExpr | test.rs:125:9:125:9 | 0 | | +| test.rs:122:12:122:26 | LetExpr | test.rs:122:16:122:22 | TupleStructPat | | +| test.rs:122:16:122:22 | TupleStructPat | test.rs:122:9:124:9 | IfExpr | no-match | +| test.rs:122:16:122:22 | TupleStructPat | test.rs:123:13:123:13 | n | match | +| test.rs:122:28:124:9 | BlockExpr | test.rs:122:9:124:9 | IfExpr | | +| test.rs:123:13:123:13 | n | test.rs:122:28:124:9 | BlockExpr | | +| test.rs:125:9:125:9 | 0 | test.rs:121:43:126:5 | BlockExpr | | +| test.rs:128:5:134:5 | enter test_nested_if | test.rs:129:16:129:16 | PathExpr | | +| test.rs:128:5:134:5 | exit test_nested_if (normal) | test.rs:128:5:134:5 | exit test_nested_if | | +| test.rs:128:38:134:5 | BlockExpr | test.rs:128:5:134:5 | exit test_nested_if (normal) | | +| test.rs:129:9:133:9 | IfExpr | test.rs:128:38:134:5 | BlockExpr | | +| test.rs:129:13:129:48 | IfExpr | test.rs:130:13:130:13 | 1 | true | +| test.rs:129:13:129:48 | IfExpr | test.rs:132:13:132:13 | 0 | false | +| test.rs:129:16:129:16 | PathExpr | test.rs:129:20:129:20 | 0 | | +| test.rs:129:16:129:20 | ... < ... | test.rs:129:24:129:24 | a | true | +| test.rs:129:16:129:20 | ... < ... | test.rs:129:41:129:41 | a | false | +| test.rs:129:20:129:20 | 0 | test.rs:129:16:129:20 | ... < ... | | +| test.rs:129:22:129:32 | BlockExpr | test.rs:129:13:129:48 | IfExpr | false, true | +| test.rs:129:24:129:24 | a | test.rs:129:29:129:30 | 10 | | +| test.rs:129:24:129:30 | ... < ... | test.rs:129:22:129:32 | BlockExpr | false, true | +| test.rs:129:28:129:30 | - ... | test.rs:129:24:129:30 | ... < ... | | +| test.rs:129:29:129:30 | 10 | test.rs:129:28:129:30 | - ... | | +| test.rs:129:39:129:48 | BlockExpr | test.rs:129:13:129:48 | IfExpr | false, true | +| test.rs:129:41:129:41 | a | test.rs:129:45:129:46 | 10 | | +| test.rs:129:41:129:46 | ... > ... | test.rs:129:39:129:48 | BlockExpr | false, true | +| test.rs:129:45:129:46 | 10 | test.rs:129:41:129:46 | ... > ... | | +| test.rs:129:51:131:9 | BlockExpr | test.rs:129:9:133:9 | IfExpr | | +| test.rs:130:13:130:13 | 1 | test.rs:129:51:131:9 | BlockExpr | | +| test.rs:131:16:133:9 | BlockExpr | test.rs:129:9:133:9 | IfExpr | | +| test.rs:132:13:132:13 | 0 | test.rs:131:16:133:9 | BlockExpr | | +| test.rs:136:5:145:5 | enter test_nested_if_match | test.rs:137:19:137:19 | a | | +| test.rs:136:5:145:5 | exit test_nested_if_match (normal) | test.rs:136:5:145:5 | exit test_nested_if_match | | +| test.rs:136:44:145:5 | BlockExpr | test.rs:136:5:145:5 | exit test_nested_if_match (normal) | | +| test.rs:137:9:144:9 | IfExpr | test.rs:136:44:145:5 | BlockExpr | | +| test.rs:137:13:140:9 | MatchExpr | test.rs:141:13:141:13 | 1 | true | +| test.rs:137:13:140:9 | MatchExpr | test.rs:143:13:143:13 | 0 | false | +| test.rs:137:19:137:19 | a | test.rs:138:13:138:13 | LiteralPat | | +| test.rs:138:13:138:13 | LiteralPat | test.rs:138:18:138:21 | true | match | +| test.rs:138:13:138:13 | LiteralPat | test.rs:139:13:139:13 | WildcardPat | no-match | +| test.rs:138:18:138:21 | true | test.rs:137:13:140:9 | MatchExpr | | +| test.rs:139:13:139:13 | WildcardPat | test.rs:139:18:139:22 | false | match | +| test.rs:139:18:139:22 | false | test.rs:137:13:140:9 | MatchExpr | | +| test.rs:140:12:142:9 | BlockExpr | test.rs:137:9:144:9 | IfExpr | | +| test.rs:141:13:141:13 | 1 | test.rs:140:12:142:9 | BlockExpr | | +| test.rs:142:16:144:9 | BlockExpr | test.rs:137:9:144:9 | IfExpr | | +| test.rs:143:13:143:13 | 0 | test.rs:142:16:144:9 | BlockExpr | | +| test.rs:147:5:156:5 | enter test_nested_if_block | test.rs:149:13:149:15 | ExprStmt | | +| test.rs:147:5:156:5 | exit test_nested_if_block (normal) | test.rs:147:5:156:5 | exit test_nested_if_block | | +| test.rs:147:44:156:5 | BlockExpr | test.rs:147:5:156:5 | exit test_nested_if_block (normal) | | +| test.rs:148:9:155:9 | IfExpr | test.rs:147:44:156:5 | BlockExpr | | +| test.rs:148:12:151:9 | BlockExpr | test.rs:152:13:152:13 | 1 | true | +| test.rs:148:12:151:9 | BlockExpr | test.rs:154:13:154:13 | 0 | false | +| test.rs:149:13:149:14 | TupleExpr | test.rs:150:13:150:13 | a | | +| test.rs:149:13:149:15 | ExprStmt | test.rs:149:13:149:14 | TupleExpr | | +| test.rs:150:13:150:13 | a | test.rs:150:17:150:17 | 0 | | +| test.rs:150:13:150:17 | ... > ... | test.rs:148:12:151:9 | BlockExpr | false, true | +| test.rs:150:17:150:17 | 0 | test.rs:150:13:150:17 | ... > ... | | +| test.rs:151:11:153:9 | BlockExpr | test.rs:148:9:155:9 | IfExpr | | +| test.rs:152:13:152:13 | 1 | test.rs:151:11:153:9 | BlockExpr | | +| test.rs:153:16:155:9 | BlockExpr | test.rs:148:9:155:9 | IfExpr | | +| test.rs:154:13:154:13 | 0 | test.rs:153:16:155:9 | BlockExpr | | +| test.rs:158:5:165:5 | enter test_if_assignment | test.rs:159:9:159:26 | LetStmt | | +| test.rs:158:5:165:5 | exit test_if_assignment (normal) | test.rs:158:5:165:5 | exit test_if_assignment | | +| test.rs:158:42:165:5 | BlockExpr | test.rs:158:5:165:5 | exit test_if_assignment (normal) | | +| test.rs:159:9:159:26 | LetStmt | test.rs:159:21:159:25 | false | | +| test.rs:159:13:159:17 | x | test.rs:160:12:160:12 | x | match, no-match | +| test.rs:159:21:159:25 | false | test.rs:159:13:159:17 | x | | +| test.rs:160:9:164:9 | IfExpr | test.rs:158:42:165:5 | BlockExpr | | +| test.rs:160:12:160:12 | x | test.rs:160:16:160:19 | true | | +| test.rs:160:12:160:19 | ... = ... | test.rs:161:13:161:13 | 1 | true | +| test.rs:160:12:160:19 | ... = ... | test.rs:163:13:163:13 | 0 | false | +| test.rs:160:16:160:19 | true | test.rs:160:12:160:19 | ... = ... | | +| test.rs:160:21:162:9 | BlockExpr | test.rs:160:9:164:9 | IfExpr | | +| test.rs:161:13:161:13 | 1 | test.rs:160:21:162:9 | BlockExpr | | +| test.rs:162:16:164:9 | BlockExpr | test.rs:160:9:164:9 | IfExpr | | +| test.rs:163:13:163:13 | 0 | test.rs:162:16:164:9 | BlockExpr | | +| test.rs:167:5:178:5 | enter test_if_loop1 | test.rs:169:13:171:14 | ExprStmt | | +| test.rs:167:5:178:5 | exit test_if_loop1 (normal) | test.rs:167:5:178:5 | exit test_if_loop1 | | +| test.rs:167:37:178:5 | BlockExpr | test.rs:167:5:178:5 | exit test_if_loop1 (normal) | | +| test.rs:168:9:177:9 | IfExpr | test.rs:167:37:178:5 | BlockExpr | | +| test.rs:168:13:173:9 | LoopExpr | test.rs:174:13:174:13 | 1 | true | +| test.rs:168:13:173:9 | LoopExpr | test.rs:176:13:176:13 | 0 | false | +| test.rs:168:18:173:9 | BlockExpr | test.rs:169:13:171:14 | ExprStmt | | +| test.rs:169:13:171:13 | IfExpr | test.rs:172:13:172:19 | ExprStmt | | +| test.rs:169:13:171:14 | ExprStmt | test.rs:169:16:169:16 | a | | +| test.rs:169:16:169:16 | a | test.rs:169:20:169:20 | 0 | | +| test.rs:169:16:169:20 | ... > ... | test.rs:169:13:171:13 | IfExpr | false | +| test.rs:169:16:169:20 | ... > ... | test.rs:170:17:170:29 | ExprStmt | true | +| test.rs:169:20:169:20 | 0 | test.rs:169:16:169:20 | ... > ... | | +| test.rs:170:17:170:28 | BreakExpr | test.rs:168:13:173:9 | LoopExpr | break | +| test.rs:170:17:170:29 | ExprStmt | test.rs:170:23:170:23 | a | | +| test.rs:170:23:170:23 | a | test.rs:170:27:170:28 | 10 | | +| test.rs:170:23:170:28 | ... > ... | test.rs:170:17:170:28 | BreakExpr | | +| test.rs:170:27:170:28 | 10 | test.rs:170:23:170:28 | ... > ... | | +| test.rs:172:13:172:13 | a | test.rs:172:17:172:18 | 10 | | +| test.rs:172:13:172:18 | ... < ... | test.rs:168:18:173:9 | BlockExpr | | +| test.rs:172:13:172:19 | ExprStmt | test.rs:172:13:172:13 | a | | +| test.rs:172:17:172:18 | 10 | test.rs:172:13:172:18 | ... < ... | | +| test.rs:173:12:175:9 | BlockExpr | test.rs:168:9:177:9 | IfExpr | | +| test.rs:174:13:174:13 | 1 | test.rs:173:12:175:9 | BlockExpr | | +| test.rs:175:16:177:9 | BlockExpr | test.rs:168:9:177:9 | IfExpr | | +| test.rs:176:13:176:13 | 0 | test.rs:175:16:177:9 | BlockExpr | | +| test.rs:180:5:191:5 | enter test_if_loop2 | test.rs:182:13:184:14 | ExprStmt | | +| test.rs:180:5:191:5 | exit test_if_loop2 (normal) | test.rs:180:5:191:5 | exit test_if_loop2 | | +| test.rs:180:37:191:5 | BlockExpr | test.rs:180:5:191:5 | exit test_if_loop2 (normal) | | +| test.rs:181:9:190:9 | IfExpr | test.rs:180:37:191:5 | BlockExpr | | +| test.rs:181:13:186:9 | LoopExpr | test.rs:187:13:187:13 | 1 | true | +| test.rs:181:13:186:9 | LoopExpr | test.rs:189:13:189:13 | 0 | false | +| test.rs:181:26:186:9 | BlockExpr | test.rs:182:13:184:14 | ExprStmt | | +| test.rs:182:13:184:13 | IfExpr | test.rs:185:13:185:19 | ExprStmt | | +| test.rs:182:13:184:14 | ExprStmt | test.rs:182:16:182:16 | a | | +| test.rs:182:16:182:16 | a | test.rs:182:20:182:20 | 0 | | +| test.rs:182:16:182:20 | ... > ... | test.rs:182:13:184:13 | IfExpr | false | +| test.rs:182:16:182:20 | ... > ... | test.rs:183:17:183:36 | ExprStmt | true | +| test.rs:182:20:182:20 | 0 | test.rs:182:16:182:20 | ... > ... | | +| test.rs:183:17:183:35 | BreakExpr | test.rs:181:13:186:9 | LoopExpr | break('label) | +| test.rs:183:17:183:36 | ExprStmt | test.rs:183:30:183:30 | a | | +| test.rs:183:30:183:30 | a | test.rs:183:34:183:35 | 10 | | +| test.rs:183:30:183:35 | ... > ... | test.rs:183:17:183:35 | BreakExpr | | +| test.rs:183:34:183:35 | 10 | test.rs:183:30:183:35 | ... > ... | | +| test.rs:185:13:185:13 | a | test.rs:185:17:185:18 | 10 | | +| test.rs:185:13:185:18 | ... < ... | test.rs:181:26:186:9 | BlockExpr | | +| test.rs:185:13:185:19 | ExprStmt | test.rs:185:13:185:13 | a | | +| test.rs:185:17:185:18 | 10 | test.rs:185:13:185:18 | ... < ... | | +| test.rs:186:12:188:9 | BlockExpr | test.rs:181:9:190:9 | IfExpr | | +| test.rs:187:13:187:13 | 1 | test.rs:186:12:188:9 | BlockExpr | | +| test.rs:188:16:190:9 | BlockExpr | test.rs:181:9:190:9 | IfExpr | | +| test.rs:189:13:189:13 | 0 | test.rs:188:16:190:9 | BlockExpr | | +| test.rs:193:5:201:5 | enter test_labelled_block | test.rs:195:13:195:31 | ExprStmt | | +| test.rs:193:5:201:5 | exit test_labelled_block (normal) | test.rs:193:5:201:5 | exit test_labelled_block | | +| test.rs:193:43:201:5 | BlockExpr | test.rs:193:5:201:5 | exit test_labelled_block (normal) | | +| test.rs:194:9:200:9 | IfExpr | test.rs:193:43:201:5 | BlockExpr | | +| test.rs:194:13:196:9 | BlockExpr | test.rs:197:13:197:13 | 1 | true | +| test.rs:194:13:196:9 | BlockExpr | test.rs:199:13:199:13 | 0 | false | +| test.rs:195:13:195:30 | BreakExpr | test.rs:194:13:196:9 | BlockExpr | break('block) | +| test.rs:195:13:195:31 | ExprStmt | test.rs:195:26:195:26 | a | | +| test.rs:195:26:195:26 | a | test.rs:195:30:195:30 | 0 | | +| test.rs:195:26:195:30 | ... > ... | test.rs:195:13:195:30 | BreakExpr | | +| test.rs:195:30:195:30 | 0 | test.rs:195:26:195:30 | ... > ... | | +| test.rs:196:12:198:9 | BlockExpr | test.rs:194:9:200:9 | IfExpr | | +| test.rs:197:13:197:13 | 1 | test.rs:196:12:198:9 | BlockExpr | | +| test.rs:198:16:200:9 | BlockExpr | test.rs:194:9:200:9 | IfExpr | | +| test.rs:199:13:199:13 | 0 | test.rs:198:16:200:9 | BlockExpr | | +| test.rs:206:5:209:5 | enter test_and_operator | test.rs:207:9:207:28 | LetStmt | | +| test.rs:206:5:209:5 | exit test_and_operator (normal) | test.rs:206:5:209:5 | exit test_and_operator | | +| test.rs:206:61:209:5 | BlockExpr | test.rs:206:5:209:5 | exit test_and_operator (normal) | | +| test.rs:207:9:207:28 | LetStmt | test.rs:207:17:207:27 | ... && ... | | +| test.rs:207:13:207:13 | d | test.rs:208:9:208:9 | d | match, no-match | +| test.rs:207:17:207:17 | a | test.rs:207:13:207:13 | d | false | +| test.rs:207:17:207:17 | a | test.rs:207:22:207:22 | b | true | +| test.rs:207:17:207:22 | ... && ... | test.rs:207:17:207:17 | a | | +| test.rs:207:17:207:27 | ... && ... | test.rs:207:17:207:22 | ... && ... | | +| test.rs:207:22:207:22 | b | test.rs:207:13:207:13 | d | false | +| test.rs:207:22:207:22 | b | test.rs:207:27:207:27 | c | true | +| test.rs:207:27:207:27 | c | test.rs:207:13:207:13 | d | | +| test.rs:208:9:208:9 | d | test.rs:206:61:209:5 | BlockExpr | | +| test.rs:211:5:214:5 | enter test_or_operator | test.rs:212:9:212:28 | LetStmt | | +| test.rs:211:5:214:5 | exit test_or_operator (normal) | test.rs:211:5:214:5 | exit test_or_operator | | +| test.rs:211:60:214:5 | BlockExpr | test.rs:211:5:214:5 | exit test_or_operator (normal) | | +| test.rs:212:9:212:28 | LetStmt | test.rs:212:17:212:27 | ... \|\| ... | | +| test.rs:212:13:212:13 | d | test.rs:213:9:213:9 | d | match, no-match | +| test.rs:212:17:212:17 | a | test.rs:212:13:212:13 | d | true | +| test.rs:212:17:212:17 | a | test.rs:212:22:212:22 | b | false | +| test.rs:212:17:212:22 | ... \|\| ... | test.rs:212:17:212:17 | a | | +| test.rs:212:17:212:27 | ... \|\| ... | test.rs:212:17:212:22 | ... \|\| ... | | +| test.rs:212:22:212:22 | b | test.rs:212:13:212:13 | d | true | +| test.rs:212:22:212:22 | b | test.rs:212:27:212:27 | c | false | +| test.rs:212:27:212:27 | c | test.rs:212:13:212:13 | d | | +| test.rs:213:9:213:9 | d | test.rs:211:60:214:5 | BlockExpr | | +| test.rs:216:5:219:5 | enter test_or_operator_2 | test.rs:217:9:217:36 | LetStmt | | +| test.rs:216:5:219:5 | exit test_or_operator_2 (normal) | test.rs:216:5:219:5 | exit test_or_operator_2 | | +| test.rs:216:61:219:5 | BlockExpr | test.rs:216:5:219:5 | exit test_or_operator_2 (normal) | | +| test.rs:217:9:217:36 | LetStmt | test.rs:217:17:217:35 | ... \|\| ... | | +| test.rs:217:13:217:13 | d | test.rs:218:9:218:9 | d | match, no-match | +| test.rs:217:17:217:17 | a | test.rs:217:13:217:13 | d | true | +| test.rs:217:17:217:17 | a | test.rs:217:23:217:23 | b | false | +| test.rs:217:17:217:30 | ... \|\| ... | test.rs:217:17:217:17 | a | | +| test.rs:217:17:217:35 | ... \|\| ... | test.rs:217:17:217:30 | ... \|\| ... | | +| test.rs:217:23:217:23 | b | test.rs:217:28:217:29 | 28 | | +| test.rs:217:23:217:29 | ... == ... | test.rs:217:13:217:13 | d | true | +| test.rs:217:23:217:29 | ... == ... | test.rs:217:35:217:35 | c | false | +| test.rs:217:28:217:29 | 28 | test.rs:217:23:217:29 | ... == ... | | +| test.rs:217:35:217:35 | c | test.rs:217:13:217:13 | d | | +| test.rs:218:9:218:9 | d | test.rs:216:61:219:5 | BlockExpr | | +| test.rs:221:5:224:5 | enter test_not_operator | test.rs:222:9:222:19 | LetStmt | | +| test.rs:221:5:224:5 | exit test_not_operator (normal) | test.rs:221:5:224:5 | exit test_not_operator | | +| test.rs:221:43:224:5 | BlockExpr | test.rs:221:5:224:5 | exit test_not_operator (normal) | | +| test.rs:222:9:222:19 | LetStmt | test.rs:222:18:222:18 | a | | +| test.rs:222:13:222:13 | d | test.rs:223:9:223:9 | d | match, no-match | +| test.rs:222:17:222:18 | ! ... | test.rs:222:13:222:13 | d | | +| test.rs:222:18:222:18 | a | test.rs:222:17:222:18 | ! ... | | +| test.rs:223:9:223:9 | d | test.rs:221:43:224:5 | BlockExpr | | +| test.rs:226:5:232:5 | enter test_if_and_operator | test.rs:227:12:227:22 | ... && ... | | +| test.rs:226:5:232:5 | exit test_if_and_operator (normal) | test.rs:226:5:232:5 | exit test_if_and_operator | | +| test.rs:226:63:232:5 | BlockExpr | test.rs:226:5:232:5 | exit test_if_and_operator (normal) | | +| test.rs:227:9:231:9 | IfExpr | test.rs:226:63:232:5 | BlockExpr | | +| test.rs:227:12:227:12 | a | test.rs:227:17:227:17 | b | true | +| test.rs:227:12:227:12 | a | test.rs:230:13:230:17 | false | false | +| test.rs:227:12:227:17 | ... && ... | test.rs:227:12:227:12 | a | | +| test.rs:227:12:227:22 | ... && ... | test.rs:227:12:227:17 | ... && ... | | +| test.rs:227:17:227:17 | b | test.rs:227:22:227:22 | c | true | +| test.rs:227:17:227:17 | b | test.rs:230:13:230:17 | false | false | +| test.rs:227:22:227:22 | c | test.rs:228:13:228:16 | true | true | +| test.rs:227:22:227:22 | c | test.rs:230:13:230:17 | false | false | +| test.rs:227:24:229:9 | BlockExpr | test.rs:227:9:231:9 | IfExpr | | +| test.rs:228:13:228:16 | true | test.rs:227:24:229:9 | BlockExpr | | +| test.rs:229:16:231:9 | BlockExpr | test.rs:227:9:231:9 | IfExpr | | +| test.rs:230:13:230:17 | false | test.rs:229:16:231:9 | BlockExpr | | +| test.rs:234:5:240:5 | enter test_if_or_operator | test.rs:235:12:235:22 | ... \|\| ... | | +| test.rs:234:5:240:5 | exit test_if_or_operator (normal) | test.rs:234:5:240:5 | exit test_if_or_operator | | +| test.rs:234:62:240:5 | BlockExpr | test.rs:234:5:240:5 | exit test_if_or_operator (normal) | | +| test.rs:235:9:239:9 | IfExpr | test.rs:234:62:240:5 | BlockExpr | | +| test.rs:235:12:235:12 | a | test.rs:235:17:235:17 | b | false | +| test.rs:235:12:235:12 | a | test.rs:236:13:236:16 | true | true | +| test.rs:235:12:235:17 | ... \|\| ... | test.rs:235:12:235:12 | a | | +| test.rs:235:12:235:22 | ... \|\| ... | test.rs:235:12:235:17 | ... \|\| ... | | +| test.rs:235:17:235:17 | b | test.rs:235:22:235:22 | c | false | +| test.rs:235:17:235:17 | b | test.rs:236:13:236:16 | true | true | +| test.rs:235:22:235:22 | c | test.rs:236:13:236:16 | true | true | +| test.rs:235:22:235:22 | c | test.rs:238:13:238:17 | false | false | +| test.rs:235:24:237:9 | BlockExpr | test.rs:235:9:239:9 | IfExpr | | +| test.rs:236:13:236:16 | true | test.rs:235:24:237:9 | BlockExpr | | +| test.rs:237:16:239:9 | BlockExpr | test.rs:235:9:239:9 | IfExpr | | +| test.rs:238:13:238:17 | false | test.rs:237:16:239:9 | BlockExpr | | +| test.rs:242:5:248:5 | enter test_if_not_operator | test.rs:243:13:243:13 | a | | +| test.rs:242:5:248:5 | exit test_if_not_operator (normal) | test.rs:242:5:248:5 | exit test_if_not_operator | | +| test.rs:242:46:248:5 | BlockExpr | test.rs:242:5:248:5 | exit test_if_not_operator (normal) | | +| test.rs:243:9:247:9 | IfExpr | test.rs:242:46:248:5 | BlockExpr | | +| test.rs:243:12:243:13 | ! ... | test.rs:244:13:244:16 | true | true | +| test.rs:243:12:243:13 | ! ... | test.rs:246:13:246:17 | false | false | +| test.rs:243:13:243:13 | a | test.rs:243:12:243:13 | ! ... | false, true | +| test.rs:243:15:245:9 | BlockExpr | test.rs:243:9:247:9 | IfExpr | | +| test.rs:244:13:244:16 | true | test.rs:243:15:245:9 | BlockExpr | | +| test.rs:245:16:247:9 | BlockExpr | test.rs:243:9:247:9 | IfExpr | | +| test.rs:246:13:246:17 | false | test.rs:245:16:247:9 | BlockExpr | | +| test.rs:251:1:257:1 | enter test_match | test.rs:252:11:252:21 | maybe_digit | | +| test.rs:251:1:257:1 | exit test_match (normal) | test.rs:251:1:257:1 | exit test_match | | +| test.rs:251:48:257:1 | BlockExpr | test.rs:251:1:257:1 | exit test_match (normal) | | +| test.rs:252:5:256:5 | MatchExpr | test.rs:251:48:257:1 | BlockExpr | | +| test.rs:252:11:252:21 | maybe_digit | test.rs:253:9:253:23 | TupleStructPat | | +| test.rs:253:9:253:23 | TupleStructPat | test.rs:253:28:253:28 | x | match | +| test.rs:253:9:253:23 | TupleStructPat | test.rs:254:9:254:23 | TupleStructPat | no-match | +| test.rs:253:28:253:28 | x | test.rs:253:32:253:33 | 10 | | +| test.rs:253:28:253:33 | ... < ... | test.rs:253:38:253:38 | x | true | +| test.rs:253:28:253:33 | ... < ... | test.rs:254:9:254:23 | TupleStructPat | false | +| test.rs:253:32:253:33 | 10 | test.rs:253:28:253:33 | ... < ... | | +| test.rs:253:38:253:38 | x | test.rs:253:42:253:42 | 5 | | +| test.rs:253:38:253:42 | ... + ... | test.rs:252:5:256:5 | MatchExpr | | +| test.rs:253:42:253:42 | 5 | test.rs:253:38:253:42 | ... + ... | | +| test.rs:254:9:254:23 | TupleStructPat | test.rs:254:28:254:28 | x | match | +| test.rs:254:9:254:23 | TupleStructPat | test.rs:255:9:255:20 | PathPat | no-match | +| test.rs:254:28:254:28 | x | test.rs:252:5:256:5 | MatchExpr | | +| test.rs:255:9:255:20 | PathPat | test.rs:255:25:255:25 | 5 | match | +| test.rs:255:25:255:25 | 5 | test.rs:252:5:256:5 | MatchExpr | | +| test.rs:260:5:265:5 | enter test_infinite_loop | test.rs:261:9:263:9 | ExprStmt | | +| test.rs:261:9:263:9 | ExprStmt | test.rs:262:13:262:13 | 1 | | +| test.rs:261:14:263:9 | BlockExpr | test.rs:262:13:262:13 | 1 | | +| test.rs:262:13:262:13 | 1 | test.rs:261:14:263:9 | BlockExpr | | +| test.rs:267:5:270:5 | enter test_let_match | test.rs:268:9:268:49 | LetStmt | | +| test.rs:267:5:270:5 | exit test_let_match (normal) | test.rs:267:5:270:5 | exit test_let_match | | +| test.rs:267:39:270:5 | BlockExpr | test.rs:267:5:270:5 | exit test_let_match (normal) | | +| test.rs:268:9:268:49 | LetStmt | test.rs:268:23:268:23 | a | | +| test.rs:268:13:268:19 | TupleStructPat | test.rs:268:32:268:46 | "Expected some" | no-match | +| test.rs:268:13:268:19 | TupleStructPat | test.rs:269:9:269:9 | n | match | +| test.rs:268:23:268:23 | a | test.rs:268:13:268:19 | TupleStructPat | | +| test.rs:268:32:268:46 | "Expected some" | test.rs:268:30:268:48 | BlockExpr | | +| test.rs:269:9:269:9 | n | test.rs:267:39:270:5 | BlockExpr | | +| test.rs:273:1:278:1 | enter dead_code | test.rs:274:5:276:5 | ExprStmt | | +| test.rs:273:1:278:1 | exit dead_code (normal) | test.rs:273:1:278:1 | exit dead_code | | +| test.rs:274:5:276:5 | ExprStmt | test.rs:274:9:274:12 | true | | +| test.rs:274:9:274:12 | true | test.rs:275:9:275:17 | ExprStmt | true | +| test.rs:275:9:275:16 | ReturnExpr | test.rs:273:1:278:1 | exit dead_code (normal) | return | +| test.rs:275:9:275:17 | ExprStmt | test.rs:275:16:275:16 | 0 | | +| test.rs:275:16:275:16 | 0 | test.rs:275:9:275:16 | ReturnExpr | | +| test.rs:280:1:293:1 | enter labelled_block1 | test.rs:281:5:292:6 | LetStmt | | +| test.rs:280:1:293:1 | exit labelled_block1 (normal) | test.rs:280:1:293:1 | exit labelled_block1 | | +| test.rs:280:29:293:1 | BlockExpr | test.rs:280:1:293:1 | exit labelled_block1 (normal) | | +| test.rs:281:5:292:6 | LetStmt | test.rs:282:9:282:19 | ExprStmt | | +| test.rs:281:9:281:14 | result | test.rs:280:29:293:1 | BlockExpr | match, no-match | +| test.rs:281:18:292:5 | BlockExpr | test.rs:281:9:281:14 | result | | +| test.rs:282:9:282:16 | PathExpr | test.rs:282:9:282:18 | CallExpr | | +| test.rs:282:9:282:18 | CallExpr | test.rs:283:9:285:9 | ExprStmt | | +| test.rs:282:9:282:19 | ExprStmt | test.rs:282:9:282:16 | PathExpr | | +| test.rs:283:9:285:9 | ExprStmt | test.rs:283:12:283:28 | PathExpr | | +| test.rs:283:9:285:9 | IfExpr | test.rs:286:9:286:24 | ExprStmt | | +| test.rs:283:12:283:28 | PathExpr | test.rs:283:12:283:30 | CallExpr | | +| test.rs:283:12:283:30 | CallExpr | test.rs:283:9:285:9 | IfExpr | false | +| test.rs:283:12:283:30 | CallExpr | test.rs:284:13:284:27 | ExprStmt | true | +| test.rs:284:13:284:26 | BreakExpr | test.rs:281:18:292:5 | BlockExpr | break('block) | +| test.rs:284:13:284:27 | ExprStmt | test.rs:284:26:284:26 | 1 | | +| test.rs:284:26:284:26 | 1 | test.rs:284:13:284:26 | BreakExpr | | +| test.rs:286:9:286:21 | PathExpr | test.rs:286:9:286:23 | CallExpr | | +| test.rs:286:9:286:23 | CallExpr | test.rs:287:9:289:9 | ExprStmt | | +| test.rs:286:9:286:24 | ExprStmt | test.rs:286:9:286:21 | PathExpr | | +| test.rs:287:9:289:9 | ExprStmt | test.rs:287:12:287:28 | PathExpr | | +| test.rs:287:9:289:9 | IfExpr | test.rs:290:9:290:24 | ExprStmt | | +| test.rs:287:12:287:28 | PathExpr | test.rs:287:12:287:30 | CallExpr | | +| test.rs:287:12:287:30 | CallExpr | test.rs:287:9:289:9 | IfExpr | false | +| test.rs:287:12:287:30 | CallExpr | test.rs:288:13:288:27 | ExprStmt | true | +| test.rs:288:13:288:26 | BreakExpr | test.rs:281:18:292:5 | BlockExpr | break('block) | +| test.rs:288:13:288:27 | ExprStmt | test.rs:288:26:288:26 | 2 | | +| test.rs:288:26:288:26 | 2 | test.rs:288:13:288:26 | BreakExpr | | +| test.rs:290:9:290:21 | PathExpr | test.rs:290:9:290:23 | CallExpr | | +| test.rs:290:9:290:23 | CallExpr | test.rs:291:9:291:9 | 3 | | +| test.rs:290:9:290:24 | ExprStmt | test.rs:290:9:290:21 | PathExpr | | +| test.rs:291:9:291:9 | 3 | test.rs:281:18:292:5 | BlockExpr | | +| test.rs:295:1:303:1 | enter labelled_block2 | test.rs:296:5:302:6 | LetStmt | | +| test.rs:295:1:303:1 | exit labelled_block2 (normal) | test.rs:295:1:303:1 | exit labelled_block2 | | +| test.rs:295:29:303:1 | BlockExpr | test.rs:295:1:303:1 | exit labelled_block2 (normal) | | +| test.rs:296:5:302:6 | LetStmt | test.rs:297:9:297:34 | LetStmt | | +| test.rs:296:9:296:14 | result | test.rs:295:29:303:1 | BlockExpr | match, no-match | +| test.rs:296:18:302:5 | BlockExpr | test.rs:296:9:296:14 | result | | +| test.rs:297:9:297:34 | LetStmt | test.rs:297:30:297:33 | PathExpr | | +| test.rs:297:13:297:13 | x | test.rs:298:9:300:10 | LetStmt | match, no-match | +| test.rs:297:30:297:33 | PathExpr | test.rs:297:13:297:13 | x | | +| test.rs:298:9:300:10 | LetStmt | test.rs:298:23:298:23 | x | | +| test.rs:298:13:298:19 | TupleStructPat | test.rs:299:13:299:27 | ExprStmt | no-match | +| test.rs:298:13:298:19 | TupleStructPat | test.rs:301:9:301:9 | x | match | +| test.rs:298:23:298:23 | x | test.rs:298:13:298:19 | TupleStructPat | | +| test.rs:299:13:299:26 | BreakExpr | test.rs:296:18:302:5 | BlockExpr | break('block) | +| test.rs:299:13:299:27 | ExprStmt | test.rs:299:26:299:26 | 1 | | +| test.rs:299:26:299:26 | 1 | test.rs:299:13:299:26 | BreakExpr | | +| test.rs:301:9:301:9 | x | test.rs:296:18:302:5 | BlockExpr | | diff --git a/rust/ql/test/library-tests/controlflow/test.rs b/rust/ql/test/library-tests/controlflow/test.rs index 22d8b9f24a60..4ad742b30444 100644 --- a/rust/ql/test/library-tests/controlflow/test.rs +++ b/rust/ql/test/library-tests/controlflow/test.rs @@ -51,6 +51,20 @@ mod loop_expression { } } + fn test_loop_label_shadowing(b: bool) -> ! { + 'loop: loop { + 1; + 'loop: loop { + if b { + continue; + } else if b { + continue 'loop; + } + continue 'loop; + } + } + } + fn test_while(i: i64) { let mut b = true; while b { From fb9ec2423cc1db4a9285afff76528c7042dd3ffd Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Wed, 2 Oct 2024 09:54:09 +0200 Subject: [PATCH 44/79] Rust: Implement `UnusedVariable.ql` --- rust/ql/lib/codeql/rust/elements/Variable.qll | 4 + .../rust/elements/internal/VariableImpl.qll | 44 ++++ .../queries/unusedentities/UnusedVariable.ql | 11 +- .../variables/variables.expected | 106 +++++++++ .../test/library-tests/variables/variables.ql | 6 + .../unusedentities/UnusedVariable.expected | 4 + .../test/query-tests/unusedentities/main.rs | 204 +++++++++--------- 7 files changed, 273 insertions(+), 106 deletions(-) diff --git a/rust/ql/lib/codeql/rust/elements/Variable.qll b/rust/ql/lib/codeql/rust/elements/Variable.qll index 76c2d9f19f72..31cc17a263f8 100644 --- a/rust/ql/lib/codeql/rust/elements/Variable.qll +++ b/rust/ql/lib/codeql/rust/elements/Variable.qll @@ -7,3 +7,7 @@ private import internal.VariableImpl final class Variable = Impl::Variable; final class VariableAccess = Impl::VariableAccess; + +final class VariableWriteAccess = Impl::VariableWriteAccess; + +final class VariableReadAccess = Impl::VariableReadAccess; diff --git a/rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll index 58c9a4fb6ebf..0f7968079157 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll @@ -98,6 +98,27 @@ module Impl { /** Gets an access to this variable. */ VariableAccess getAnAccess() { result.getVariable() = this } + + /** + * Gets the pattern that declares this variable. + * + * Normally, the pattern is unique, except when introduced in an or pattern: + * + * ```rust + * match either { + * Either::Left(x) | Either::Right(x) => println!(x), + * } + * ``` + */ + IdentPat getPat() { variableDecl(definingNode, result, name) } + + /** Gets the initial value of this variable, if any. */ + Expr getInitializer() { + exists(LetStmt let | + this.getPat() = let.getPat() and + result = let.getInitializer() + ) + } } /** A path expression that may access a local variable. */ @@ -366,6 +387,29 @@ module Impl { override string getAPrimaryQlClass() { result = "VariableAccess" } } + /** Holds if `e` occurs in the LHS of a (compound) assignment. */ + private predicate assignLhs(Expr e) { + exists(BinaryExpr be | + be.getOperatorName().regexpMatch(".*=") and + e = be.getLhs() + ) + or + exists(Expr mid | + assignLhs(mid) and + getImmediateParent(e) = mid + ) + } + + /** A variable write. */ + class VariableWriteAccess extends VariableAccess { + VariableWriteAccess() { assignLhs(this) } + } + + /** A variable read. */ + class VariableReadAccess extends VariableAccess { + VariableReadAccess() { not this instanceof VariableWriteAccess } + } + cached private module Cached { cached diff --git a/rust/ql/src/queries/unusedentities/UnusedVariable.ql b/rust/ql/src/queries/unusedentities/UnusedVariable.ql index a057db7d1734..5fb0cdfecdc1 100644 --- a/rust/ql/src/queries/unusedentities/UnusedVariable.ql +++ b/rust/ql/src/queries/unusedentities/UnusedVariable.ql @@ -3,13 +3,16 @@ * @description Unused variables may be an indication that the code is incomplete or has a typo. * @kind problem * @problem.severity recommendation - * @precision medium + * @precision high * @id rust/unused-variable * @tags maintainability */ import rust -from Locatable e -where none() // TODO: implement query -select e, "Variable is not used." +from Variable v +where + not exists(v.getAnAccess()) and + not exists(v.getInitializer()) and + not v.getName().charAt(0) = "_" +select v, "Variable is not used." diff --git a/rust/ql/test/library-tests/variables/variables.expected b/rust/ql/test/library-tests/variables/variables.expected index ba563aeab6ef..c86e30d4bb57 100644 --- a/rust/ql/test/library-tests/variables/variables.expected +++ b/rust/ql/test/library-tests/variables/variables.expected @@ -146,3 +146,109 @@ variableAccess | variables.rs:306:15:306:16 | n2 | variables.rs:304:9:304:10 | n2 | | variables.rs:313:12:313:12 | v | variables.rs:310:9:310:9 | v | | variables.rs:314:19:314:22 | text | variables.rs:312:9:312:12 | text | +variableWriteAccess +| variables.rs:17:5:17:6 | x2 | variables.rs:15:13:15:14 | x2 | +| variables.rs:266:9:266:10 | c2 | variables.rs:259:13:259:14 | c2 | +| variables.rs:267:9:267:10 | b4 | variables.rs:258:13:258:14 | b4 | +| variables.rs:268:9:268:11 | a10 | variables.rs:257:13:257:15 | a10 | +variableReadAccess +| variables.rs:11:15:11:16 | x1 | variables.rs:10:9:10:10 | x1 | +| variables.rs:16:15:16:16 | x2 | variables.rs:15:13:15:14 | x2 | +| variables.rs:18:15:18:16 | x2 | variables.rs:15:13:15:14 | x2 | +| variables.rs:23:15:23:16 | x3 | variables.rs:22:9:22:10 | x3 | +| variables.rs:25:9:25:10 | x3 | variables.rs:22:9:22:10 | x3 | +| variables.rs:26:15:26:16 | x3 | variables.rs:24:9:24:10 | x3 | +| variables.rs:31:15:31:16 | x4 | variables.rs:30:9:30:10 | x4 | +| variables.rs:34:19:34:20 | x4 | variables.rs:33:13:33:14 | x4 | +| variables.rs:36:15:36:16 | x4 | variables.rs:30:9:30:10 | x4 | +| variables.rs:55:15:55:16 | a1 | variables.rs:47:13:47:14 | a1 | +| variables.rs:56:15:56:16 | b1 | variables.rs:48:13:48:14 | b1 | +| variables.rs:57:15:57:15 | x | variables.rs:51:13:51:13 | x | +| variables.rs:58:15:58:15 | y | variables.rs:52:13:52:13 | y | +| variables.rs:66:9:66:10 | p1 | variables.rs:62:9:62:10 | p1 | +| variables.rs:67:15:67:16 | a2 | variables.rs:64:12:64:13 | a2 | +| variables.rs:68:15:68:16 | b2 | variables.rs:65:12:65:13 | b2 | +| variables.rs:75:11:75:12 | s1 | variables.rs:72:9:72:10 | s1 | +| variables.rs:76:19:76:20 | s2 | variables.rs:74:21:74:22 | s2 | +| variables.rs:85:15:85:16 | x5 | variables.rs:81:14:81:15 | x5 | +| variables.rs:92:11:92:12 | x6 | variables.rs:89:9:89:10 | x6 | +| variables.rs:97:23:97:24 | y1 | variables.rs:94:14:94:15 | y1 | +| variables.rs:102:15:102:16 | y1 | variables.rs:90:9:90:10 | y1 | +| variables.rs:108:11:108:17 | numbers | variables.rs:106:9:106:15 | numbers | +| variables.rs:114:23:114:27 | first | variables.rs:110:13:110:17 | first | +| variables.rs:115:23:115:27 | third | variables.rs:111:13:111:17 | third | +| variables.rs:116:23:116:27 | fifth | variables.rs:112:13:112:17 | fifth | +| variables.rs:120:11:120:17 | numbers | variables.rs:106:9:106:15 | numbers | +| variables.rs:126:23:126:27 | first | variables.rs:122:13:122:17 | first | +| variables.rs:127:23:127:26 | last | variables.rs:124:13:124:16 | last | +| variables.rs:135:11:135:12 | p2 | variables.rs:133:9:133:10 | p2 | +| variables.rs:138:24:138:25 | x7 | variables.rs:137:16:137:17 | x7 | +| variables.rs:149:11:149:13 | msg | variables.rs:147:9:147:11 | msg | +| variables.rs:152:24:152:34 | id_variable | variables.rs:151:17:151:27 | id_variable | +| variables.rs:157:23:157:24 | id | variables.rs:156:26:156:27 | id | +| variables.rs:168:11:168:16 | either | variables.rs:167:9:167:14 | either | +| variables.rs:170:26:170:27 | a3 | variables.rs:169:9:169:44 | a3 | +| variables.rs:182:11:182:12 | tv | variables.rs:181:9:181:10 | tv | +| variables.rs:184:26:184:27 | a4 | variables.rs:183:9:183:81 | a4 | +| variables.rs:186:11:186:12 | tv | variables.rs:181:9:181:10 | tv | +| variables.rs:188:26:188:27 | a5 | variables.rs:187:9:187:83 | a5 | +| variables.rs:190:11:190:12 | tv | variables.rs:181:9:181:10 | tv | +| variables.rs:192:26:192:27 | a6 | variables.rs:191:9:191:83 | a6 | +| variables.rs:198:11:198:16 | either | variables.rs:197:9:197:14 | either | +| variables.rs:200:16:200:17 | a7 | variables.rs:199:9:199:44 | a7 | +| variables.rs:201:26:201:27 | a7 | variables.rs:199:9:199:44 | a7 | +| variables.rs:209:11:209:16 | either | variables.rs:207:9:207:14 | either | +| variables.rs:213:23:213:25 | a11 | variables.rs:211:14:211:51 | a11 | +| variables.rs:215:15:215:15 | e | variables.rs:210:13:210:13 | e | +| variables.rs:216:28:216:30 | a12 | variables.rs:214:33:214:35 | a12 | +| variables.rs:232:11:232:12 | fv | variables.rs:231:9:231:10 | fv | +| variables.rs:234:26:234:28 | a13 | variables.rs:233:9:233:109 | a13 | +| variables.rs:244:15:244:16 | a8 | variables.rs:239:5:239:6 | a8 | +| variables.rs:245:15:245:16 | b3 | variables.rs:241:9:241:10 | b3 | +| variables.rs:246:15:246:16 | c1 | variables.rs:242:9:242:10 | c1 | +| variables.rs:252:15:252:16 | a9 | variables.rs:250:6:250:41 | a9 | +| variables.rs:261:15:261:17 | a10 | variables.rs:257:13:257:15 | a10 | +| variables.rs:262:15:262:16 | b4 | variables.rs:258:13:258:14 | b4 | +| variables.rs:263:15:263:16 | c2 | variables.rs:259:13:259:14 | c2 | +| variables.rs:270:9:270:11 | a10 | variables.rs:257:13:257:15 | a10 | +| variables.rs:271:9:271:10 | b4 | variables.rs:258:13:258:14 | b4 | +| variables.rs:272:9:272:10 | c2 | variables.rs:259:13:259:14 | c2 | +| variables.rs:274:15:274:17 | a10 | variables.rs:257:13:257:15 | a10 | +| variables.rs:275:15:275:16 | b4 | variables.rs:258:13:258:14 | b4 | +| variables.rs:276:15:276:16 | c2 | variables.rs:259:13:259:14 | c2 | +| variables.rs:283:23:283:25 | a10 | variables.rs:280:13:280:15 | a10 | +| variables.rs:284:23:284:24 | b4 | variables.rs:281:13:281:14 | b4 | +| variables.rs:288:15:288:17 | a10 | variables.rs:257:13:257:15 | a10 | +| variables.rs:289:15:289:16 | b4 | variables.rs:258:13:258:14 | b4 | +| variables.rs:295:9:295:9 | x | variables.rs:294:10:294:10 | x | +| variables.rs:297:9:297:23 | example_closure | variables.rs:293:9:293:23 | example_closure | +| variables.rs:298:15:298:16 | n1 | variables.rs:296:9:296:10 | n1 | +| variables.rs:303:9:303:9 | x | variables.rs:302:10:302:10 | x | +| variables.rs:305:9:305:26 | immutable_variable | variables.rs:301:9:301:26 | immutable_variable | +| variables.rs:306:15:306:16 | n2 | variables.rs:304:9:304:10 | n2 | +| variables.rs:313:12:313:12 | v | variables.rs:310:9:310:9 | v | +| variables.rs:314:19:314:22 | text | variables.rs:312:9:312:12 | text | +variableInitializer +| variables.rs:10:9:10:10 | x1 | variables.rs:10:14:10:16 | "a" | +| variables.rs:15:13:15:14 | x2 | variables.rs:15:18:15:18 | 4 | +| variables.rs:22:9:22:10 | x3 | variables.rs:22:14:22:14 | 1 | +| variables.rs:24:9:24:10 | x3 | variables.rs:25:9:25:14 | ... + ... | +| variables.rs:30:9:30:10 | x4 | variables.rs:30:14:30:16 | "a" | +| variables.rs:33:13:33:14 | x4 | variables.rs:33:18:33:20 | "b" | +| variables.rs:62:9:62:10 | p1 | variables.rs:62:14:62:37 | RecordExpr | +| variables.rs:72:9:72:10 | s1 | variables.rs:72:14:72:41 | CallExpr | +| variables.rs:89:9:89:10 | x6 | variables.rs:89:14:89:20 | CallExpr | +| variables.rs:90:9:90:10 | y1 | variables.rs:90:14:90:15 | 10 | +| variables.rs:106:9:106:15 | numbers | variables.rs:106:19:106:35 | TupleExpr | +| variables.rs:133:9:133:10 | p2 | variables.rs:133:14:133:37 | RecordExpr | +| variables.rs:147:9:147:11 | msg | variables.rs:147:15:147:38 | RecordExpr | +| variables.rs:167:9:167:14 | either | variables.rs:167:18:167:33 | CallExpr | +| variables.rs:181:9:181:10 | tv | variables.rs:181:14:181:36 | CallExpr | +| variables.rs:197:9:197:14 | either | variables.rs:197:18:197:33 | CallExpr | +| variables.rs:207:9:207:14 | either | variables.rs:207:18:207:33 | CallExpr | +| variables.rs:231:9:231:10 | fv | variables.rs:231:14:231:35 | CallExpr | +| variables.rs:293:9:293:23 | example_closure | variables.rs:294:9:295:9 | ClosureExpr | +| variables.rs:296:9:296:10 | n1 | variables.rs:297:9:297:26 | CallExpr | +| variables.rs:301:9:301:26 | immutable_variable | variables.rs:302:9:303:9 | ClosureExpr | +| variables.rs:304:9:304:10 | n2 | variables.rs:305:9:305:29 | CallExpr | +| variables.rs:310:9:310:9 | v | variables.rs:310:13:310:41 | RefExpr | diff --git a/rust/ql/test/library-tests/variables/variables.ql b/rust/ql/test/library-tests/variables/variables.ql index b96f6ceabcae..dcca73d5cf28 100644 --- a/rust/ql/test/library-tests/variables/variables.ql +++ b/rust/ql/test/library-tests/variables/variables.ql @@ -5,6 +5,12 @@ query predicate variable(Variable v) { any() } query predicate variableAccess(VariableAccess va, Variable v) { v = va.getVariable() } +query predicate variableWriteAccess(VariableWriteAccess va, Variable v) { v = va.getVariable() } + +query predicate variableReadAccess(VariableReadAccess va, Variable v) { v = va.getVariable() } + +query predicate variableInitializer(Variable v, Expr e) { e = v.getInitializer() } + module VariableAccessTest implements TestSig { string getARelevantTag() { result = "access" } diff --git a/rust/ql/test/query-tests/unusedentities/UnusedVariable.expected b/rust/ql/test/query-tests/unusedentities/UnusedVariable.expected index e69de29bb2d1..f3aadfdff0d8 100644 --- a/rust/ql/test/query-tests/unusedentities/UnusedVariable.expected +++ b/rust/ql/test/query-tests/unusedentities/UnusedVariable.expected @@ -0,0 +1,4 @@ +| main.rs:23:9:23:9 | a | Variable is not used. | +| main.rs:88:13:88:13 | d | Variable is not used. | +| main.rs:112:9:112:9 | k | Variable is not used. | +| main.rs:139:5:139:5 | y | Variable is not used. | diff --git a/rust/ql/test/query-tests/unusedentities/main.rs b/rust/ql/test/query-tests/unusedentities/main.rs index 8066f7c783e0..c58693ed8667 100644 --- a/rust/ql/test/query-tests/unusedentities/main.rs +++ b/rust/ql/test/query-tests/unusedentities/main.rs @@ -1,118 +1,119 @@ - //fn cond() -> bool; // --- locals --- fn locals_1() { - let a = 1; // BAD: unused value [NOT DETECTED] - let b = 1; - let c = 1; - let d = String::from("a"); // BAD: unused value [NOT DETECTED] - let e = String::from("b"); - let _ = 1; // (deliberately unused) + let a = 1; // BAD: unused value [NOT DETECTED] + let b = 1; + let c = 1; + let d = String::from("a"); // BAD: unused value [NOT DETECTED] + let e = String::from("b"); + let _ = 1; // (deliberately unused) - println!("use {}", b); + println!("use {}", b); - if cond() { - println!("use {}", c); - } + if cond() { + println!("use {}", c); + } - println!("use {}", e); + println!("use {}", e); } fn locals_2() { - let a: i32; - let b: i32; // BAD: unused variable [NOT DETECTED] - let mut c: i32; - let mut d: i32; - let mut e: i32; - let mut f: i32; - let g: i32; - let h: i32; - let i: i32; - - b = 1; // BAD: unused value [NOT DETECTED] - - c = 1; // BAD: unused value [NOT DETECTED] - c = 2; - println!("use {}", c); - c = 3; // BAD: unused value [NOT DETECTED] - - d = 1; - if cond() { - d = 2; // BAD: unused value [NOT DETECTED] - d = 3; - } else { - } - println!("use {}", d); - - e = 1; // BAD: unused value [NOT DETECTED] - if cond() { - e = 2; - } else { - e = 3; - } - println!("use {}", e); - - f = 1; - f += 1; - println!("use {}", f); - f += 1; // BAD: unused value [NOT DETECTED] - f = 1; - f += 1; // BAD: unused value [NOT DETECTED] - - g = if cond() { 1 } else { 2 }; // BAD: unused value (x2) [NOT DETECTED] - h = if cond() { 3 } else { 4 }; - i = if cond() { h } else { 5 }; - println!("use {}", i); - - _ = 1; // (deliberately unused) [NOT DETECTED] + let a: i32; // BAD: unused variable + let b: i32; + let mut c: i32; + let mut d: i32; + let mut e: i32; + let mut f: i32; + let g: i32; + let h: i32; + let i: i32; + + b = 1; // BAD: unused value [NOT DETECTED] + + c = 1; // BAD: unused value [NOT DETECTED] + c = 2; + println!("use {}", c); + c = 3; // BAD: unused value [NOT DETECTED] + + d = 1; + if cond() { + d = 2; // BAD: unused value [NOT DETECTED] + d = 3; + } else { + } + println!("use {}", d); + + e = 1; // BAD: unused value [NOT DETECTED] + if cond() { + e = 2; + } else { + e = 3; + } + println!("use {}", e); + + f = 1; + f += 1; + println!("use {}", f); + f += 1; // BAD: unused value [NOT DETECTED] + f = 1; + f += 1; // BAD: unused value [NOT DETECTED] + + g = if cond() { 1 } else { 2 }; // BAD: unused value (x2) [NOT DETECTED] + h = if cond() { 3 } else { 4 }; + i = if cond() { h } else { 5 }; + println!("use {}", i); + + _ = 1; // (deliberately unused) [NOT DETECTED] } // --- structs --- #[derive(Debug)] struct MyStruct { - val: i64 + val: i64, } impl MyStruct { - fn my_get(&mut self) -> i64 { - return self.val; - } + fn my_get(&mut self) -> i64 { + return self.val; + } } fn structs() { - let a = MyStruct {val : 1 }; // BAD: unused value [NOT DETECTED] - let b = MyStruct {val : 2 }; - let c = MyStruct {val : 3 }; - let mut d : MyStruct; // BAD: unused variable [NOT DETECTED] - let mut e : MyStruct; - let mut f : MyStruct; - - println!("lets use {:?} and {}", b, c.val); - - e = MyStruct {val : 4 }; - println!("lets use {}", e.my_get()); - e.val = 5; - println!("lets use {}", e.my_get()); - - f = MyStruct {val : 6 }; // BAD: unused value [NOT DETECTED] - f.val = 7; // BAD: unused value [NOT DETECTED] + let a = MyStruct { val: 1 }; // BAD: unused value [NOT DETECTED] + let b = MyStruct { val: 2 }; + let c = MyStruct { val: 3 }; + let mut d: MyStruct; // BAD: unused variable + let mut e: MyStruct; + let mut f: MyStruct; + + println!("lets use {:?} and {}", b, c.val); + + e = MyStruct { val: 4 }; + println!("lets use {}", e.my_get()); + e.val = 5; + println!("lets use {}", e.my_get()); + + f = MyStruct { val: 6 }; // BAD: unused value [NOT DETECTED] + f.val = 7; // BAD: unused value [NOT DETECTED] } // --- arrays --- fn arrays() { - let is = [1, 2, 3]; // BAD: unused values (x3) [NOT DETECTED] - let js = [1, 2, 3]; - let ks = [1, 2, 3]; + let is = [1, 2, 3]; // BAD: unused values (x3) [NOT DETECTED] + let js = [1, 2, 3]; + let ks = [1, 2, 3]; - println!("lets use {:?}", js); + println!("lets use {:?}", js); - for k in ks { - println!("lets use {}", k); - } + for k // BAD: unused variable [SPURIOUS: macros not yet supported] + in ks + { + println!("lets use {}", k); + } } // --- constants and statics --- @@ -123,30 +124,29 @@ static mut STAT1: i32 = 1; static mut STAT2: i32 = 2; // BAD: unused value [NOT DETECTED] fn statics() { - static mut STAT3: i32 = 0; - static mut STAT4: i32 = 0; // BAD: unused value [NOT DETECTED] + static mut STAT3: i32 = 0; + static mut STAT4: i32 = 0; // BAD: unused value [NOT DETECTED] - unsafe - { - let total = CON1 + STAT1 + STAT3; - } + unsafe { + let total = CON1 + STAT1 + STAT3; + } } // --- parameters --- fn parameters( - x: i32, - y: i32, // BAD: unused variable [NOT DETECTED] - _z: i32 // (`_` is asking the compiler, and by extension us, to not warn that this is unused) - ) -> i32 { - return x; + x: i32, + y: i32, // BAD: unused variable + _z: i32, // (`_` is asking the compiler, and by extension us, to not warn that this is unused) +) -> i32 { + return x; } fn main() { - locals_1(); - locals_2(); - structs(); - arrays(); - statics(); - println!("lets use result {}", parameters(1, 2, 3)); + locals_1(); + locals_2(); + structs(); + arrays(); + statics(); + println!("lets use result {}", parameters(1, 2, 3)); } From 8243f871791ba47aee375d97bd3aacf5c20786b4 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 2 Oct 2024 11:38:23 +0100 Subject: [PATCH 45/79] Rust: Modify the exclusion as suggested in comments. --- rust/ql/lib/codeql/files/FileSystem.qll | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rust/ql/lib/codeql/files/FileSystem.qll b/rust/ql/lib/codeql/files/FileSystem.qll index a5410ece9712..03b5cd0b183b 100644 --- a/rust/ql/lib/codeql/files/FileSystem.qll +++ b/rust/ql/lib/codeql/files/FileSystem.qll @@ -5,7 +5,6 @@ private import codeql.util.FileSystem private import codeql.rust.elements.SourceFile private import codeql.rust.elements.AstNode private import codeql.rust.elements.Comment -private import codeql.rust.elements.internal.generated.ParentChild private module Input implements InputSig { abstract class ContainerBase extends @container { @@ -48,7 +47,7 @@ class File extends Container, Impl::File { exists(AstNode node, Location loc | not node instanceof Comment and not node instanceof SourceFile and - not getImmediateParent(node) instanceof SourceFile and // ignore top-level elements for now as we're getting their locations wrong when a comment is attached + not node instanceof Item and // ignore Items for now as we're getting their locations wrong when a comment is attached loc = node.getLocation() | node.getFile() = this and From 3a1f6efce413cb8f841ae26a919c32dd6b87a152 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Wed, 2 Oct 2024 13:37:24 +0200 Subject: [PATCH 46/79] Address review comments --- .../rust/elements/internal/VariableImpl.qll | 23 +++++++++++++------ .../test/query-tests/unusedentities/main.rs | 2 +- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll index 0f7968079157..3f0cabc97b85 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll @@ -387,27 +387,36 @@ module Impl { override string getAPrimaryQlClass() { result = "VariableAccess" } } - /** Holds if `e` occurs in the LHS of a (compound) assignment. */ - private predicate assignLhs(Expr e) { - exists(BinaryExpr be | - be.getOperatorName().regexpMatch(".*=") and + /** Holds if `e` occurs in the LHS of an assignment or compound assignment. */ + private predicate assignLhs(Expr e, boolean compound) { + exists(BinaryExpr be, string op | + op = be.getOperatorName().regexpCapture("(.*)=", 1) and e = be.getLhs() + | + op = "" and compound = false + or + op != "" and compound = true ) or exists(Expr mid | - assignLhs(mid) and + assignLhs(mid, compound) and getImmediateParent(e) = mid ) } /** A variable write. */ class VariableWriteAccess extends VariableAccess { - VariableWriteAccess() { assignLhs(this) } + VariableWriteAccess() { assignLhs(this, _) } } /** A variable read. */ class VariableReadAccess extends VariableAccess { - VariableReadAccess() { not this instanceof VariableWriteAccess } + VariableReadAccess() { + not this instanceof VariableWriteAccess + or + // consider LHS in compound assignments both reads and writes + assignLhs(this, true) + } } cached diff --git a/rust/ql/test/query-tests/unusedentities/main.rs b/rust/ql/test/query-tests/unusedentities/main.rs index c58693ed8667..7280f6c2502b 100644 --- a/rust/ql/test/query-tests/unusedentities/main.rs +++ b/rust/ql/test/query-tests/unusedentities/main.rs @@ -109,7 +109,7 @@ fn arrays() { println!("lets use {:?}", js); - for k // BAD: unused variable [SPURIOUS: macros not yet supported] + for k // SPURIOUS: unused variable [macros not yet supported] in ks { println!("lets use {}", k); From 104d448b166d7644cf62b262b9ba3425ad6da57b Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 2 Oct 2024 14:39:27 +0200 Subject: [PATCH 47/79] Shared: Only use heuristic summary flow in case there is no content based flow. --- .../codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll b/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll index f56c1b8dfff0..8d4bb4cae5a0 100644 --- a/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll +++ b/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll @@ -881,7 +881,7 @@ module MakeModelGenerator< string captureMixedFlow(DataFlowSummaryTargetApi api, boolean lift) { result = ContentSensitive::captureFlow(api, lift) or - not exists(ContentSensitive::captureFlow(api, lift)) and + not exists(ContentSensitive::captureFlow(api, _)) and result = captureFlow(api) and lift = true } From 51623c3837091d55026f6c48440cb0f1b3a1040b Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 2 Oct 2024 11:05:20 +0200 Subject: [PATCH 48/79] Java: Consider all summarized callable with generated verification as generated when counting generated vs manual. --- .../src/Metrics/Summaries/GeneratedVsManualCoverageQuery.qll | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java/ql/src/Metrics/Summaries/GeneratedVsManualCoverageQuery.qll b/java/ql/src/Metrics/Summaries/GeneratedVsManualCoverageQuery.qll index 9a2a0201e803..8309126c06de 100644 --- a/java/ql/src/Metrics/Summaries/GeneratedVsManualCoverageQuery.qll +++ b/java/ql/src/Metrics/Summaries/GeneratedVsManualCoverageQuery.qll @@ -17,12 +17,12 @@ private int getNumMadModeledApis(string package, string provenance, string apiSu ( // "auto-only" not sc.hasManualModel() and - sc.hasProvenance("df-generated") and + sc.hasGeneratedModel() and provenance = "generated" or sc.hasManualModel() and ( - if sc.hasProvenance("df-generated") + if sc.hasGeneratedModel() then // "both" provenance = "both" From 000dedf3e851c4162d5551c8d48c2cec92df17f8 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Mon, 30 Sep 2024 09:48:59 +0200 Subject: [PATCH 49/79] Rust: Output CFG for `library-tests/variables` --- .../test/library-tests/controlflow/Cfg.qlref | 1 + .../test/library-tests/variables/Cfg.expected | 594 ++++++++++++++++++ .../ql/test/library-tests/variables/Cfg.qlref | 1 + rust/ql/test/utils/Cfg.expected | 3 + .../controlflow => utils}/Cfg.ql | 0 5 files changed, 599 insertions(+) create mode 100644 rust/ql/test/library-tests/controlflow/Cfg.qlref create mode 100644 rust/ql/test/library-tests/variables/Cfg.expected create mode 100644 rust/ql/test/library-tests/variables/Cfg.qlref create mode 100644 rust/ql/test/utils/Cfg.expected rename rust/ql/test/{library-tests/controlflow => utils}/Cfg.ql (100%) diff --git a/rust/ql/test/library-tests/controlflow/Cfg.qlref b/rust/ql/test/library-tests/controlflow/Cfg.qlref new file mode 100644 index 000000000000..ba4ee4b414f1 --- /dev/null +++ b/rust/ql/test/library-tests/controlflow/Cfg.qlref @@ -0,0 +1 @@ +query: utils/Cfg.ql \ No newline at end of file diff --git a/rust/ql/test/library-tests/variables/Cfg.expected b/rust/ql/test/library-tests/variables/Cfg.expected new file mode 100644 index 000000000000..876e5fb52664 --- /dev/null +++ b/rust/ql/test/library-tests/variables/Cfg.expected @@ -0,0 +1,594 @@ +| variables.rs:1:1:3:1 | enter print_str | variables.rs:2:5:2:22 | ExprStmt | | +| variables.rs:1:1:3:1 | exit print_str (normal) | variables.rs:1:1:3:1 | exit print_str | | +| variables.rs:1:23:3:1 | BlockExpr | variables.rs:1:1:3:1 | exit print_str (normal) | | +| variables.rs:2:5:2:21 | MacroExpr | variables.rs:1:23:3:1 | BlockExpr | | +| variables.rs:2:5:2:22 | ExprStmt | variables.rs:2:5:2:21 | MacroExpr | | +| variables.rs:5:1:7:1 | enter print_i64 | variables.rs:6:5:6:22 | ExprStmt | | +| variables.rs:5:1:7:1 | exit print_i64 (normal) | variables.rs:5:1:7:1 | exit print_i64 | | +| variables.rs:5:22:7:1 | BlockExpr | variables.rs:5:1:7:1 | exit print_i64 (normal) | | +| variables.rs:6:5:6:21 | MacroExpr | variables.rs:5:22:7:1 | BlockExpr | | +| variables.rs:6:5:6:22 | ExprStmt | variables.rs:6:5:6:21 | MacroExpr | | +| variables.rs:9:1:12:1 | enter immutable_variable | variables.rs:10:5:10:17 | LetStmt | | +| variables.rs:9:1:12:1 | exit immutable_variable (normal) | variables.rs:9:1:12:1 | exit immutable_variable | | +| variables.rs:9:25:12:1 | BlockExpr | variables.rs:9:1:12:1 | exit immutable_variable (normal) | | +| variables.rs:10:5:10:17 | LetStmt | variables.rs:10:14:10:16 | "a" | | +| variables.rs:10:9:10:10 | x1 | variables.rs:11:5:11:18 | ExprStmt | match, no-match | +| variables.rs:10:14:10:16 | "a" | variables.rs:10:9:10:10 | x1 | | +| variables.rs:11:5:11:13 | PathExpr | variables.rs:11:15:11:16 | x1 | | +| variables.rs:11:5:11:17 | CallExpr | variables.rs:9:25:12:1 | BlockExpr | | +| variables.rs:11:5:11:18 | ExprStmt | variables.rs:11:5:11:13 | PathExpr | | +| variables.rs:11:15:11:16 | x1 | variables.rs:11:5:11:17 | CallExpr | | +| variables.rs:14:1:19:1 | enter mutable_variable | variables.rs:15:5:15:19 | LetStmt | | +| variables.rs:14:1:19:1 | exit mutable_variable (normal) | variables.rs:14:1:19:1 | exit mutable_variable | | +| variables.rs:14:23:19:1 | BlockExpr | variables.rs:14:1:19:1 | exit mutable_variable (normal) | | +| variables.rs:15:5:15:19 | LetStmt | variables.rs:15:18:15:18 | 4 | | +| variables.rs:15:9:15:14 | x2 | variables.rs:16:5:16:18 | ExprStmt | match, no-match | +| variables.rs:15:18:15:18 | 4 | variables.rs:15:9:15:14 | x2 | | +| variables.rs:16:5:16:13 | PathExpr | variables.rs:16:15:16:16 | x2 | | +| variables.rs:16:5:16:17 | CallExpr | variables.rs:17:5:17:11 | ExprStmt | | +| variables.rs:16:5:16:18 | ExprStmt | variables.rs:16:5:16:13 | PathExpr | | +| variables.rs:16:15:16:16 | x2 | variables.rs:16:5:16:17 | CallExpr | | +| variables.rs:17:5:17:6 | x2 | variables.rs:17:10:17:10 | 5 | | +| variables.rs:17:5:17:10 | ... = ... | variables.rs:18:5:18:18 | ExprStmt | | +| variables.rs:17:5:17:11 | ExprStmt | variables.rs:17:5:17:6 | x2 | | +| variables.rs:17:10:17:10 | 5 | variables.rs:17:5:17:10 | ... = ... | | +| variables.rs:18:5:18:13 | PathExpr | variables.rs:18:15:18:16 | x2 | | +| variables.rs:18:5:18:17 | CallExpr | variables.rs:14:23:19:1 | BlockExpr | | +| variables.rs:18:5:18:18 | ExprStmt | variables.rs:18:5:18:13 | PathExpr | | +| variables.rs:18:15:18:16 | x2 | variables.rs:18:5:18:17 | CallExpr | | +| variables.rs:21:1:27:1 | enter variable_shadow1 | variables.rs:22:5:22:15 | LetStmt | | +| variables.rs:21:1:27:1 | exit variable_shadow1 (normal) | variables.rs:21:1:27:1 | exit variable_shadow1 | | +| variables.rs:21:23:27:1 | BlockExpr | variables.rs:21:1:27:1 | exit variable_shadow1 (normal) | | +| variables.rs:22:5:22:15 | LetStmt | variables.rs:22:14:22:14 | 1 | | +| variables.rs:22:9:22:10 | x3 | variables.rs:23:5:23:18 | ExprStmt | match, no-match | +| variables.rs:22:14:22:14 | 1 | variables.rs:22:9:22:10 | x3 | | +| variables.rs:23:5:23:13 | PathExpr | variables.rs:23:15:23:16 | x3 | | +| variables.rs:23:5:23:17 | CallExpr | variables.rs:24:5:25:15 | LetStmt | | +| variables.rs:23:5:23:18 | ExprStmt | variables.rs:23:5:23:13 | PathExpr | | +| variables.rs:23:15:23:16 | x3 | variables.rs:23:5:23:17 | CallExpr | | +| variables.rs:24:5:25:15 | LetStmt | variables.rs:25:9:25:10 | x3 | | +| variables.rs:24:9:24:10 | x3 | variables.rs:26:5:26:18 | ExprStmt | match, no-match | +| variables.rs:25:9:25:10 | x3 | variables.rs:25:14:25:14 | 1 | | +| variables.rs:25:9:25:14 | ... + ... | variables.rs:24:9:24:10 | x3 | | +| variables.rs:25:14:25:14 | 1 | variables.rs:25:9:25:14 | ... + ... | | +| variables.rs:26:5:26:13 | PathExpr | variables.rs:26:15:26:16 | x3 | | +| variables.rs:26:5:26:17 | CallExpr | variables.rs:21:23:27:1 | BlockExpr | | +| variables.rs:26:5:26:18 | ExprStmt | variables.rs:26:5:26:13 | PathExpr | | +| variables.rs:26:15:26:16 | x3 | variables.rs:26:5:26:17 | CallExpr | | +| variables.rs:29:1:37:1 | enter variable_shadow2 | variables.rs:30:5:30:17 | LetStmt | | +| variables.rs:29:1:37:1 | exit variable_shadow2 (normal) | variables.rs:29:1:37:1 | exit variable_shadow2 | | +| variables.rs:29:23:37:1 | BlockExpr | variables.rs:29:1:37:1 | exit variable_shadow2 (normal) | | +| variables.rs:30:5:30:17 | LetStmt | variables.rs:30:14:30:16 | "a" | | +| variables.rs:30:9:30:10 | x4 | variables.rs:31:5:31:18 | ExprStmt | match, no-match | +| variables.rs:30:14:30:16 | "a" | variables.rs:30:9:30:10 | x4 | | +| variables.rs:31:5:31:13 | PathExpr | variables.rs:31:15:31:16 | x4 | | +| variables.rs:31:5:31:17 | CallExpr | variables.rs:32:5:35:5 | ExprStmt | | +| variables.rs:31:5:31:18 | ExprStmt | variables.rs:31:5:31:13 | PathExpr | | +| variables.rs:31:15:31:16 | x4 | variables.rs:31:5:31:17 | CallExpr | | +| variables.rs:32:5:35:5 | BlockExpr | variables.rs:36:5:36:18 | ExprStmt | | +| variables.rs:32:5:35:5 | ExprStmt | variables.rs:33:9:33:21 | LetStmt | | +| variables.rs:33:9:33:21 | LetStmt | variables.rs:33:18:33:20 | "b" | | +| variables.rs:33:13:33:14 | x4 | variables.rs:34:9:34:22 | ExprStmt | match, no-match | +| variables.rs:33:18:33:20 | "b" | variables.rs:33:13:33:14 | x4 | | +| variables.rs:34:9:34:17 | PathExpr | variables.rs:34:19:34:20 | x4 | | +| variables.rs:34:9:34:21 | CallExpr | variables.rs:32:5:35:5 | BlockExpr | | +| variables.rs:34:9:34:22 | ExprStmt | variables.rs:34:9:34:17 | PathExpr | | +| variables.rs:34:19:34:20 | x4 | variables.rs:34:9:34:21 | CallExpr | | +| variables.rs:36:5:36:13 | PathExpr | variables.rs:36:15:36:16 | x4 | | +| variables.rs:36:5:36:17 | CallExpr | variables.rs:29:23:37:1 | BlockExpr | | +| variables.rs:36:5:36:18 | ExprStmt | variables.rs:36:5:36:13 | PathExpr | | +| variables.rs:36:15:36:16 | x4 | variables.rs:36:5:36:17 | CallExpr | | +| variables.rs:44:1:59:1 | enter let_pattern1 | variables.rs:45:5:54:47 | LetStmt | | +| variables.rs:44:1:59:1 | exit let_pattern1 (normal) | variables.rs:44:1:59:1 | exit let_pattern1 | | +| variables.rs:44:19:59:1 | BlockExpr | variables.rs:44:1:59:1 | exit let_pattern1 (normal) | | +| variables.rs:45:5:54:47 | LetStmt | variables.rs:54:11:54:13 | "a" | | +| variables.rs:45:9:54:5 | TuplePat | variables.rs:55:5:55:18 | ExprStmt | match | +| variables.rs:54:9:54:46 | TupleExpr | variables.rs:45:9:54:5 | TuplePat | | +| variables.rs:54:10:54:19 | TupleExpr | variables.rs:54:33:54:35 | "x" | | +| variables.rs:54:11:54:13 | "a" | variables.rs:54:16:54:18 | "b" | | +| variables.rs:54:16:54:18 | "b" | variables.rs:54:10:54:19 | TupleExpr | | +| variables.rs:54:22:54:45 | RecordExpr | variables.rs:54:9:54:46 | TupleExpr | | +| variables.rs:54:33:54:35 | "x" | variables.rs:54:41:54:43 | "y" | | +| variables.rs:54:41:54:43 | "y" | variables.rs:54:22:54:45 | RecordExpr | | +| variables.rs:55:5:55:13 | PathExpr | variables.rs:55:15:55:16 | a1 | | +| variables.rs:55:5:55:17 | CallExpr | variables.rs:56:5:56:18 | ExprStmt | | +| variables.rs:55:5:55:18 | ExprStmt | variables.rs:55:5:55:13 | PathExpr | | +| variables.rs:55:15:55:16 | a1 | variables.rs:55:5:55:17 | CallExpr | | +| variables.rs:56:5:56:13 | PathExpr | variables.rs:56:15:56:16 | b1 | | +| variables.rs:56:5:56:17 | CallExpr | variables.rs:57:5:57:17 | ExprStmt | | +| variables.rs:56:5:56:18 | ExprStmt | variables.rs:56:5:56:13 | PathExpr | | +| variables.rs:56:15:56:16 | b1 | variables.rs:56:5:56:17 | CallExpr | | +| variables.rs:57:5:57:13 | PathExpr | variables.rs:57:15:57:15 | x | | +| variables.rs:57:5:57:16 | CallExpr | variables.rs:58:5:58:17 | ExprStmt | | +| variables.rs:57:5:57:17 | ExprStmt | variables.rs:57:5:57:13 | PathExpr | | +| variables.rs:57:15:57:15 | x | variables.rs:57:5:57:16 | CallExpr | | +| variables.rs:58:5:58:13 | PathExpr | variables.rs:58:15:58:15 | y | | +| variables.rs:58:5:58:16 | CallExpr | variables.rs:44:19:59:1 | BlockExpr | | +| variables.rs:58:5:58:17 | ExprStmt | variables.rs:58:5:58:13 | PathExpr | | +| variables.rs:58:15:58:15 | y | variables.rs:58:5:58:16 | CallExpr | | +| variables.rs:61:1:69:1 | enter let_pattern2 | variables.rs:62:5:62:38 | LetStmt | | +| variables.rs:61:1:69:1 | exit let_pattern2 (normal) | variables.rs:61:1:69:1 | exit let_pattern2 | | +| variables.rs:61:19:69:1 | BlockExpr | variables.rs:61:1:69:1 | exit let_pattern2 (normal) | | +| variables.rs:62:5:62:38 | LetStmt | variables.rs:62:25:62:27 | "a" | | +| variables.rs:62:9:62:10 | p1 | variables.rs:63:5:66:11 | LetStmt | match, no-match | +| variables.rs:62:14:62:37 | RecordExpr | variables.rs:62:9:62:10 | p1 | | +| variables.rs:62:25:62:27 | "a" | variables.rs:62:33:62:35 | "b" | | +| variables.rs:62:33:62:35 | "b" | variables.rs:62:14:62:37 | RecordExpr | | +| variables.rs:63:5:66:11 | LetStmt | variables.rs:66:9:66:10 | p1 | | +| variables.rs:63:9:66:5 | RecordPat | variables.rs:67:5:67:18 | ExprStmt | match | +| variables.rs:66:9:66:10 | p1 | variables.rs:63:9:66:5 | RecordPat | | +| variables.rs:67:5:67:13 | PathExpr | variables.rs:67:15:67:16 | a2 | | +| variables.rs:67:5:67:17 | CallExpr | variables.rs:68:5:68:18 | ExprStmt | | +| variables.rs:67:5:67:18 | ExprStmt | variables.rs:67:5:67:13 | PathExpr | | +| variables.rs:67:15:67:16 | a2 | variables.rs:67:5:67:17 | CallExpr | | +| variables.rs:68:5:68:13 | PathExpr | variables.rs:68:15:68:16 | b2 | | +| variables.rs:68:5:68:17 | CallExpr | variables.rs:61:19:69:1 | BlockExpr | | +| variables.rs:68:5:68:18 | ExprStmt | variables.rs:68:5:68:13 | PathExpr | | +| variables.rs:68:15:68:16 | b2 | variables.rs:68:5:68:17 | CallExpr | | +| variables.rs:71:1:78:1 | enter let_pattern3 | variables.rs:72:5:72:42 | LetStmt | | +| variables.rs:71:1:78:1 | exit let_pattern3 (normal) | variables.rs:71:1:78:1 | exit let_pattern3 | | +| variables.rs:71:19:78:1 | BlockExpr | variables.rs:71:1:78:1 | exit let_pattern3 (normal) | | +| variables.rs:72:5:72:42 | LetStmt | variables.rs:72:14:72:17 | PathExpr | | +| variables.rs:72:9:72:10 | s1 | variables.rs:74:8:75:12 | LetExpr | match, no-match | +| variables.rs:72:14:72:17 | PathExpr | variables.rs:72:19:72:30 | PathExpr | | +| variables.rs:72:14:72:41 | CallExpr | variables.rs:72:9:72:10 | s1 | | +| variables.rs:72:19:72:30 | PathExpr | variables.rs:72:32:72:39 | "Hello!" | | +| variables.rs:72:19:72:40 | CallExpr | variables.rs:72:14:72:41 | CallExpr | | +| variables.rs:72:32:72:39 | "Hello!" | variables.rs:72:19:72:40 | CallExpr | | +| variables.rs:74:5:77:5 | IfExpr | variables.rs:71:19:78:1 | BlockExpr | | +| variables.rs:74:8:75:12 | LetExpr | variables.rs:74:12:74:23 | TupleStructPat | | +| variables.rs:74:12:74:23 | TupleStructPat | variables.rs:74:5:77:5 | IfExpr | no-match | +| variables.rs:74:12:74:23 | TupleStructPat | variables.rs:76:9:76:22 | ExprStmt | match | +| variables.rs:75:14:77:5 | BlockExpr | variables.rs:74:5:77:5 | IfExpr | | +| variables.rs:76:9:76:17 | PathExpr | variables.rs:76:19:76:20 | s2 | | +| variables.rs:76:9:76:21 | CallExpr | variables.rs:75:14:77:5 | BlockExpr | | +| variables.rs:76:9:76:22 | ExprStmt | variables.rs:76:9:76:17 | PathExpr | | +| variables.rs:76:19:76:20 | s2 | variables.rs:76:9:76:21 | CallExpr | | +| variables.rs:80:1:86:1 | enter let_pattern4 | variables.rs:81:5:84:6 | LetStmt | | +| variables.rs:80:1:86:1 | exit let_pattern4 (normal) | variables.rs:80:1:86:1 | exit let_pattern4 | | +| variables.rs:80:19:86:1 | BlockExpr | variables.rs:80:1:86:1 | exit let_pattern4 (normal) | | +| variables.rs:81:5:84:6 | LetStmt | variables.rs:81:34:81:37 | PathExpr | | +| variables.rs:81:9:81:16 | TupleStructPat | variables.rs:83:9:83:15 | MacroExpr | no-match | +| variables.rs:81:9:81:16 | TupleStructPat | variables.rs:85:5:85:18 | ExprStmt | match | +| variables.rs:81:34:81:37 | PathExpr | variables.rs:81:39:81:42 | "x5" | | +| variables.rs:81:34:81:43 | CallExpr | variables.rs:81:9:81:16 | TupleStructPat | | +| variables.rs:81:39:81:42 | "x5" | variables.rs:81:34:81:43 | CallExpr | | +| variables.rs:83:9:83:15 | MacroExpr | variables.rs:81:50:84:5 | BlockExpr | | +| variables.rs:85:5:85:13 | PathExpr | variables.rs:85:15:85:16 | x5 | | +| variables.rs:85:5:85:17 | CallExpr | variables.rs:80:19:86:1 | BlockExpr | | +| variables.rs:85:5:85:18 | ExprStmt | variables.rs:85:5:85:13 | PathExpr | | +| variables.rs:85:15:85:16 | x5 | variables.rs:85:5:85:17 | CallExpr | | +| variables.rs:88:1:103:1 | enter match_pattern1 | variables.rs:89:5:89:21 | LetStmt | | +| variables.rs:88:1:103:1 | exit match_pattern1 (normal) | variables.rs:88:1:103:1 | exit match_pattern1 | | +| variables.rs:88:21:103:1 | BlockExpr | variables.rs:88:1:103:1 | exit match_pattern1 (normal) | | +| variables.rs:89:5:89:21 | LetStmt | variables.rs:89:14:89:17 | PathExpr | | +| variables.rs:89:9:89:10 | x6 | variables.rs:90:5:90:16 | LetStmt | match, no-match | +| variables.rs:89:14:89:17 | PathExpr | variables.rs:89:19:89:19 | 5 | | +| variables.rs:89:14:89:20 | CallExpr | variables.rs:89:9:89:10 | x6 | | +| variables.rs:89:19:89:19 | 5 | variables.rs:89:14:89:20 | CallExpr | | +| variables.rs:90:5:90:16 | LetStmt | variables.rs:90:14:90:15 | 10 | | +| variables.rs:90:9:90:10 | y1 | variables.rs:92:5:100:5 | ExprStmt | match, no-match | +| variables.rs:90:14:90:15 | 10 | variables.rs:90:9:90:10 | y1 | | +| variables.rs:92:5:100:5 | ExprStmt | variables.rs:92:11:92:12 | x6 | | +| variables.rs:92:5:100:5 | MatchExpr | variables.rs:102:5:102:18 | ExprStmt | | +| variables.rs:92:11:92:12 | x6 | variables.rs:93:9:93:16 | TupleStructPat | | +| variables.rs:93:9:93:16 | TupleStructPat | variables.rs:93:21:93:29 | PathExpr | match | +| variables.rs:93:9:93:16 | TupleStructPat | variables.rs:94:9:94:16 | TupleStructPat | no-match | +| variables.rs:93:21:93:29 | PathExpr | variables.rs:93:31:93:38 | "Got 50" | | +| variables.rs:93:21:93:39 | CallExpr | variables.rs:92:5:100:5 | MatchExpr | | +| variables.rs:93:31:93:38 | "Got 50" | variables.rs:93:21:93:39 | CallExpr | | +| variables.rs:94:9:94:16 | TupleStructPat | variables.rs:97:13:97:21 | PathExpr | match | +| variables.rs:94:9:94:16 | TupleStructPat | variables.rs:99:9:99:12 | None | no-match | +| variables.rs:96:9:98:9 | BlockExpr | variables.rs:92:5:100:5 | MatchExpr | | +| variables.rs:97:13:97:21 | PathExpr | variables.rs:97:23:97:24 | y1 | | +| variables.rs:97:13:97:25 | CallExpr | variables.rs:96:9:98:9 | BlockExpr | | +| variables.rs:97:23:97:24 | y1 | variables.rs:97:13:97:25 | CallExpr | | +| variables.rs:99:9:99:12 | None | variables.rs:99:17:99:25 | PathExpr | match | +| variables.rs:99:17:99:25 | PathExpr | variables.rs:99:27:99:32 | "NONE" | | +| variables.rs:99:17:99:33 | CallExpr | variables.rs:92:5:100:5 | MatchExpr | | +| variables.rs:99:27:99:32 | "NONE" | variables.rs:99:17:99:33 | CallExpr | | +| variables.rs:102:5:102:13 | PathExpr | variables.rs:102:15:102:16 | y1 | | +| variables.rs:102:5:102:17 | CallExpr | variables.rs:88:21:103:1 | BlockExpr | | +| variables.rs:102:5:102:18 | ExprStmt | variables.rs:102:5:102:13 | PathExpr | | +| variables.rs:102:15:102:16 | y1 | variables.rs:102:5:102:17 | CallExpr | | +| variables.rs:105:1:130:1 | enter match_pattern2 | variables.rs:106:5:106:36 | LetStmt | | +| variables.rs:105:1:130:1 | exit match_pattern2 (normal) | variables.rs:105:1:130:1 | exit match_pattern2 | | +| variables.rs:105:21:130:1 | BlockExpr | variables.rs:105:1:130:1 | exit match_pattern2 (normal) | | +| variables.rs:106:5:106:36 | LetStmt | variables.rs:106:20:106:20 | 2 | | +| variables.rs:106:9:106:15 | numbers | variables.rs:108:5:118:5 | ExprStmt | match, no-match | +| variables.rs:106:19:106:35 | TupleExpr | variables.rs:106:9:106:15 | numbers | | +| variables.rs:106:20:106:20 | 2 | variables.rs:106:23:106:23 | 4 | | +| variables.rs:106:23:106:23 | 4 | variables.rs:106:26:106:26 | 8 | | +| variables.rs:106:26:106:26 | 8 | variables.rs:106:29:106:30 | 16 | | +| variables.rs:106:29:106:30 | 16 | variables.rs:106:33:106:34 | 32 | | +| variables.rs:106:33:106:34 | 32 | variables.rs:106:19:106:35 | TupleExpr | | +| variables.rs:108:5:118:5 | ExprStmt | variables.rs:108:11:108:17 | numbers | | +| variables.rs:108:5:118:5 | MatchExpr | variables.rs:120:11:120:17 | numbers | | +| variables.rs:108:11:108:17 | numbers | variables.rs:109:9:113:9 | TuplePat | | +| variables.rs:109:9:113:9 | TuplePat | variables.rs:114:13:114:29 | ExprStmt | match | +| variables.rs:113:14:117:9 | BlockExpr | variables.rs:108:5:118:5 | MatchExpr | | +| variables.rs:114:13:114:21 | PathExpr | variables.rs:114:23:114:27 | first | | +| variables.rs:114:13:114:28 | CallExpr | variables.rs:115:13:115:29 | ExprStmt | | +| variables.rs:114:13:114:29 | ExprStmt | variables.rs:114:13:114:21 | PathExpr | | +| variables.rs:114:23:114:27 | first | variables.rs:114:13:114:28 | CallExpr | | +| variables.rs:115:13:115:21 | PathExpr | variables.rs:115:23:115:27 | third | | +| variables.rs:115:13:115:28 | CallExpr | variables.rs:116:13:116:29 | ExprStmt | | +| variables.rs:115:13:115:29 | ExprStmt | variables.rs:115:13:115:21 | PathExpr | | +| variables.rs:115:23:115:27 | third | variables.rs:115:13:115:28 | CallExpr | | +| variables.rs:116:13:116:21 | PathExpr | variables.rs:116:23:116:27 | fifth | | +| variables.rs:116:13:116:28 | CallExpr | variables.rs:113:14:117:9 | BlockExpr | | +| variables.rs:116:13:116:29 | ExprStmt | variables.rs:116:13:116:21 | PathExpr | | +| variables.rs:116:23:116:27 | fifth | variables.rs:116:13:116:28 | CallExpr | | +| variables.rs:120:5:129:5 | MatchExpr | variables.rs:105:21:130:1 | BlockExpr | | +| variables.rs:120:11:120:17 | numbers | variables.rs:121:9:125:9 | TuplePat | | +| variables.rs:121:9:125:9 | TuplePat | variables.rs:126:13:126:29 | ExprStmt | match | +| variables.rs:125:14:128:9 | BlockExpr | variables.rs:120:5:129:5 | MatchExpr | | +| variables.rs:126:13:126:21 | PathExpr | variables.rs:126:23:126:27 | first | | +| variables.rs:126:13:126:28 | CallExpr | variables.rs:127:13:127:28 | ExprStmt | | +| variables.rs:126:13:126:29 | ExprStmt | variables.rs:126:13:126:21 | PathExpr | | +| variables.rs:126:23:126:27 | first | variables.rs:126:13:126:28 | CallExpr | | +| variables.rs:127:13:127:21 | PathExpr | variables.rs:127:23:127:26 | last | | +| variables.rs:127:13:127:27 | CallExpr | variables.rs:125:14:128:9 | BlockExpr | | +| variables.rs:127:13:127:28 | ExprStmt | variables.rs:127:13:127:21 | PathExpr | | +| variables.rs:127:23:127:26 | last | variables.rs:127:13:127:27 | CallExpr | | +| variables.rs:132:1:140:1 | enter match_pattern3 | variables.rs:133:5:133:38 | LetStmt | | +| variables.rs:132:1:140:1 | exit match_pattern3 (normal) | variables.rs:132:1:140:1 | exit match_pattern3 | | +| variables.rs:132:21:140:1 | BlockExpr | variables.rs:132:1:140:1 | exit match_pattern3 (normal) | | +| variables.rs:133:5:133:38 | LetStmt | variables.rs:133:25:133:27 | "x" | | +| variables.rs:133:9:133:10 | p2 | variables.rs:135:11:135:12 | p2 | match, no-match | +| variables.rs:133:14:133:37 | RecordExpr | variables.rs:133:9:133:10 | p2 | | +| variables.rs:133:25:133:27 | "x" | variables.rs:133:33:133:35 | "y" | | +| variables.rs:133:33:133:35 | "y" | variables.rs:133:14:133:37 | RecordExpr | | +| variables.rs:135:5:139:5 | MatchExpr | variables.rs:132:21:140:1 | BlockExpr | | +| variables.rs:135:11:135:12 | p2 | variables.rs:136:9:138:9 | RecordPat | | +| variables.rs:136:9:138:9 | RecordPat | variables.rs:138:14:138:22 | PathExpr | match | +| variables.rs:138:14:138:22 | PathExpr | variables.rs:138:24:138:25 | x7 | | +| variables.rs:138:14:138:26 | CallExpr | variables.rs:135:5:139:5 | MatchExpr | | +| variables.rs:138:24:138:25 | x7 | variables.rs:138:14:138:26 | CallExpr | | +| variables.rs:146:1:159:1 | enter match_pattern4 | variables.rs:147:5:147:39 | LetStmt | | +| variables.rs:146:1:159:1 | exit match_pattern4 (normal) | variables.rs:146:1:159:1 | exit match_pattern4 | | +| variables.rs:146:21:159:1 | BlockExpr | variables.rs:146:1:159:1 | exit match_pattern4 (normal) | | +| variables.rs:147:5:147:39 | LetStmt | variables.rs:147:36:147:36 | 0 | | +| variables.rs:147:9:147:11 | msg | variables.rs:149:11:149:13 | msg | match, no-match | +| variables.rs:147:15:147:38 | RecordExpr | variables.rs:147:9:147:11 | msg | | +| variables.rs:147:36:147:36 | 0 | variables.rs:147:15:147:38 | RecordExpr | | +| variables.rs:149:5:158:5 | MatchExpr | variables.rs:146:21:159:1 | BlockExpr | | +| variables.rs:149:11:149:13 | msg | variables.rs:150:9:152:9 | RecordPat | | +| variables.rs:150:9:152:9 | RecordPat | variables.rs:152:14:152:22 | PathExpr | match | +| variables.rs:150:9:152:9 | RecordPat | variables.rs:153:9:153:38 | RecordPat | no-match | +| variables.rs:152:14:152:22 | PathExpr | variables.rs:152:24:152:34 | id_variable | | +| variables.rs:152:14:152:35 | CallExpr | variables.rs:149:5:158:5 | MatchExpr | | +| variables.rs:152:24:152:34 | id_variable | variables.rs:152:14:152:35 | CallExpr | | +| variables.rs:153:9:153:38 | RecordPat | variables.rs:154:13:154:52 | MacroExpr | match | +| variables.rs:153:9:153:38 | RecordPat | variables.rs:156:9:156:29 | RecordPat | no-match | +| variables.rs:153:43:155:9 | BlockExpr | variables.rs:149:5:158:5 | MatchExpr | | +| variables.rs:154:13:154:52 | MacroExpr | variables.rs:153:43:155:9 | BlockExpr | | +| variables.rs:156:9:156:29 | RecordPat | variables.rs:157:13:157:21 | PathExpr | match | +| variables.rs:157:13:157:21 | PathExpr | variables.rs:157:23:157:24 | id | | +| variables.rs:157:13:157:25 | CallExpr | variables.rs:149:5:158:5 | MatchExpr | | +| variables.rs:157:23:157:24 | id | variables.rs:157:13:157:25 | CallExpr | | +| variables.rs:166:1:172:1 | enter match_pattern5 | variables.rs:167:5:167:34 | LetStmt | | +| variables.rs:166:1:172:1 | exit match_pattern5 (normal) | variables.rs:166:1:172:1 | exit match_pattern5 | | +| variables.rs:166:21:172:1 | BlockExpr | variables.rs:166:1:172:1 | exit match_pattern5 (normal) | | +| variables.rs:167:5:167:34 | LetStmt | variables.rs:167:18:167:29 | PathExpr | | +| variables.rs:167:9:167:14 | either | variables.rs:168:11:168:16 | either | match, no-match | +| variables.rs:167:18:167:29 | PathExpr | variables.rs:167:31:167:32 | 32 | | +| variables.rs:167:18:167:33 | CallExpr | variables.rs:167:9:167:14 | either | | +| variables.rs:167:31:167:32 | 32 | variables.rs:167:18:167:33 | CallExpr | | +| variables.rs:168:5:171:5 | MatchExpr | variables.rs:166:21:172:1 | BlockExpr | | +| variables.rs:168:11:168:16 | either | variables.rs:169:9:169:44 | OrPat | | +| variables.rs:169:9:169:44 | OrPat | variables.rs:170:16:170:24 | PathExpr | match | +| variables.rs:170:16:170:24 | PathExpr | variables.rs:170:26:170:27 | a3 | | +| variables.rs:170:16:170:28 | CallExpr | variables.rs:168:5:171:5 | MatchExpr | | +| variables.rs:170:26:170:27 | a3 | variables.rs:170:16:170:28 | CallExpr | | +| variables.rs:180:1:194:1 | enter match_pattern6 | variables.rs:181:5:181:37 | LetStmt | | +| variables.rs:180:1:194:1 | exit match_pattern6 (normal) | variables.rs:180:1:194:1 | exit match_pattern6 | | +| variables.rs:180:21:194:1 | BlockExpr | variables.rs:180:1:194:1 | exit match_pattern6 (normal) | | +| variables.rs:181:5:181:37 | LetStmt | variables.rs:181:14:181:32 | PathExpr | | +| variables.rs:181:9:181:10 | tv | variables.rs:182:5:185:5 | ExprStmt | match, no-match | +| variables.rs:181:14:181:32 | PathExpr | variables.rs:181:34:181:35 | 62 | | +| variables.rs:181:14:181:36 | CallExpr | variables.rs:181:9:181:10 | tv | | +| variables.rs:181:34:181:35 | 62 | variables.rs:181:14:181:36 | CallExpr | | +| variables.rs:182:5:185:5 | ExprStmt | variables.rs:182:11:182:12 | tv | | +| variables.rs:182:5:185:5 | MatchExpr | variables.rs:186:5:189:5 | ExprStmt | | +| variables.rs:182:11:182:12 | tv | variables.rs:183:9:183:81 | OrPat | | +| variables.rs:183:9:183:81 | OrPat | variables.rs:184:16:184:24 | PathExpr | match | +| variables.rs:184:16:184:24 | PathExpr | variables.rs:184:26:184:27 | a4 | | +| variables.rs:184:16:184:28 | CallExpr | variables.rs:182:5:185:5 | MatchExpr | | +| variables.rs:184:26:184:27 | a4 | variables.rs:184:16:184:28 | CallExpr | | +| variables.rs:186:5:189:5 | ExprStmt | variables.rs:186:11:186:12 | tv | | +| variables.rs:186:5:189:5 | MatchExpr | variables.rs:190:11:190:12 | tv | | +| variables.rs:186:11:186:12 | tv | variables.rs:187:9:187:83 | OrPat | | +| variables.rs:187:9:187:83 | OrPat | variables.rs:188:16:188:24 | PathExpr | match | +| variables.rs:188:16:188:24 | PathExpr | variables.rs:188:26:188:27 | a5 | | +| variables.rs:188:16:188:28 | CallExpr | variables.rs:186:5:189:5 | MatchExpr | | +| variables.rs:188:26:188:27 | a5 | variables.rs:188:16:188:28 | CallExpr | | +| variables.rs:190:5:193:5 | MatchExpr | variables.rs:180:21:194:1 | BlockExpr | | +| variables.rs:190:11:190:12 | tv | variables.rs:191:9:191:83 | OrPat | | +| variables.rs:191:9:191:83 | OrPat | variables.rs:192:16:192:24 | PathExpr | match | +| variables.rs:192:16:192:24 | PathExpr | variables.rs:192:26:192:27 | a6 | | +| variables.rs:192:16:192:28 | CallExpr | variables.rs:190:5:193:5 | MatchExpr | | +| variables.rs:192:26:192:27 | a6 | variables.rs:192:16:192:28 | CallExpr | | +| variables.rs:196:1:204:1 | enter match_pattern7 | variables.rs:197:5:197:34 | LetStmt | | +| variables.rs:196:1:204:1 | exit match_pattern7 (normal) | variables.rs:196:1:204:1 | exit match_pattern7 | | +| variables.rs:196:21:204:1 | BlockExpr | variables.rs:196:1:204:1 | exit match_pattern7 (normal) | | +| variables.rs:197:5:197:34 | LetStmt | variables.rs:197:18:197:29 | PathExpr | | +| variables.rs:197:9:197:14 | either | variables.rs:198:11:198:16 | either | match, no-match | +| variables.rs:197:18:197:29 | PathExpr | variables.rs:197:31:197:32 | 32 | | +| variables.rs:197:18:197:33 | CallExpr | variables.rs:197:9:197:14 | either | | +| variables.rs:197:31:197:32 | 32 | variables.rs:197:18:197:33 | CallExpr | | +| variables.rs:198:5:203:5 | MatchExpr | variables.rs:196:21:204:1 | BlockExpr | | +| variables.rs:198:11:198:16 | either | variables.rs:199:9:199:44 | OrPat | | +| variables.rs:199:9:199:44 | OrPat | variables.rs:200:16:200:17 | a7 | match | +| variables.rs:199:9:199:44 | OrPat | variables.rs:202:9:202:9 | WildcardPat | no-match | +| variables.rs:200:16:200:17 | a7 | variables.rs:200:21:200:21 | 0 | | +| variables.rs:200:16:200:21 | ... > ... | variables.rs:201:16:201:24 | PathExpr | true | +| variables.rs:200:16:200:21 | ... > ... | variables.rs:202:9:202:9 | WildcardPat | false | +| variables.rs:200:21:200:21 | 0 | variables.rs:200:16:200:21 | ... > ... | | +| variables.rs:201:16:201:24 | PathExpr | variables.rs:201:26:201:27 | a7 | | +| variables.rs:201:16:201:28 | CallExpr | variables.rs:198:5:203:5 | MatchExpr | | +| variables.rs:201:26:201:27 | a7 | variables.rs:201:16:201:28 | CallExpr | | +| variables.rs:202:9:202:9 | WildcardPat | variables.rs:202:14:202:15 | TupleExpr | match | +| variables.rs:202:14:202:15 | TupleExpr | variables.rs:198:5:203:5 | MatchExpr | | +| variables.rs:206:1:221:1 | enter match_pattern8 | variables.rs:207:5:207:34 | LetStmt | | +| variables.rs:206:1:221:1 | exit match_pattern8 (normal) | variables.rs:206:1:221:1 | exit match_pattern8 | | +| variables.rs:206:21:221:1 | BlockExpr | variables.rs:206:1:221:1 | exit match_pattern8 (normal) | | +| variables.rs:207:5:207:34 | LetStmt | variables.rs:207:18:207:29 | PathExpr | | +| variables.rs:207:9:207:14 | either | variables.rs:209:11:209:16 | either | match, no-match | +| variables.rs:207:18:207:29 | PathExpr | variables.rs:207:31:207:32 | 32 | | +| variables.rs:207:18:207:33 | CallExpr | variables.rs:207:9:207:14 | either | | +| variables.rs:207:31:207:32 | 32 | variables.rs:207:18:207:33 | CallExpr | | +| variables.rs:209:5:220:5 | MatchExpr | variables.rs:206:21:221:1 | BlockExpr | | +| variables.rs:209:11:209:16 | either | variables.rs:210:9:211:52 | e | | +| variables.rs:210:9:211:52 | e | variables.rs:213:13:213:27 | ExprStmt | match | +| variables.rs:210:9:211:52 | e | variables.rs:219:9:219:9 | WildcardPat | no-match | +| variables.rs:212:12:218:9 | BlockExpr | variables.rs:209:5:220:5 | MatchExpr | | +| variables.rs:213:13:213:21 | PathExpr | variables.rs:213:23:213:25 | a11 | | +| variables.rs:213:13:213:26 | CallExpr | variables.rs:214:16:215:15 | LetExpr | | +| variables.rs:213:13:213:27 | ExprStmt | variables.rs:213:13:213:21 | PathExpr | | +| variables.rs:213:23:213:25 | a11 | variables.rs:213:13:213:26 | CallExpr | | +| variables.rs:214:13:217:13 | IfExpr | variables.rs:212:12:218:9 | BlockExpr | | +| variables.rs:214:16:215:15 | LetExpr | variables.rs:214:20:214:36 | TupleStructPat | | +| variables.rs:214:20:214:36 | TupleStructPat | variables.rs:214:13:217:13 | IfExpr | no-match | +| variables.rs:214:20:214:36 | TupleStructPat | variables.rs:216:17:216:32 | ExprStmt | match | +| variables.rs:215:17:217:13 | BlockExpr | variables.rs:214:13:217:13 | IfExpr | | +| variables.rs:216:17:216:25 | PathExpr | variables.rs:216:28:216:30 | a12 | | +| variables.rs:216:17:216:31 | CallExpr | variables.rs:215:17:217:13 | BlockExpr | | +| variables.rs:216:17:216:32 | ExprStmt | variables.rs:216:17:216:25 | PathExpr | | +| variables.rs:216:27:216:30 | * ... | variables.rs:216:17:216:31 | CallExpr | | +| variables.rs:216:28:216:30 | a12 | variables.rs:216:27:216:30 | * ... | | +| variables.rs:219:9:219:9 | WildcardPat | variables.rs:219:14:219:15 | TupleExpr | match | +| variables.rs:219:14:219:15 | TupleExpr | variables.rs:209:5:220:5 | MatchExpr | | +| variables.rs:230:1:236:1 | enter match_pattern9 | variables.rs:231:5:231:36 | LetStmt | | +| variables.rs:230:1:236:1 | exit match_pattern9 (normal) | variables.rs:230:1:236:1 | exit match_pattern9 | | +| variables.rs:230:21:236:1 | BlockExpr | variables.rs:230:1:236:1 | exit match_pattern9 (normal) | | +| variables.rs:231:5:231:36 | LetStmt | variables.rs:231:14:231:31 | PathExpr | | +| variables.rs:231:9:231:10 | fv | variables.rs:232:11:232:12 | fv | match, no-match | +| variables.rs:231:14:231:31 | PathExpr | variables.rs:231:33:231:34 | 62 | | +| variables.rs:231:14:231:35 | CallExpr | variables.rs:231:9:231:10 | fv | | +| variables.rs:231:33:231:34 | 62 | variables.rs:231:14:231:35 | CallExpr | | +| variables.rs:232:5:235:5 | MatchExpr | variables.rs:230:21:236:1 | BlockExpr | | +| variables.rs:232:11:232:12 | fv | variables.rs:233:9:233:109 | OrPat | | +| variables.rs:233:9:233:109 | OrPat | variables.rs:234:16:234:24 | PathExpr | match | +| variables.rs:234:16:234:24 | PathExpr | variables.rs:234:26:234:28 | a13 | | +| variables.rs:234:16:234:29 | CallExpr | variables.rs:232:5:235:5 | MatchExpr | | +| variables.rs:234:26:234:28 | a13 | variables.rs:234:16:234:29 | CallExpr | | +| variables.rs:238:1:247:1 | enter param_pattern1 | variables.rs:244:5:244:18 | ExprStmt | | +| variables.rs:238:1:247:1 | exit param_pattern1 (normal) | variables.rs:238:1:247:1 | exit param_pattern1 | | +| variables.rs:243:28:247:1 | BlockExpr | variables.rs:238:1:247:1 | exit param_pattern1 (normal) | | +| variables.rs:244:5:244:13 | PathExpr | variables.rs:244:15:244:16 | a8 | | +| variables.rs:244:5:244:17 | CallExpr | variables.rs:245:5:245:18 | ExprStmt | | +| variables.rs:244:5:244:18 | ExprStmt | variables.rs:244:5:244:13 | PathExpr | | +| variables.rs:244:15:244:16 | a8 | variables.rs:244:5:244:17 | CallExpr | | +| variables.rs:245:5:245:13 | PathExpr | variables.rs:245:15:245:16 | b3 | | +| variables.rs:245:5:245:17 | CallExpr | variables.rs:246:5:246:18 | ExprStmt | | +| variables.rs:245:5:245:18 | ExprStmt | variables.rs:245:5:245:13 | PathExpr | | +| variables.rs:245:15:245:16 | b3 | variables.rs:245:5:245:17 | CallExpr | | +| variables.rs:246:5:246:13 | PathExpr | variables.rs:246:15:246:16 | c1 | | +| variables.rs:246:5:246:17 | CallExpr | variables.rs:243:28:247:1 | BlockExpr | | +| variables.rs:246:5:246:18 | ExprStmt | variables.rs:246:5:246:13 | PathExpr | | +| variables.rs:246:15:246:16 | c1 | variables.rs:246:5:246:17 | CallExpr | | +| variables.rs:249:1:253:1 | enter param_pattern2 | variables.rs:252:5:252:18 | ExprStmt | | +| variables.rs:249:1:253:1 | exit param_pattern2 (normal) | variables.rs:249:1:253:1 | exit param_pattern2 | | +| variables.rs:251:9:253:1 | BlockExpr | variables.rs:249:1:253:1 | exit param_pattern2 (normal) | | +| variables.rs:252:5:252:13 | PathExpr | variables.rs:252:15:252:16 | a9 | | +| variables.rs:252:5:252:17 | CallExpr | variables.rs:251:9:253:1 | BlockExpr | | +| variables.rs:252:5:252:18 | ExprStmt | variables.rs:252:5:252:13 | PathExpr | | +| variables.rs:252:15:252:16 | a9 | variables.rs:252:5:252:17 | CallExpr | | +| variables.rs:255:1:290:1 | enter destruct_assignment | variables.rs:256:5:260:18 | LetStmt | | +| variables.rs:255:1:290:1 | exit destruct_assignment (normal) | variables.rs:255:1:290:1 | exit destruct_assignment | | +| variables.rs:255:26:290:1 | BlockExpr | variables.rs:255:1:290:1 | exit destruct_assignment (normal) | | +| variables.rs:256:5:260:18 | LetStmt | variables.rs:260:10:260:10 | 1 | | +| variables.rs:256:9:260:5 | TuplePat | variables.rs:261:5:261:19 | ExprStmt | match | +| variables.rs:260:9:260:17 | TupleExpr | variables.rs:256:9:260:5 | TuplePat | | +| variables.rs:260:10:260:10 | 1 | variables.rs:260:13:260:13 | 2 | | +| variables.rs:260:13:260:13 | 2 | variables.rs:260:16:260:16 | 3 | | +| variables.rs:260:16:260:16 | 3 | variables.rs:260:9:260:17 | TupleExpr | | +| variables.rs:261:5:261:13 | PathExpr | variables.rs:261:15:261:17 | a10 | | +| variables.rs:261:5:261:18 | CallExpr | variables.rs:262:5:262:18 | ExprStmt | | +| variables.rs:261:5:261:19 | ExprStmt | variables.rs:261:5:261:13 | PathExpr | | +| variables.rs:261:15:261:17 | a10 | variables.rs:261:5:261:18 | CallExpr | | +| variables.rs:262:5:262:13 | PathExpr | variables.rs:262:15:262:16 | b4 | | +| variables.rs:262:5:262:17 | CallExpr | variables.rs:263:5:263:18 | ExprStmt | | +| variables.rs:262:5:262:18 | ExprStmt | variables.rs:262:5:262:13 | PathExpr | | +| variables.rs:262:15:262:16 | b4 | variables.rs:262:5:262:17 | CallExpr | | +| variables.rs:263:5:263:13 | PathExpr | variables.rs:263:15:263:16 | c2 | | +| variables.rs:263:5:263:17 | CallExpr | variables.rs:265:5:273:6 | ExprStmt | | +| variables.rs:263:5:263:18 | ExprStmt | variables.rs:263:5:263:13 | PathExpr | | +| variables.rs:263:15:263:16 | c2 | variables.rs:263:5:263:17 | CallExpr | | +| variables.rs:265:5:269:5 | TupleExpr | variables.rs:270:9:270:11 | a10 | | +| variables.rs:265:5:273:5 | ... = ... | variables.rs:274:5:274:19 | ExprStmt | | +| variables.rs:265:5:273:6 | ExprStmt | variables.rs:266:9:266:10 | c2 | | +| variables.rs:266:9:266:10 | c2 | variables.rs:267:9:267:10 | b4 | | +| variables.rs:267:9:267:10 | b4 | variables.rs:268:9:268:11 | a10 | | +| variables.rs:268:9:268:11 | a10 | variables.rs:265:5:269:5 | TupleExpr | | +| variables.rs:269:9:273:5 | TupleExpr | variables.rs:265:5:273:5 | ... = ... | | +| variables.rs:270:9:270:11 | a10 | variables.rs:271:9:271:10 | b4 | | +| variables.rs:271:9:271:10 | b4 | variables.rs:272:9:272:10 | c2 | | +| variables.rs:272:9:272:10 | c2 | variables.rs:269:9:273:5 | TupleExpr | | +| variables.rs:274:5:274:13 | PathExpr | variables.rs:274:15:274:17 | a10 | | +| variables.rs:274:5:274:18 | CallExpr | variables.rs:275:5:275:18 | ExprStmt | | +| variables.rs:274:5:274:19 | ExprStmt | variables.rs:274:5:274:13 | PathExpr | | +| variables.rs:274:15:274:17 | a10 | variables.rs:274:5:274:18 | CallExpr | | +| variables.rs:275:5:275:13 | PathExpr | variables.rs:275:15:275:16 | b4 | | +| variables.rs:275:5:275:17 | CallExpr | variables.rs:276:5:276:18 | ExprStmt | | +| variables.rs:275:5:275:18 | ExprStmt | variables.rs:275:5:275:13 | PathExpr | | +| variables.rs:275:15:275:16 | b4 | variables.rs:275:5:275:17 | CallExpr | | +| variables.rs:276:5:276:13 | PathExpr | variables.rs:276:15:276:16 | c2 | | +| variables.rs:276:5:276:17 | CallExpr | variables.rs:278:5:286:5 | ExprStmt | | +| variables.rs:276:5:276:18 | ExprStmt | variables.rs:276:5:276:13 | PathExpr | | +| variables.rs:276:15:276:16 | c2 | variables.rs:276:5:276:17 | CallExpr | | +| variables.rs:278:5:286:5 | ExprStmt | variables.rs:278:12:278:12 | 4 | | +| variables.rs:278:5:286:5 | MatchExpr | variables.rs:288:5:288:19 | ExprStmt | | +| variables.rs:278:11:278:16 | TupleExpr | variables.rs:279:9:282:9 | TuplePat | | +| variables.rs:278:12:278:12 | 4 | variables.rs:278:15:278:15 | 5 | | +| variables.rs:278:15:278:15 | 5 | variables.rs:278:11:278:16 | TupleExpr | | +| variables.rs:279:9:282:9 | TuplePat | variables.rs:283:13:283:27 | ExprStmt | match | +| variables.rs:282:14:285:9 | BlockExpr | variables.rs:278:5:286:5 | MatchExpr | | +| variables.rs:283:13:283:21 | PathExpr | variables.rs:283:23:283:25 | a10 | | +| variables.rs:283:13:283:26 | CallExpr | variables.rs:284:13:284:26 | ExprStmt | | +| variables.rs:283:13:283:27 | ExprStmt | variables.rs:283:13:283:21 | PathExpr | | +| variables.rs:283:23:283:25 | a10 | variables.rs:283:13:283:26 | CallExpr | | +| variables.rs:284:13:284:21 | PathExpr | variables.rs:284:23:284:24 | b4 | | +| variables.rs:284:13:284:25 | CallExpr | variables.rs:282:14:285:9 | BlockExpr | | +| variables.rs:284:13:284:26 | ExprStmt | variables.rs:284:13:284:21 | PathExpr | | +| variables.rs:284:23:284:24 | b4 | variables.rs:284:13:284:25 | CallExpr | | +| variables.rs:288:5:288:13 | PathExpr | variables.rs:288:15:288:17 | a10 | | +| variables.rs:288:5:288:18 | CallExpr | variables.rs:289:5:289:18 | ExprStmt | | +| variables.rs:288:5:288:19 | ExprStmt | variables.rs:288:5:288:13 | PathExpr | | +| variables.rs:288:15:288:17 | a10 | variables.rs:288:5:288:18 | CallExpr | | +| variables.rs:289:5:289:13 | PathExpr | variables.rs:289:15:289:16 | b4 | | +| variables.rs:289:5:289:17 | CallExpr | variables.rs:255:26:290:1 | BlockExpr | | +| variables.rs:289:5:289:18 | ExprStmt | variables.rs:289:5:289:13 | PathExpr | | +| variables.rs:289:15:289:16 | b4 | variables.rs:289:5:289:17 | CallExpr | | +| variables.rs:292:1:307:1 | enter closure_variable | variables.rs:293:5:295:10 | LetStmt | | +| variables.rs:292:1:307:1 | exit closure_variable (normal) | variables.rs:292:1:307:1 | exit closure_variable | | +| variables.rs:292:23:307:1 | BlockExpr | variables.rs:292:1:307:1 | exit closure_variable (normal) | | +| variables.rs:293:5:295:10 | LetStmt | variables.rs:294:9:295:9 | ClosureExpr | | +| variables.rs:293:9:293:23 | example_closure | variables.rs:296:5:297:27 | LetStmt | match, no-match | +| variables.rs:294:9:295:9 | ClosureExpr | variables.rs:293:9:293:23 | example_closure | | +| variables.rs:294:9:295:9 | enter ClosureExpr | variables.rs:295:9:295:9 | x | | +| variables.rs:294:9:295:9 | exit ClosureExpr (normal) | variables.rs:294:9:295:9 | exit ClosureExpr | | +| variables.rs:295:9:295:9 | x | variables.rs:294:9:295:9 | exit ClosureExpr (normal) | | +| variables.rs:296:5:297:27 | LetStmt | variables.rs:297:9:297:23 | example_closure | | +| variables.rs:296:9:296:10 | n1 | variables.rs:298:5:298:18 | ExprStmt | match, no-match | +| variables.rs:297:9:297:23 | example_closure | variables.rs:297:25:297:25 | 5 | | +| variables.rs:297:9:297:26 | CallExpr | variables.rs:296:9:296:10 | n1 | | +| variables.rs:297:25:297:25 | 5 | variables.rs:297:9:297:26 | CallExpr | | +| variables.rs:298:5:298:13 | PathExpr | variables.rs:298:15:298:16 | n1 | | +| variables.rs:298:5:298:17 | CallExpr | variables.rs:300:5:300:25 | ExprStmt | | +| variables.rs:298:5:298:18 | ExprStmt | variables.rs:298:5:298:13 | PathExpr | | +| variables.rs:298:15:298:16 | n1 | variables.rs:298:5:298:17 | CallExpr | | +| variables.rs:300:5:300:22 | PathExpr | variables.rs:300:5:300:24 | CallExpr | | +| variables.rs:300:5:300:24 | CallExpr | variables.rs:301:5:303:10 | LetStmt | | +| variables.rs:300:5:300:25 | ExprStmt | variables.rs:300:5:300:22 | PathExpr | | +| variables.rs:301:5:303:10 | LetStmt | variables.rs:302:9:303:9 | ClosureExpr | | +| variables.rs:301:9:301:26 | immutable_variable | variables.rs:304:5:305:30 | LetStmt | match, no-match | +| variables.rs:302:9:303:9 | ClosureExpr | variables.rs:301:9:301:26 | immutable_variable | | +| variables.rs:302:9:303:9 | enter ClosureExpr | variables.rs:303:9:303:9 | x | | +| variables.rs:302:9:303:9 | exit ClosureExpr (normal) | variables.rs:302:9:303:9 | exit ClosureExpr | | +| variables.rs:303:9:303:9 | x | variables.rs:302:9:303:9 | exit ClosureExpr (normal) | | +| variables.rs:304:5:305:30 | LetStmt | variables.rs:305:9:305:26 | immutable_variable | | +| variables.rs:304:9:304:10 | n2 | variables.rs:306:5:306:18 | ExprStmt | match, no-match | +| variables.rs:305:9:305:26 | immutable_variable | variables.rs:305:28:305:28 | 6 | | +| variables.rs:305:9:305:29 | CallExpr | variables.rs:304:9:304:10 | n2 | | +| variables.rs:305:28:305:28 | 6 | variables.rs:305:9:305:29 | CallExpr | | +| variables.rs:306:5:306:13 | PathExpr | variables.rs:306:15:306:16 | n2 | | +| variables.rs:306:5:306:17 | CallExpr | variables.rs:292:23:307:1 | BlockExpr | | +| variables.rs:306:5:306:18 | ExprStmt | variables.rs:306:5:306:13 | PathExpr | | +| variables.rs:306:15:306:16 | n2 | variables.rs:306:5:306:17 | CallExpr | | +| variables.rs:309:1:316:1 | enter for_variable | variables.rs:310:5:310:42 | LetStmt | | +| variables.rs:309:1:316:1 | exit for_variable (normal) | variables.rs:309:1:316:1 | exit for_variable | | +| variables.rs:309:19:316:1 | BlockExpr | variables.rs:309:1:316:1 | exit for_variable (normal) | | +| variables.rs:310:5:310:42 | LetStmt | variables.rs:310:15:310:22 | "apples" | | +| variables.rs:310:9:310:9 | v | variables.rs:313:12:313:12 | v | match, no-match | +| variables.rs:310:13:310:41 | RefExpr | variables.rs:310:9:310:9 | v | | +| variables.rs:310:14:310:41 | ArrayExpr | variables.rs:310:13:310:41 | RefExpr | | +| variables.rs:310:15:310:22 | "apples" | variables.rs:310:25:310:30 | "cake" | | +| variables.rs:310:25:310:30 | "cake" | variables.rs:310:33:310:40 | "coffee" | | +| variables.rs:310:33:310:40 | "coffee" | variables.rs:310:14:310:41 | ArrayExpr | | +| variables.rs:312:5:315:5 | ForExpr | variables.rs:309:19:316:1 | BlockExpr | | +| variables.rs:312:9:312:12 | text | variables.rs:312:5:315:5 | ForExpr | no-match | +| variables.rs:312:9:312:12 | text | variables.rs:314:9:314:24 | ExprStmt | match | +| variables.rs:313:12:313:12 | v | variables.rs:312:9:312:12 | text | | +| variables.rs:313:14:315:5 | BlockExpr | variables.rs:312:9:312:12 | text | | +| variables.rs:314:9:314:17 | PathExpr | variables.rs:314:19:314:22 | text | | +| variables.rs:314:9:314:23 | CallExpr | variables.rs:313:14:315:5 | BlockExpr | | +| variables.rs:314:9:314:24 | ExprStmt | variables.rs:314:9:314:17 | PathExpr | | +| variables.rs:314:19:314:22 | text | variables.rs:314:9:314:23 | CallExpr | | +| variables.rs:318:1:341:1 | enter main | variables.rs:319:5:319:25 | ExprStmt | | +| variables.rs:318:1:341:1 | exit main (normal) | variables.rs:318:1:341:1 | exit main | | +| variables.rs:318:11:341:1 | BlockExpr | variables.rs:318:1:341:1 | exit main (normal) | | +| variables.rs:319:5:319:22 | PathExpr | variables.rs:319:5:319:24 | CallExpr | | +| variables.rs:319:5:319:24 | CallExpr | variables.rs:320:5:320:23 | ExprStmt | | +| variables.rs:319:5:319:25 | ExprStmt | variables.rs:319:5:319:22 | PathExpr | | +| variables.rs:320:5:320:20 | PathExpr | variables.rs:320:5:320:22 | CallExpr | | +| variables.rs:320:5:320:22 | CallExpr | variables.rs:321:5:321:23 | ExprStmt | | +| variables.rs:320:5:320:23 | ExprStmt | variables.rs:320:5:320:20 | PathExpr | | +| variables.rs:321:5:321:20 | PathExpr | variables.rs:321:5:321:22 | CallExpr | | +| variables.rs:321:5:321:22 | CallExpr | variables.rs:322:5:322:23 | ExprStmt | | +| variables.rs:321:5:321:23 | ExprStmt | variables.rs:321:5:321:20 | PathExpr | | +| variables.rs:322:5:322:20 | PathExpr | variables.rs:322:5:322:22 | CallExpr | | +| variables.rs:322:5:322:22 | CallExpr | variables.rs:323:5:323:19 | ExprStmt | | +| variables.rs:322:5:322:23 | ExprStmt | variables.rs:322:5:322:20 | PathExpr | | +| variables.rs:323:5:323:16 | PathExpr | variables.rs:323:5:323:18 | CallExpr | | +| variables.rs:323:5:323:18 | CallExpr | variables.rs:324:5:324:19 | ExprStmt | | +| variables.rs:323:5:323:19 | ExprStmt | variables.rs:323:5:323:16 | PathExpr | | +| variables.rs:324:5:324:16 | PathExpr | variables.rs:324:5:324:18 | CallExpr | | +| variables.rs:324:5:324:18 | CallExpr | variables.rs:325:5:325:19 | ExprStmt | | +| variables.rs:324:5:324:19 | ExprStmt | variables.rs:324:5:324:16 | PathExpr | | +| variables.rs:325:5:325:16 | PathExpr | variables.rs:325:5:325:18 | CallExpr | | +| variables.rs:325:5:325:18 | CallExpr | variables.rs:326:5:326:19 | ExprStmt | | +| variables.rs:325:5:325:19 | ExprStmt | variables.rs:325:5:325:16 | PathExpr | | +| variables.rs:326:5:326:16 | PathExpr | variables.rs:326:5:326:18 | CallExpr | | +| variables.rs:326:5:326:18 | CallExpr | variables.rs:327:5:327:21 | ExprStmt | | +| variables.rs:326:5:326:19 | ExprStmt | variables.rs:326:5:326:16 | PathExpr | | +| variables.rs:327:5:327:18 | PathExpr | variables.rs:327:5:327:20 | CallExpr | | +| variables.rs:327:5:327:20 | CallExpr | variables.rs:328:5:328:21 | ExprStmt | | +| variables.rs:327:5:327:21 | ExprStmt | variables.rs:327:5:327:18 | PathExpr | | +| variables.rs:328:5:328:18 | PathExpr | variables.rs:328:5:328:20 | CallExpr | | +| variables.rs:328:5:328:20 | CallExpr | variables.rs:329:5:329:21 | ExprStmt | | +| variables.rs:328:5:328:21 | ExprStmt | variables.rs:328:5:328:18 | PathExpr | | +| variables.rs:329:5:329:18 | PathExpr | variables.rs:329:5:329:20 | CallExpr | | +| variables.rs:329:5:329:20 | CallExpr | variables.rs:330:5:330:21 | ExprStmt | | +| variables.rs:329:5:329:21 | ExprStmt | variables.rs:329:5:329:18 | PathExpr | | +| variables.rs:330:5:330:18 | PathExpr | variables.rs:330:5:330:20 | CallExpr | | +| variables.rs:330:5:330:20 | CallExpr | variables.rs:331:5:331:21 | ExprStmt | | +| variables.rs:330:5:330:21 | ExprStmt | variables.rs:330:5:330:18 | PathExpr | | +| variables.rs:331:5:331:18 | PathExpr | variables.rs:331:5:331:20 | CallExpr | | +| variables.rs:331:5:331:20 | CallExpr | variables.rs:332:5:332:21 | ExprStmt | | +| variables.rs:331:5:331:21 | ExprStmt | variables.rs:331:5:331:18 | PathExpr | | +| variables.rs:332:5:332:18 | PathExpr | variables.rs:332:5:332:20 | CallExpr | | +| variables.rs:332:5:332:20 | CallExpr | variables.rs:333:5:333:21 | ExprStmt | | +| variables.rs:332:5:332:21 | ExprStmt | variables.rs:332:5:332:18 | PathExpr | | +| variables.rs:333:5:333:18 | PathExpr | variables.rs:333:5:333:20 | CallExpr | | +| variables.rs:333:5:333:20 | CallExpr | variables.rs:334:5:334:21 | ExprStmt | | +| variables.rs:333:5:333:21 | ExprStmt | variables.rs:333:5:333:18 | PathExpr | | +| variables.rs:334:5:334:18 | PathExpr | variables.rs:334:5:334:20 | CallExpr | | +| variables.rs:334:5:334:20 | CallExpr | variables.rs:335:5:335:21 | ExprStmt | | +| variables.rs:334:5:334:21 | ExprStmt | variables.rs:334:5:334:18 | PathExpr | | +| variables.rs:335:5:335:18 | PathExpr | variables.rs:335:5:335:20 | CallExpr | | +| variables.rs:335:5:335:20 | CallExpr | variables.rs:336:5:336:36 | ExprStmt | | +| variables.rs:335:5:335:21 | ExprStmt | variables.rs:335:5:335:18 | PathExpr | | +| variables.rs:336:5:336:18 | PathExpr | variables.rs:336:20:336:22 | "a" | | +| variables.rs:336:5:336:35 | CallExpr | variables.rs:337:5:337:37 | ExprStmt | | +| variables.rs:336:5:336:36 | ExprStmt | variables.rs:336:5:336:18 | PathExpr | | +| variables.rs:336:20:336:22 | "a" | variables.rs:336:26:336:28 | "b" | | +| variables.rs:336:25:336:34 | TupleExpr | variables.rs:336:5:336:35 | CallExpr | | +| variables.rs:336:26:336:28 | "b" | variables.rs:336:31:336:33 | "c" | | +| variables.rs:336:31:336:33 | "c" | variables.rs:336:25:336:34 | TupleExpr | | +| variables.rs:337:5:337:18 | PathExpr | variables.rs:337:20:337:31 | PathExpr | | +| variables.rs:337:5:337:36 | CallExpr | variables.rs:338:5:338:26 | ExprStmt | | +| variables.rs:337:5:337:37 | ExprStmt | variables.rs:337:5:337:18 | PathExpr | | +| variables.rs:337:20:337:31 | PathExpr | variables.rs:337:33:337:34 | 45 | | +| variables.rs:337:20:337:35 | CallExpr | variables.rs:337:5:337:36 | CallExpr | | +| variables.rs:337:33:337:34 | 45 | variables.rs:337:20:337:35 | CallExpr | | +| variables.rs:338:5:338:23 | PathExpr | variables.rs:338:5:338:25 | CallExpr | | +| variables.rs:338:5:338:25 | CallExpr | variables.rs:339:5:339:23 | ExprStmt | | +| variables.rs:338:5:338:26 | ExprStmt | variables.rs:338:5:338:23 | PathExpr | | +| variables.rs:339:5:339:20 | PathExpr | variables.rs:339:5:339:22 | CallExpr | | +| variables.rs:339:5:339:22 | CallExpr | variables.rs:340:5:340:19 | ExprStmt | | +| variables.rs:339:5:339:23 | ExprStmt | variables.rs:339:5:339:20 | PathExpr | | +| variables.rs:340:5:340:16 | PathExpr | variables.rs:340:5:340:18 | CallExpr | | +| variables.rs:340:5:340:18 | CallExpr | variables.rs:318:11:341:1 | BlockExpr | | +| variables.rs:340:5:340:19 | ExprStmt | variables.rs:340:5:340:16 | PathExpr | | diff --git a/rust/ql/test/library-tests/variables/Cfg.qlref b/rust/ql/test/library-tests/variables/Cfg.qlref new file mode 100644 index 000000000000..ba4ee4b414f1 --- /dev/null +++ b/rust/ql/test/library-tests/variables/Cfg.qlref @@ -0,0 +1 @@ +query: utils/Cfg.ql \ No newline at end of file diff --git a/rust/ql/test/utils/Cfg.expected b/rust/ql/test/utils/Cfg.expected new file mode 100644 index 000000000000..f19a576c93ac --- /dev/null +++ b/rust/ql/test/utils/Cfg.expected @@ -0,0 +1,3 @@ +edges +breakTarget +continueTarget diff --git a/rust/ql/test/library-tests/controlflow/Cfg.ql b/rust/ql/test/utils/Cfg.ql similarity index 100% rename from rust/ql/test/library-tests/controlflow/Cfg.ql rename to rust/ql/test/utils/Cfg.ql From 1266f9757d3ff448a57cac1bbefd4a64292b6c3e Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Wed, 2 Oct 2024 14:50:52 +0200 Subject: [PATCH 50/79] Rust: Add `{BreakExpr,ContinueExpr}.getTarget()` --- rust/ql/.generated.list | 2 - rust/ql/.gitattributes | 2 - .../internal/ControlFlowGraphImpl.qll | 103 ++++++------------ .../rust/elements/internal/BreakExprImpl.qll | 69 +++++++++++- .../elements/internal/ContinueExprImpl.qll | 36 +++++- .../library-tests/controlflow/Cfg.expected | 23 ++++ .../test/library-tests/variables/Cfg.expected | 3 + rust/ql/test/utils/Cfg.ql | 4 + 8 files changed, 166 insertions(+), 76 deletions(-) diff --git a/rust/ql/.generated.list b/rust/ql/.generated.list index 18337b8a6d78..e37f6947148d 100644 --- a/rust/ql/.generated.list +++ b/rust/ql/.generated.list @@ -183,7 +183,6 @@ lib/codeql/rust/elements/internal/BlockExprImpl.qll 36ac09e4a6eeeec22919b62b1d00 lib/codeql/rust/elements/internal/BoxPatConstructor.qll 153f110ba25fd6c889092bfd16f73bb610fa60d6e0c8965d5f44d2446fcd48a2 9324cf0d8aa29945551bf8ab64801d598f57aab8cd4e19bcd4e9ef8a4a4e06eb lib/codeql/rust/elements/internal/BoxPatImpl.qll d62a3cc1d5bab6bd258f702ec731ec57f0e5ef2672ab9de4b6f3b558078629eb 26b4fabb676adbbdb0d7f81449e493ee49380ea04d131f779714ac2434bb323a lib/codeql/rust/elements/internal/BreakExprConstructor.qll 356be043c28e0b34fdf925a119c945632ee883c6f5ebb9a27003c6a8d250afd9 bb77e66b04bb9489340e7506931559b94285c6904b6f9d2f83b214cba4f3cfd5 -lib/codeql/rust/elements/internal/BreakExprImpl.qll 883ac0e2c0856c91f50747cf10cbcb3ecab535f6858913f2fa34236db8d211d6 5b20db08f16ea5ea3554ffbf6a2a69107e1ec8e3f31dd3935f8839b9a498f4bb lib/codeql/rust/elements/internal/CallExprConstructor.qll 742b38e862e2cf82fd1ecc4d4fc5b4782a9c7c07f031452b2bae7aa59d5aa13a cad6e0a8be21d91b20ac2ec16cab9c30eae810b452c0f1992ed87d5c7f4144dc lib/codeql/rust/elements/internal/CallExprImpl.qll 7e48610680ba6f2876a1a005ab0743496dd2364b9c44aca441bd33e11317e2d7 bb12c3c28156b40796fe3ba112760f87bb5abb323aab3c5b7bb3e0facaef8d35 lib/codeql/rust/elements/internal/CastExprConstructor.qll f3d6e10c4731f38a384675aeab3fba47d17b9e15648293787092bb3247ed808d d738a7751dbadb70aa1dcffcf8af7fa61d4cf8029798369a7e8620013afff4ed @@ -202,7 +201,6 @@ lib/codeql/rust/elements/internal/ConstImpl.qll 7aac2b441a41f21b7d788e3eb042554f lib/codeql/rust/elements/internal/ConstParamConstructor.qll f6645f952aac87c7e00e5e9661275312a1df47172088b4de6b5a253d5c4ed048 eda737470a7b89cf6a02715c9147d074041d6d00fd50d5b2d70266add6e4b571 lib/codeql/rust/elements/internal/ConstParamImpl.qll 909d85d857dfb973cd8e148744d3a88506d113d193d35ab0243be745d004ad45 c9e18170c5b4e4d5fca9f175bb139a248055b608ceafdd90c7182d06d67c3cba lib/codeql/rust/elements/internal/ContinueExprConstructor.qll cd93f1b35ccdb031d7e8deba92f6a76187f6009c454f3ea07e89ba459de57ca6 6f658e7d580c4c9068b01d6dd6f72888b8800860668a6653f8c3b27dc9996935 -lib/codeql/rust/elements/internal/ContinueExprImpl.qll 976890d17681315d2297b600a58c655ccc7c4db44cf587d7b5c359303f309acf 1ecae04df07ee20dcea4f00a9af33c108a0e15ed2ccf8b936804ad88ed66f883 lib/codeql/rust/elements/internal/DynTraitTypeConstructor.qll 2bfd81fdf116b76f4a62b47bed5f0a730c04ce79747ecd1d3b683b8de22ff4aa 375c57350c432351396b92f28fded1e95a8002e3a1b31f3b66039f9b3d9bdea9 lib/codeql/rust/elements/internal/DynTraitTypeImpl.qll 8ccf27db0b898f518874ae094e5c97206384ad2fd3f82f81a5ecaad953278f71 e28ab56b8814a804e23afa790ca0f9a2665195b0b316d6cc52936e76ce5c0011 lib/codeql/rust/elements/internal/EnumConstructor.qll eca1a13937faacb1db50e4cf69d175f992f2204a5aaed9144bb6f3cb63814ac5 1bafba78b2729fdb052a25a1ba3f4f70871564aa4df632b4a1d467858a437924 diff --git a/rust/ql/.gitattributes b/rust/ql/.gitattributes index 8e15852654c4..e69d7ea5791b 100644 --- a/rust/ql/.gitattributes +++ b/rust/ql/.gitattributes @@ -185,7 +185,6 @@ /lib/codeql/rust/elements/internal/BoxPatConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/BoxPatImpl.qll linguist-generated /lib/codeql/rust/elements/internal/BreakExprConstructor.qll linguist-generated -/lib/codeql/rust/elements/internal/BreakExprImpl.qll linguist-generated /lib/codeql/rust/elements/internal/CallExprConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/CallExprImpl.qll linguist-generated /lib/codeql/rust/elements/internal/CastExprConstructor.qll linguist-generated @@ -204,7 +203,6 @@ /lib/codeql/rust/elements/internal/ConstParamConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/ConstParamImpl.qll linguist-generated /lib/codeql/rust/elements/internal/ContinueExprConstructor.qll linguist-generated -/lib/codeql/rust/elements/internal/ContinueExprImpl.qll linguist-generated /lib/codeql/rust/elements/internal/DynTraitTypeConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/DynTraitTypeImpl.qll linguist-generated /lib/codeql/rust/elements/internal/EnumConstructor.qll linguist-generated diff --git a/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll b/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll index 971e4910fabe..ea181764cefd 100644 --- a/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll +++ b/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll @@ -145,44 +145,26 @@ class BlockExprTree extends StandardPostOrderTree, BlockExpr { result = super.getStmtList().getTailExpr() } - override predicate propagatesAbnormal(AstNode child) { none() } - - /** Holds if this block captures the break completion `c`. */ - private predicate capturesBreakCompletion(LoopJumpCompletion c) { - c.isBreak() and - c.getLabelName() = this.getLabel().getLifetime().getText() - } - - override predicate succ(AstNode pred, AstNode succ, Completion c) { - super.succ(pred, succ, c) - or - // Edge for exiting the block with a break expressions - last(this.getChildNode(_), pred, c) and - this.capturesBreakCompletion(c) and - succ = this - } - - override predicate last(AstNode last, Completion c) { - super.last(last, c) - or - // Any abnormal completions that this block does not capture should propagate - last(this.getChildNode(_), last, c) and - not completionIsNormal(c) and - not this.capturesBreakCompletion(c) - } + override predicate propagatesAbnormal(AstNode child) { child = this.getChildNode(_) } } -class BreakExprTree extends PostOrderTree instanceof BreakExpr { - override predicate propagatesAbnormal(AstNode child) { child = super.getExpr() } +class BreakExprTree extends PostOrderTree, BreakExpr { + override predicate propagatesAbnormal(AstNode child) { child = this.getExpr() } override predicate first(AstNode node) { - first(super.getExpr(), node) + first(this.getExpr(), node) or - not super.hasExpr() and node = this + not this.hasExpr() and node = this } + override predicate last(AstNode last, Completion c) { none() } + override predicate succ(AstNode pred, AstNode succ, Completion c) { last(super.getExpr(), pred, c) and succ = this + or + pred = this and + c.isValidFor(pred) and + succ = this.getTarget() } } @@ -200,7 +182,18 @@ class CastExprTree extends StandardPostOrderTree instanceof CastExpr { class ClosureExprTree extends LeafTree instanceof ClosureExpr { } -class ContinueExprTree extends LeafTree instanceof ContinueExpr { } +class ContinueExprTree extends LeafTree, ContinueExpr { + override predicate last(AstNode last, Completion c) { none() } + + override predicate succ(AstNode pred, AstNode succ, Completion c) { + exists(Expr target | + pred = this and + c.isValidFor(pred) and + target = this.getTarget() and + first(target.(LoopingExprTree).getLoopContinue(), succ) + ) + } +} class ExprStmtTree extends StandardPreOrderTree instanceof ExprStmt { override AstNode getChildNode(int i) { i = 0 and result = super.getExpr() } @@ -310,57 +303,27 @@ class LetStmtTree extends PreOrderTree instanceof LetStmt { class LiteralExprTree extends LeafTree instanceof LiteralExpr { } abstract class LoopingExprTree extends PostOrderTree { - override predicate propagatesAbnormal(AstNode child) { none() } + override predicate propagatesAbnormal(AstNode child) { child = this.getLoopBody() } abstract BlockExpr getLoopBody(); - abstract Label getLabel(); - /** * Gets the node to execute when continuing the loop; either after * executing the last node in the body or after an explicit `continue`. */ abstract AstNode getLoopContinue(); - /** Holds if this loop captures the `c` completion. */ - private predicate capturesLoopJumpCompletion(LoopJumpCompletion c) { - not c.hasLabel() - or - c.getLabelName() = this.getLabel().getLifetime().getText() - } - override predicate succ(AstNode pred, AstNode succ, Completion c) { - // Edge for exiting the loop with a break expressions - last(this.getLoopBody(), pred, c) and - c.(LoopJumpCompletion).isBreak() and - this.capturesLoopJumpCompletion(c) and - succ = this - or // Edge back to the start for final expression and continue expressions last(this.getLoopBody(), pred, c) and - ( - completionIsNormal(c) - or - c.(LoopJumpCompletion).isContinue() and this.capturesLoopJumpCompletion(c) - ) and + completionIsNormal(c) and first(this.getLoopContinue(), succ) } - - override predicate last(AstNode last, Completion c) { - super.last(last, c) - or - // Any abnormal completions that this loop does not capture should propagate - last(this.getLoopBody(), last, c) and - not completionIsNormal(c) and - not this.capturesLoopJumpCompletion(c) - } } class LoopExprTree extends LoopingExprTree instanceof LoopExpr { override BlockExpr getLoopBody() { result = LoopExpr.super.getLoopBody() } - override Label getLabel() { result = LoopExpr.super.getLabel() } - override AstNode getLoopContinue() { result = this.getLoopBody() } override predicate first(AstNode node) { first(this.getLoopBody(), node) } @@ -369,11 +332,13 @@ class LoopExprTree extends LoopingExprTree instanceof LoopExpr { class WhileExprTree extends LoopingExprTree instanceof WhileExpr { override BlockExpr getLoopBody() { result = WhileExpr.super.getLoopBody() } - override Label getLabel() { result = WhileExpr.super.getLabel() } - override AstNode getLoopContinue() { result = super.getCondition() } - override predicate propagatesAbnormal(AstNode child) { child = super.getCondition() } + override predicate propagatesAbnormal(AstNode child) { + super.propagatesAbnormal(child) + or + child = super.getCondition() + } override predicate first(AstNode node) { first(super.getCondition(), node) } @@ -399,11 +364,13 @@ class WhileExprTree extends LoopingExprTree instanceof WhileExpr { class ForExprTree extends LoopingExprTree instanceof ForExpr { override BlockExpr getLoopBody() { result = ForExpr.super.getLoopBody() } - override Label getLabel() { result = ForExpr.super.getLabel() } - override AstNode getLoopContinue() { result = super.getPat() } - override predicate propagatesAbnormal(AstNode child) { child = super.getIterable() } + override predicate propagatesAbnormal(AstNode child) { + super.propagatesAbnormal(child) + or + child = super.getIterable() + } override predicate first(AstNode node) { first(super.getIterable(), node) } diff --git a/rust/ql/lib/codeql/rust/elements/internal/BreakExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/BreakExprImpl.qll index 031761d374ed..4b302674a444 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/BreakExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/BreakExprImpl.qll @@ -1,4 +1,3 @@ -// generated by codegen, remove this comment if you wish to edit this file /** * This module provides a hand-modifiable wrapper around the generated class `BreakExpr`. * @@ -12,6 +11,58 @@ private import codeql.rust.elements.internal.generated.BreakExpr * be referenced directly. */ module Impl { + private import rust + private import codeql.rust.elements.internal.generated.ParentChild + + /** Holds if `e` is a loop labelled `label`. */ + pragma[nomagic] + predicate isLabelledLoop(Expr e, string label) { + e = + any(LoopExpr le | + label = le.getLabel().getLifetime().getText() + or + label = "" + ) + or + e = + any(ForExpr fe | + label = fe.getLabel().getLifetime().getText() + or + label = "" + ) + or + e = + any(WhileExpr we | + label = we.getLabel().getLifetime().getText() + or + label = "" + ) + } + + pragma[nomagic] + private predicate isLabelled(Expr e, string label) { + isLabelledLoop(e, label) + or + label = e.(BlockExpr).getLabel().getLifetime().getText() + } + + pragma[nomagic] + private AstNode getABreakAncestor(BreakExpr be, string label) { + ( + label = be.getLifetime().getText() + or + not be.hasLifetime() and + label = "" + ) and + exists(AstNode n0 | result = getImmediateParent(n0) | + n0 = be + or + n0 = getABreakAncestor(be, label) and + not isLabelled(n0, label) + ) + } + + // the following QLdoc is generated: if you need to edit it, do it in the schema file /** * A break expression. For example: * ```rust @@ -37,5 +88,19 @@ module Impl { * }; * ``` */ - class BreakExpr extends Generated::BreakExpr { } + class BreakExpr extends Generated::BreakExpr { + /** + * Gets the target of this `break` expression. + * + * The target is either a `LoopExpr`, a `ForExpr`, a `WhileExpr`, or a + * `BlockExpr`. + */ + pragma[nomagic] + Expr getTarget() { + exists(string label | + result = getABreakAncestor(this, label) and + isLabelled(result, label) + ) + } + } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/ContinueExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/ContinueExprImpl.qll index dd2476c79b7f..4328fdfc9f93 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/ContinueExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/ContinueExprImpl.qll @@ -1,4 +1,3 @@ -// generated by codegen, remove this comment if you wish to edit this file /** * This module provides a hand-modifiable wrapper around the generated class `ContinueExpr`. * @@ -12,6 +11,26 @@ private import codeql.rust.elements.internal.generated.ContinueExpr * be referenced directly. */ module Impl { + private import codeql.rust.elements.internal.BreakExprImpl::Impl as BreakExprImpl + private import codeql.rust.elements.internal.generated.ParentChild + + pragma[nomagic] + private AstNode getAContinueAncestor(ContinueExpr ce, string label) { + ( + label = ce.getLifetime().getText() + or + not ce.hasLifetime() and + label = "" + ) and + exists(AstNode n0 | result = getImmediateParent(n0) | + n0 = ce + or + n0 = getAContinueAncestor(ce, label) and + not BreakExprImpl::isLabelledLoop(n0, label) + ) + } + + // the following QLdoc is generated: if you need to edit it, do it in the schema file /** * A continue expression. For example: * ```rust @@ -29,5 +48,18 @@ module Impl { * } * ``` */ - class ContinueExpr extends Generated::ContinueExpr { } + class ContinueExpr extends Generated::ContinueExpr { + /** + * Gets the target of this `continue` expression. + * + * The target is either a `LoopExpr`, a `ForExpr`, or a `WhileExpr`. + */ + pragma[nomagic] + Expr getTarget() { + exists(string label | + result = getAContinueAncestor(this, label) and + BreakExprImpl::isLabelledLoop(result, label) + ) + } + } } diff --git a/rust/ql/test/library-tests/controlflow/Cfg.expected b/rust/ql/test/library-tests/controlflow/Cfg.expected index 0e7bf44925cc..e2f3464800a0 100644 --- a/rust/ql/test/library-tests/controlflow/Cfg.expected +++ b/rust/ql/test/library-tests/controlflow/Cfg.expected @@ -1,3 +1,4 @@ +edges | test.rs:1:1:4:1 | enter test_call | test.rs:2:5:2:41 | ExprStmt | | | test.rs:1:1:4:1 | exit test_call (normal) | test.rs:1:1:4:1 | exit test_call | | | test.rs:1:24:4:1 | BlockExpr | test.rs:1:1:4:1 | exit test_call (normal) | | @@ -545,3 +546,25 @@ | test.rs:299:13:299:27 | ExprStmt | test.rs:299:26:299:26 | 1 | | | test.rs:299:26:299:26 | 1 | test.rs:299:13:299:26 | BreakExpr | | | test.rs:301:9:301:9 | x | test.rs:296:18:302:5 | BlockExpr | | +breakTarget +| test.rs:16:17:16:21 | BreakExpr | test.rs:10:9:22:9 | LoopExpr | +| test.rs:30:21:30:25 | BreakExpr | test.rs:28:13:35:13 | LoopExpr | +| test.rs:32:21:32:32 | BreakExpr | test.rs:27:9:36:9 | LoopExpr | +| test.rs:34:17:34:28 | BreakExpr | test.rs:28:13:35:13 | LoopExpr | +| test.rs:73:17:73:21 | BreakExpr | test.rs:70:9:76:9 | WhileExpr | +| test.rs:83:17:83:21 | BreakExpr | test.rs:81:9:85:9 | WhileExpr | +| test.rs:91:17:91:21 | BreakExpr | test.rs:89:9:94:9 | ForExpr | +| test.rs:170:17:170:28 | BreakExpr | test.rs:168:13:173:9 | LoopExpr | +| test.rs:183:17:183:35 | BreakExpr | test.rs:181:13:186:9 | LoopExpr | +| test.rs:195:13:195:30 | BreakExpr | test.rs:194:13:196:9 | BlockExpr | +| test.rs:284:13:284:26 | BreakExpr | test.rs:281:18:292:5 | BlockExpr | +| test.rs:288:13:288:26 | BreakExpr | test.rs:281:18:292:5 | BlockExpr | +| test.rs:299:13:299:26 | BreakExpr | test.rs:296:18:302:5 | BlockExpr | +continueTarget +| test.rs:19:17:19:24 | ContinueExpr | test.rs:10:9:22:9 | LoopExpr | +| test.rs:45:21:45:28 | ContinueExpr | test.rs:43:13:50:13 | LoopExpr | +| test.rs:47:21:47:35 | ContinueExpr | test.rs:41:9:51:9 | LoopExpr | +| test.rs:49:17:49:31 | ContinueExpr | test.rs:43:13:50:13 | LoopExpr | +| test.rs:59:21:59:28 | ContinueExpr | test.rs:57:13:64:13 | LoopExpr | +| test.rs:61:21:61:34 | ContinueExpr | test.rs:57:13:64:13 | LoopExpr | +| test.rs:63:17:63:30 | ContinueExpr | test.rs:57:13:64:13 | LoopExpr | diff --git a/rust/ql/test/library-tests/variables/Cfg.expected b/rust/ql/test/library-tests/variables/Cfg.expected index 876e5fb52664..0a075ff054e3 100644 --- a/rust/ql/test/library-tests/variables/Cfg.expected +++ b/rust/ql/test/library-tests/variables/Cfg.expected @@ -1,3 +1,4 @@ +edges | variables.rs:1:1:3:1 | enter print_str | variables.rs:2:5:2:22 | ExprStmt | | | variables.rs:1:1:3:1 | exit print_str (normal) | variables.rs:1:1:3:1 | exit print_str | | | variables.rs:1:23:3:1 | BlockExpr | variables.rs:1:1:3:1 | exit print_str (normal) | | @@ -592,3 +593,5 @@ | variables.rs:340:5:340:16 | PathExpr | variables.rs:340:5:340:18 | CallExpr | | | variables.rs:340:5:340:18 | CallExpr | variables.rs:318:11:341:1 | BlockExpr | | | variables.rs:340:5:340:19 | ExprStmt | variables.rs:340:5:340:16 | PathExpr | | +breakTarget +continueTarget diff --git a/rust/ql/test/utils/Cfg.ql b/rust/ql/test/utils/Cfg.ql index 23b047b5b2ec..ee9a967553d1 100644 --- a/rust/ql/test/utils/Cfg.ql +++ b/rust/ql/test/utils/Cfg.ql @@ -7,3 +7,7 @@ class MyRelevantNode extends CfgNode { } import codeql.rust.controlflow.internal.ControlFlowGraphImpl::TestOutput + +query predicate breakTarget(BreakExpr be, Expr target) { target = be.getTarget() } + +query predicate continueTarget(ContinueExpr ce, Expr target) { target = ce.getTarget() } From 6da39724335f9ac1e58f57333b4dd65621ba0337 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Wed, 2 Oct 2024 15:02:26 +0200 Subject: [PATCH 51/79] Rust: Simplify break/continue CFG labels --- .../rust/controlflow/ControlFlowGraph.qll | 4 +- .../rust/controlflow/internal/Completion.qll | 52 +++++-------------- .../internal/ControlFlowGraphImpl.qll | 9 ++-- .../controlflow/internal/SuccessorType.qll | 32 ++++-------- .../library-tests/controlflow/Cfg.expected | 22 ++++---- 5 files changed, 42 insertions(+), 77 deletions(-) diff --git a/rust/ql/lib/codeql/rust/controlflow/ControlFlowGraph.qll b/rust/ql/lib/codeql/rust/controlflow/ControlFlowGraph.qll index 18159ccea748..20f1af4a4afb 100644 --- a/rust/ql/lib/codeql/rust/controlflow/ControlFlowGraph.qll +++ b/rust/ql/lib/codeql/rust/controlflow/ControlFlowGraph.qll @@ -19,7 +19,9 @@ final class BooleanSuccessor = BooleanSuccessorImpl; final class MatchSuccessor = MatchSuccessorImpl; -final class LoopJumpSuccessor = LoopJumpSuccessorImpl; +final class BreakSuccessor = BreakSuccessorImpl; + +final class ContinueSuccessor = ContinueSuccessorImpl; final class ReturnSuccessor = ReturnSuccessorImpl; diff --git a/rust/ql/lib/codeql/rust/controlflow/internal/Completion.qll b/rust/ql/lib/codeql/rust/controlflow/internal/Completion.qll index 4034db5fe288..15619f06a2fe 100644 --- a/rust/ql/lib/codeql/rust/controlflow/internal/Completion.qll +++ b/rust/ql/lib/codeql/rust/controlflow/internal/Completion.qll @@ -7,13 +7,8 @@ newtype TCompletion = TSimpleCompletion() or TBooleanCompletion(Boolean b) or TMatchCompletion(Boolean isMatch) or - TLoopCompletion(TLoopJumpType kind, TLabelType label) { - label = TNoLabel() - or - kind = TBreakJump() and label = TLabel(any(BreakExpr b).getLifetime().getText()) - or - kind = TContinueJump() and label = TLabel(any(ContinueExpr b).getLifetime().getText()) - } or + TBreakCompletion() or + TContinueCompletion() or TReturnCompletion() /** A completion of a statement or an expression. */ @@ -148,42 +143,23 @@ class MatchCompletion extends TMatchCompletion, ConditionalCompletion { } /** - * A completion that represents a break or a continue. + * A completion that represents a `break`. */ -class LoopJumpCompletion extends TLoopCompletion, Completion { - override LoopJumpSuccessor getAMatchingSuccessorType() { - result = TLoopSuccessor(this.getKind(), this.getLabelType()) - } - - final TLoopJumpType getKind() { this = TLoopCompletion(result, _) } - - final TLabelType getLabelType() { this = TLoopCompletion(_, result) } +class BreakCompletion extends TBreakCompletion, Completion { + override BreakSuccessor getAMatchingSuccessorType() { any() } - final predicate hasLabel() { this.getLabelType() = TLabel(_) } + override predicate isValidForSpecific(AstNode e) { e instanceof BreakExpr } - final string getLabelName() { TLabel(result) = this.getLabelType() } - - final predicate isContinue() { this.getKind() = TContinueJump() } + override string toString() { result = this.getAMatchingSuccessorType().toString() } +} - final predicate isBreak() { this.getKind() = TBreakJump() } +/** + * A completion that represents a `continue`. + */ +class ContinueCompletion extends TContinueCompletion, Completion { + override ContinueSuccessor getAMatchingSuccessorType() { any() } - override predicate isValidForSpecific(AstNode e) { - this.isBreak() and - e instanceof BreakExpr and - ( - not e.(BreakExpr).hasLifetime() and not this.hasLabel() - or - e.(BreakExpr).getLifetime().getText() = this.getLabelName() - ) - or - this.isContinue() and - e instanceof ContinueExpr and - ( - not e.(ContinueExpr).hasLifetime() and not this.hasLabel() - or - e.(ContinueExpr).getLifetime().getText() = this.getLabelName() - ) - } + override predicate isValidForSpecific(AstNode e) { e instanceof ContinueExpr } override string toString() { result = this.getAMatchingSuccessorType().toString() } } diff --git a/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll b/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll index ea181764cefd..17add12b9404 100644 --- a/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll +++ b/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll @@ -186,12 +186,9 @@ class ContinueExprTree extends LeafTree, ContinueExpr { override predicate last(AstNode last, Completion c) { none() } override predicate succ(AstNode pred, AstNode succ, Completion c) { - exists(Expr target | - pred = this and - c.isValidFor(pred) and - target = this.getTarget() and - first(target.(LoopingExprTree).getLoopContinue(), succ) - ) + pred = this and + c.isValidFor(pred) and + first(this.getTarget().(LoopingExprTree).getLoopContinue(), succ) } } diff --git a/rust/ql/lib/codeql/rust/controlflow/internal/SuccessorType.qll b/rust/ql/lib/codeql/rust/controlflow/internal/SuccessorType.qll index 6bdd54c263dd..ba76888bd303 100644 --- a/rust/ql/lib/codeql/rust/controlflow/internal/SuccessorType.qll +++ b/rust/ql/lib/codeql/rust/controlflow/internal/SuccessorType.qll @@ -15,7 +15,8 @@ newtype TSuccessorType = TSuccessorSuccessor() or TBooleanSuccessor(Boolean b) or TMatchSuccessor(Boolean b) or - TLoopSuccessor(TLoopJumpType kind, TLabelType label) { exists(TLoopCompletion(kind, label)) } or + TBreakSuccessor() or + TContinueSuccessor() or TReturnSuccessor() /** The type of a control flow successor. */ @@ -59,28 +60,17 @@ class MatchSuccessorImpl extends ConditionalSuccessorImpl, TMatchSuccessor { } /** - * A control flow successor of a loop control flow expression, `continue` or `break`. + * A control flow successor of a `break` expression. */ -class LoopJumpSuccessorImpl extends SuccessorTypeImpl, TLoopSuccessor { - private TLoopJumpType getKind() { this = TLoopSuccessor(result, _) } - - private TLabelType getLabelType() { this = TLoopSuccessor(_, result) } - - predicate hasLabel() { this.getLabelType() = TLabel(_) } - - string getLabelName() { this = TLoopSuccessor(_, TLabel(result)) } - - predicate isContinue() { this.getKind() = TContinueJump() } - - predicate isBreak() { this.getKind() = TBreakJump() } +class BreakSuccessorImpl extends SuccessorTypeImpl, TBreakSuccessor { + override string toString() { result = "break" } +} - override string toString() { - exists(string kind, string label | - (if this.isContinue() then kind = "continue" else kind = "break") and - (if this.hasLabel() then label = "(" + this.getLabelName() + ")" else label = "") and - result = kind + label - ) - } +/** + * A control flow successor of a `continue` expression. + */ +class ContinueSuccessorImpl extends SuccessorTypeImpl, TContinueSuccessor { + override string toString() { result = "continue" } } /** diff --git a/rust/ql/test/library-tests/controlflow/Cfg.expected b/rust/ql/test/library-tests/controlflow/Cfg.expected index e2f3464800a0..39fc6b96b621 100644 --- a/rust/ql/test/library-tests/controlflow/Cfg.expected +++ b/rust/ql/test/library-tests/controlflow/Cfg.expected @@ -77,9 +77,9 @@ edges | test.rs:31:24:33:17 | IfExpr | test.rs:29:17:33:17 | IfExpr | | | test.rs:31:27:31:27 | b | test.rs:31:24:33:17 | IfExpr | false | | test.rs:31:27:31:27 | b | test.rs:32:21:32:33 | ExprStmt | true | -| test.rs:32:21:32:32 | BreakExpr | test.rs:27:9:36:9 | LoopExpr | break('outer) | +| test.rs:32:21:32:32 | BreakExpr | test.rs:27:9:36:9 | LoopExpr | break | | test.rs:32:21:32:33 | ExprStmt | test.rs:32:21:32:32 | BreakExpr | | -| test.rs:34:17:34:28 | BreakExpr | test.rs:28:13:35:13 | LoopExpr | break('inner) | +| test.rs:34:17:34:28 | BreakExpr | test.rs:28:13:35:13 | LoopExpr | break | | test.rs:34:17:34:29 | ExprStmt | test.rs:34:17:34:28 | BreakExpr | | | test.rs:37:9:37:12 | true | test.rs:26:48:38:5 | BlockExpr | | | test.rs:40:5:52:5 | enter test_continue_with_labels | test.rs:42:13:42:14 | ExprStmt | | @@ -94,9 +94,9 @@ edges | test.rs:46:24:48:17 | IfExpr | test.rs:44:17:48:17 | IfExpr | | | test.rs:46:27:46:27 | b | test.rs:46:24:48:17 | IfExpr | false | | test.rs:46:27:46:27 | b | test.rs:47:21:47:36 | ExprStmt | true | -| test.rs:47:21:47:35 | ContinueExpr | test.rs:42:13:42:14 | ExprStmt | continue('outer) | +| test.rs:47:21:47:35 | ContinueExpr | test.rs:42:13:42:14 | ExprStmt | continue | | test.rs:47:21:47:36 | ExprStmt | test.rs:47:21:47:35 | ContinueExpr | | -| test.rs:49:17:49:31 | ContinueExpr | test.rs:44:17:48:17 | ExprStmt | continue('inner) | +| test.rs:49:17:49:31 | ContinueExpr | test.rs:44:17:48:17 | ExprStmt | continue | | test.rs:49:17:49:32 | ExprStmt | test.rs:49:17:49:31 | ContinueExpr | | | test.rs:54:5:66:5 | enter test_loop_label_shadowing | test.rs:56:13:56:14 | ExprStmt | | | test.rs:56:13:56:13 | 1 | test.rs:58:17:62:17 | ExprStmt | | @@ -110,9 +110,9 @@ edges | test.rs:60:24:62:17 | IfExpr | test.rs:58:17:62:17 | IfExpr | | | test.rs:60:27:60:27 | b | test.rs:60:24:62:17 | IfExpr | false | | test.rs:60:27:60:27 | b | test.rs:61:21:61:35 | ExprStmt | true | -| test.rs:61:21:61:34 | ContinueExpr | test.rs:58:17:62:17 | ExprStmt | continue('loop) | +| test.rs:61:21:61:34 | ContinueExpr | test.rs:58:17:62:17 | ExprStmt | continue | | test.rs:61:21:61:35 | ExprStmt | test.rs:61:21:61:34 | ContinueExpr | | -| test.rs:63:17:63:30 | ContinueExpr | test.rs:58:17:62:17 | ExprStmt | continue('loop) | +| test.rs:63:17:63:30 | ContinueExpr | test.rs:58:17:62:17 | ExprStmt | continue | | test.rs:63:17:63:31 | ExprStmt | test.rs:63:17:63:30 | ContinueExpr | | | test.rs:68:5:77:5 | enter test_while | test.rs:69:9:69:25 | LetStmt | | | test.rs:68:5:77:5 | exit test_while (normal) | test.rs:68:5:77:5 | exit test_while | | @@ -338,7 +338,7 @@ edges | test.rs:182:16:182:20 | ... > ... | test.rs:182:13:184:13 | IfExpr | false | | test.rs:182:16:182:20 | ... > ... | test.rs:183:17:183:36 | ExprStmt | true | | test.rs:182:20:182:20 | 0 | test.rs:182:16:182:20 | ... > ... | | -| test.rs:183:17:183:35 | BreakExpr | test.rs:181:13:186:9 | LoopExpr | break('label) | +| test.rs:183:17:183:35 | BreakExpr | test.rs:181:13:186:9 | LoopExpr | break | | test.rs:183:17:183:36 | ExprStmt | test.rs:183:30:183:30 | a | | | test.rs:183:30:183:30 | a | test.rs:183:34:183:35 | 10 | | | test.rs:183:30:183:35 | ... > ... | test.rs:183:17:183:35 | BreakExpr | | @@ -357,7 +357,7 @@ edges | test.rs:194:9:200:9 | IfExpr | test.rs:193:43:201:5 | BlockExpr | | | test.rs:194:13:196:9 | BlockExpr | test.rs:197:13:197:13 | 1 | true | | test.rs:194:13:196:9 | BlockExpr | test.rs:199:13:199:13 | 0 | false | -| test.rs:195:13:195:30 | BreakExpr | test.rs:194:13:196:9 | BlockExpr | break('block) | +| test.rs:195:13:195:30 | BreakExpr | test.rs:194:13:196:9 | BlockExpr | break | | test.rs:195:13:195:31 | ExprStmt | test.rs:195:26:195:26 | a | | | test.rs:195:26:195:26 | a | test.rs:195:30:195:30 | 0 | | | test.rs:195:26:195:30 | ... > ... | test.rs:195:13:195:30 | BreakExpr | | @@ -511,7 +511,7 @@ edges | test.rs:283:12:283:28 | PathExpr | test.rs:283:12:283:30 | CallExpr | | | test.rs:283:12:283:30 | CallExpr | test.rs:283:9:285:9 | IfExpr | false | | test.rs:283:12:283:30 | CallExpr | test.rs:284:13:284:27 | ExprStmt | true | -| test.rs:284:13:284:26 | BreakExpr | test.rs:281:18:292:5 | BlockExpr | break('block) | +| test.rs:284:13:284:26 | BreakExpr | test.rs:281:18:292:5 | BlockExpr | break | | test.rs:284:13:284:27 | ExprStmt | test.rs:284:26:284:26 | 1 | | | test.rs:284:26:284:26 | 1 | test.rs:284:13:284:26 | BreakExpr | | | test.rs:286:9:286:21 | PathExpr | test.rs:286:9:286:23 | CallExpr | | @@ -522,7 +522,7 @@ edges | test.rs:287:12:287:28 | PathExpr | test.rs:287:12:287:30 | CallExpr | | | test.rs:287:12:287:30 | CallExpr | test.rs:287:9:289:9 | IfExpr | false | | test.rs:287:12:287:30 | CallExpr | test.rs:288:13:288:27 | ExprStmt | true | -| test.rs:288:13:288:26 | BreakExpr | test.rs:281:18:292:5 | BlockExpr | break('block) | +| test.rs:288:13:288:26 | BreakExpr | test.rs:281:18:292:5 | BlockExpr | break | | test.rs:288:13:288:27 | ExprStmt | test.rs:288:26:288:26 | 2 | | | test.rs:288:26:288:26 | 2 | test.rs:288:13:288:26 | BreakExpr | | | test.rs:290:9:290:21 | PathExpr | test.rs:290:9:290:23 | CallExpr | | @@ -542,7 +542,7 @@ edges | test.rs:298:13:298:19 | TupleStructPat | test.rs:299:13:299:27 | ExprStmt | no-match | | test.rs:298:13:298:19 | TupleStructPat | test.rs:301:9:301:9 | x | match | | test.rs:298:23:298:23 | x | test.rs:298:13:298:19 | TupleStructPat | | -| test.rs:299:13:299:26 | BreakExpr | test.rs:296:18:302:5 | BlockExpr | break('block) | +| test.rs:299:13:299:26 | BreakExpr | test.rs:296:18:302:5 | BlockExpr | break | | test.rs:299:13:299:27 | ExprStmt | test.rs:299:26:299:26 | 1 | | | test.rs:299:26:299:26 | 1 | test.rs:299:13:299:26 | BreakExpr | | | test.rs:301:9:301:9 | x | test.rs:296:18:302:5 | BlockExpr | | From 05d2e16de37fc6a004e9f86acd02bd87d37d3ac7 Mon Sep 17 00:00:00 2001 From: Chris Smowton Date: Wed, 2 Oct 2024 15:25:36 +0100 Subject: [PATCH 52/79] autoformat --- go/ql/integration-tests/test-extraction/src/pkg1/def.go | 2 +- go/ql/integration-tests/test-extraction/test.expected | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go/ql/integration-tests/test-extraction/src/pkg1/def.go b/go/ql/integration-tests/test-extraction/src/pkg1/def.go index 2492919f76df..e768e81b89d4 100644 --- a/go/ql/integration-tests/test-extraction/src/pkg1/def.go +++ b/go/ql/integration-tests/test-extraction/src/pkg1/def.go @@ -4,4 +4,4 @@ type Generic[T any] struct { element T } -func TestMe() { } +func TestMe() {} diff --git a/go/ql/integration-tests/test-extraction/test.expected b/go/ql/integration-tests/test-extraction/test.expected index eda27075ad43..77983c448071 100644 --- a/go/ql/integration-tests/test-extraction/test.expected +++ b/go/ql/integration-tests/test-extraction/test.expected @@ -7,8 +7,8 @@ | src/testme_blackbox_test.go:0:0:0:0 | src/testme_blackbox_test.go | | src/testme_test.go:0:0:0:0 | src/testme_test.go | calls -| src/pkg1/def_blackbox_test.go:8:2:8:14 | call to TestMe | src/pkg1/def.go:7:1:7:17 | function declaration | -| src/pkg1/def_test.go:4:2:4:9 | call to TestMe | src/pkg1/def.go:7:1:7:17 | function declaration | +| src/pkg1/def_blackbox_test.go:8:2:8:14 | call to TestMe | src/pkg1/def.go:7:1:7:16 | function declaration | +| src/pkg1/def_test.go:4:2:4:9 | call to TestMe | src/pkg1/def.go:7:1:7:16 | function declaration | | src/testme_blackbox_test.go:10:18:10:44 | call to PublicFunction | src/testme.go:3:1:3:38 | function declaration | | src/testme_test.go:9:18:9:33 | call to PublicFunction | src/testme.go:3:1:3:38 | function declaration | | src/testme_test.go:14:19:14:35 | call to privateFunction | src/testme.go:5:1:5:39 | function declaration | From 8c87b66bea97e8f379062f1be06f576fd0e428a5 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 2 Oct 2024 16:50:24 +0100 Subject: [PATCH 53/79] Rust: Add more test cases for comments. --- .../diagnostics/ExtractedFiles.expected | 1 + .../diagnostics/LinesOfCode.expected | 2 +- .../diagnostics/LinesOfUserCode.expected | 2 +- .../LinesOfUserCodeInFiles.expected | 5 +- .../diagnostics/SummaryStats.expected | 8 +-- .../test/query-tests/diagnostics/comments.rs | 60 +++++++++++++++++++ rust/ql/test/query-tests/diagnostics/main.rs | 9 ++- 7 files changed, 74 insertions(+), 13 deletions(-) create mode 100644 rust/ql/test/query-tests/diagnostics/comments.rs diff --git a/rust/ql/test/query-tests/diagnostics/ExtractedFiles.expected b/rust/ql/test/query-tests/diagnostics/ExtractedFiles.expected index cc6f775e86d5..c5ebb7072304 100644 --- a/rust/ql/test/query-tests/diagnostics/ExtractedFiles.expected +++ b/rust/ql/test/query-tests/diagnostics/ExtractedFiles.expected @@ -1,3 +1,4 @@ +| comments.rs:0:0:0:0 | comments.rs | File successfully extracted. | | does_not_compile.rs:0:0:0:0 | does_not_compile.rs | File successfully extracted. | | error.rs:0:0:0:0 | error.rs | File successfully extracted. | | lib.rs:0:0:0:0 | lib.rs | File successfully extracted. | diff --git a/rust/ql/test/query-tests/diagnostics/LinesOfCode.expected b/rust/ql/test/query-tests/diagnostics/LinesOfCode.expected index 3885b955c3f3..f57679361dc0 100644 --- a/rust/ql/test/query-tests/diagnostics/LinesOfCode.expected +++ b/rust/ql/test/query-tests/diagnostics/LinesOfCode.expected @@ -1 +1 @@ -| 46 | +| 68 | diff --git a/rust/ql/test/query-tests/diagnostics/LinesOfUserCode.expected b/rust/ql/test/query-tests/diagnostics/LinesOfUserCode.expected index 3885b955c3f3..f57679361dc0 100644 --- a/rust/ql/test/query-tests/diagnostics/LinesOfUserCode.expected +++ b/rust/ql/test/query-tests/diagnostics/LinesOfUserCode.expected @@ -1 +1 @@ -| 46 | +| 68 | diff --git a/rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected b/rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected index 52ee2055e8fe..1b0edb495195 100644 --- a/rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected +++ b/rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected @@ -1,6 +1,7 @@ +| comments.rs:0:0:0:0 | comments.rs | 20 | | my_struct.rs:0:0:0:0 | my_struct.rs | 20 | -| main.rs:0:0:0:0 | main.rs | 7 | +| main.rs:0:0:0:0 | main.rs | 8 | +| lib.rs:0:0:0:0 | lib.rs | 7 | | my_macro.rs:0:0:0:0 | my_macro.rs | 7 | -| lib.rs:0:0:0:0 | lib.rs | 6 | | does_not_compile.rs:0:0:0:0 | does_not_compile.rs | 3 | | error.rs:0:0:0:0 | error.rs | 3 | diff --git a/rust/ql/test/query-tests/diagnostics/SummaryStats.expected b/rust/ql/test/query-tests/diagnostics/SummaryStats.expected index da1e6cd7b60c..a39ccb0b44c5 100644 --- a/rust/ql/test/query-tests/diagnostics/SummaryStats.expected +++ b/rust/ql/test/query-tests/diagnostics/SummaryStats.expected @@ -1,5 +1,5 @@ -| Elements extracted | 216 | +| Elements extracted | 290 | | Elements unextracted | 0 | -| Files extracted | 6 | -| Lines of code extracted | 46 | -| Lines of user code extracted | 46 | +| Files extracted | 7 | +| Lines of code extracted | 68 | +| Lines of user code extracted | 68 | diff --git a/rust/ql/test/query-tests/diagnostics/comments.rs b/rust/ql/test/query-tests/diagnostics/comments.rs new file mode 100644 index 000000000000..bec721eed25f --- /dev/null +++ b/rust/ql/test/query-tests/diagnostics/comments.rs @@ -0,0 +1,60 @@ +/** + * total lines in this file: 61 + * of which code: 16 + * of which only comments: 33 + * of which blank: 12 + */ + +// a comment + +/** + * Comment attached to a struct. + */ +struct StructWithComments +{ + /** + * Another attached comment. + */ + a: i32, + + // And another attached comment. + b: i32, + + /* + * And yet another attached comment. + */ + c: i32, + + // informal + // comment + // block. + cd: i32, + + // Just a comment. +} + +pub fn my_simple_func() +{ +} + +/** + * Comment attached to a function. + */ +pub fn my_func_with_comments() +{ + // comment + let a = 1; // comment + // comment + let b = 2; + + // comment + + /* + * Comment. + */ + my_simple_func(); +} + +/** + * Comment. + */ diff --git a/rust/ql/test/query-tests/diagnostics/main.rs b/rust/ql/test/query-tests/diagnostics/main.rs index 6e0ddf695a3a..07dd4234a6e7 100644 --- a/rust/ql/test/query-tests/diagnostics/main.rs +++ b/rust/ql/test/query-tests/diagnostics/main.rs @@ -1,16 +1,15 @@ /** * total lines in this file: 18 - * of which code: 7 - * of which only comments: 7 + * of which code: 8 + * of which only comments: 6 * of which blank: 4 */ mod my_struct; mod my_macro; +mod comments; -// another comment - -fn main() { // another comment +fn main() { println!("Hello, world!"); my_struct::my_func(); From 01abcf8537f297ab169a5848803408065a041006 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 2 Oct 2024 16:54:02 +0100 Subject: [PATCH 54/79] Rust: Use just end locations for now, to avoid all false positive lines caused by attached comments. --- rust/ql/lib/codeql/files/FileSystem.qll | 3 +-- rust/ql/test/query-tests/diagnostics/LinesOfCode.expected | 2 +- rust/ql/test/query-tests/diagnostics/LinesOfUserCode.expected | 2 +- .../query-tests/diagnostics/LinesOfUserCodeInFiles.expected | 2 +- rust/ql/test/query-tests/diagnostics/SummaryStats.expected | 4 ++-- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/rust/ql/lib/codeql/files/FileSystem.qll b/rust/ql/lib/codeql/files/FileSystem.qll index 03b5cd0b183b..b78a993cb7e7 100644 --- a/rust/ql/lib/codeql/files/FileSystem.qll +++ b/rust/ql/lib/codeql/files/FileSystem.qll @@ -47,11 +47,10 @@ class File extends Container, Impl::File { exists(AstNode node, Location loc | not node instanceof Comment and not node instanceof SourceFile and - not node instanceof Item and // ignore Items for now as we're getting their locations wrong when a comment is attached loc = node.getLocation() | node.getFile() = this and - line = [loc.getStartLine(), loc.getEndLine()] and + line = [/*loc.getStartLine(), */loc.getEndLine()] and // ignore start locations for now as we're getting them wrong for things with a comment attached not loc instanceof EmptyLocation ) ) diff --git a/rust/ql/test/query-tests/diagnostics/LinesOfCode.expected b/rust/ql/test/query-tests/diagnostics/LinesOfCode.expected index f57679361dc0..bf709e1ddc4d 100644 --- a/rust/ql/test/query-tests/diagnostics/LinesOfCode.expected +++ b/rust/ql/test/query-tests/diagnostics/LinesOfCode.expected @@ -1 +1 @@ -| 68 | +| 61 | diff --git a/rust/ql/test/query-tests/diagnostics/LinesOfUserCode.expected b/rust/ql/test/query-tests/diagnostics/LinesOfUserCode.expected index f57679361dc0..bf709e1ddc4d 100644 --- a/rust/ql/test/query-tests/diagnostics/LinesOfUserCode.expected +++ b/rust/ql/test/query-tests/diagnostics/LinesOfUserCode.expected @@ -1 +1 @@ -| 68 | +| 61 | diff --git a/rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected b/rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected index 1b0edb495195..b93473f7e04a 100644 --- a/rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected +++ b/rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected @@ -1,5 +1,5 @@ -| comments.rs:0:0:0:0 | comments.rs | 20 | | my_struct.rs:0:0:0:0 | my_struct.rs | 20 | +| comments.rs:0:0:0:0 | comments.rs | 13 | | main.rs:0:0:0:0 | main.rs | 8 | | lib.rs:0:0:0:0 | lib.rs | 7 | | my_macro.rs:0:0:0:0 | my_macro.rs | 7 | diff --git a/rust/ql/test/query-tests/diagnostics/SummaryStats.expected b/rust/ql/test/query-tests/diagnostics/SummaryStats.expected index a39ccb0b44c5..d9142bcadfed 100644 --- a/rust/ql/test/query-tests/diagnostics/SummaryStats.expected +++ b/rust/ql/test/query-tests/diagnostics/SummaryStats.expected @@ -1,5 +1,5 @@ | Elements extracted | 290 | | Elements unextracted | 0 | | Files extracted | 7 | -| Lines of code extracted | 68 | -| Lines of user code extracted | 68 | +| Lines of code extracted | 61 | +| Lines of user code extracted | 61 | From d6848f5c5d9ce2cdfb1eb149765ef82081923d70 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 2 Oct 2024 17:00:28 +0100 Subject: [PATCH 55/79] Rust: Apparently a doc comment here was illegal. --- rust/ql/test/query-tests/diagnostics/comments.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/ql/test/query-tests/diagnostics/comments.rs b/rust/ql/test/query-tests/diagnostics/comments.rs index bec721eed25f..fe99fdd4e3e3 100644 --- a/rust/ql/test/query-tests/diagnostics/comments.rs +++ b/rust/ql/test/query-tests/diagnostics/comments.rs @@ -55,6 +55,6 @@ pub fn my_func_with_comments() my_simple_func(); } -/** +/* * Comment. */ From 0b6ec4624eeaf27f0d4fd715f8beb7ec9252f924 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 2 Oct 2024 17:05:01 +0100 Subject: [PATCH 56/79] Rust: Autoformat. --- rust/ql/lib/codeql/files/FileSystem.qll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/ql/lib/codeql/files/FileSystem.qll b/rust/ql/lib/codeql/files/FileSystem.qll index b78a993cb7e7..95ca925a8840 100644 --- a/rust/ql/lib/codeql/files/FileSystem.qll +++ b/rust/ql/lib/codeql/files/FileSystem.qll @@ -50,7 +50,7 @@ class File extends Container, Impl::File { loc = node.getLocation() | node.getFile() = this and - line = [/*loc.getStartLine(), */loc.getEndLine()] and // ignore start locations for now as we're getting them wrong for things with a comment attached + line = [/*loc.getStartLine(), */ loc.getEndLine()] and // ignore start locations for now as we're getting them wrong for things with a comment attached not loc instanceof EmptyLocation ) ) From fe54961b84a341ef2f00cd3daa740747015b678e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 2 Oct 2024 18:30:42 +0000 Subject: [PATCH 57/79] Release preparation for version 2.19.1 --- cpp/ql/lib/CHANGELOG.md | 4 ++++ cpp/ql/lib/change-notes/released/2.0.1.md | 3 +++ cpp/ql/lib/codeql-pack.release.yml | 2 +- cpp/ql/lib/qlpack.yml | 2 +- cpp/ql/src/CHANGELOG.md | 10 ++++++-- .../1.2.4.md} | 7 +++--- cpp/ql/src/codeql-pack.release.yml | 2 +- cpp/ql/src/qlpack.yml | 2 +- .../ql/campaigns/Solorigate/lib/CHANGELOG.md | 4 ++++ .../lib/change-notes/released/1.7.26.md | 3 +++ .../Solorigate/lib/codeql-pack.release.yml | 2 +- csharp/ql/campaigns/Solorigate/lib/qlpack.yml | 2 +- .../ql/campaigns/Solorigate/src/CHANGELOG.md | 4 ++++ .../src/change-notes/released/1.7.26.md | 3 +++ .../Solorigate/src/codeql-pack.release.yml | 2 +- csharp/ql/campaigns/Solorigate/src/qlpack.yml | 2 +- csharp/ql/lib/CHANGELOG.md | 16 +++++++++++++ .../2024-09-10-ActiveThreatModelSource.md | 4 ---- .../change-notes/2024-09-16-accessor-mad.md | 4 ---- .../lib/change-notes/2024-09-16-delete-cil.md | 4 ---- .../2024-09-16-indexer-attributes.md | 4 ---- .../2024-09-19-reduced-dataflow-nodes.md | 4 ---- csharp/ql/lib/change-notes/released/3.0.0.md | 15 ++++++++++++ csharp/ql/lib/codeql-pack.release.yml | 2 +- csharp/ql/lib/qlpack.yml | 2 +- csharp/ql/src/CHANGELOG.md | 6 +++++ .../1.0.9.md} | 7 +++--- csharp/ql/src/codeql-pack.release.yml | 2 +- csharp/ql/src/qlpack.yml | 2 +- go/ql/consistency-queries/CHANGELOG.md | 4 ++++ .../change-notes/released/1.0.9.md | 3 +++ .../codeql-pack.release.yml | 2 +- go/ql/consistency-queries/qlpack.yml | 2 +- go/ql/lib/CHANGELOG.md | 24 +++++++++++++------ .../2024-09-10-ActiveThreatModelSource.md | 4 ---- .../2.1.0.md} | 11 ++++++--- go/ql/lib/codeql-pack.release.yml | 2 +- go/ql/lib/qlpack.yml | 2 +- go/ql/src/CHANGELOG.md | 6 +++++ .../1.1.0.md} | 7 +++--- go/ql/src/codeql-pack.release.yml | 2 +- go/ql/src/qlpack.yml | 2 +- java/ql/automodel/src/CHANGELOG.md | 4 ++++ .../src/change-notes/released/1.0.9.md | 3 +++ java/ql/automodel/src/codeql-pack.release.yml | 2 +- java/ql/automodel/src/qlpack.yml | 2 +- java/ql/lib/CHANGELOG.md | 16 ++++++++++++- .../2024-09-10-ActiveThreatModelSource.md | 4 ---- .../lib/change-notes/2024-09-16-nestedName.md | 4 ---- java/ql/lib/change-notes/2024-09-18-fields.md | 5 ---- .../change-notes/2024-09-20-kotlin-2.1.0.md | 4 ---- .../ql/lib/change-notes/2024-09-25-java-23.md | 4 ---- java/ql/lib/change-notes/released/4.1.0.md | 13 ++++++++++ java/ql/lib/codeql-pack.release.yml | 2 +- java/ql/lib/qlpack.yml | 2 +- java/ql/src/CHANGELOG.md | 6 +++++ .../2024-09-18-getInputStream-summary.md | 4 ---- java/ql/src/change-notes/released/1.1.6.md | 5 ++++ java/ql/src/codeql-pack.release.yml | 2 +- java/ql/src/qlpack.yml | 2 +- javascript/ql/lib/CHANGELOG.md | 4 ++++ .../ql/lib/change-notes/released/2.0.1.md | 3 +++ javascript/ql/lib/codeql-pack.release.yml | 2 +- javascript/ql/lib/qlpack.yml | 2 +- javascript/ql/src/CHANGELOG.md | 6 ++++- .../ql/src/change-notes/released/1.2.1.md | 3 +++ javascript/ql/src/codeql-pack.release.yml | 2 +- javascript/ql/src/qlpack.yml | 2 +- misc/suite-helpers/CHANGELOG.md | 4 ++++ .../change-notes/released/1.0.9.md | 3 +++ misc/suite-helpers/codeql-pack.release.yml | 2 +- misc/suite-helpers/qlpack.yml | 2 +- python/ql/lib/CHANGELOG.md | 10 ++++++++ .../2024-09-20-const-compare-gaurd.md | 4 ---- .../2.1.0.md} | 11 ++++++--- python/ql/lib/codeql-pack.release.yml | 2 +- python/ql/lib/qlpack.yml | 2 +- python/ql/src/CHANGELOG.md | 6 +++++ ...-08-26-Cors-misconfiguration-middleware.md | 4 ---- python/ql/src/change-notes/released/1.3.0.md | 5 ++++ python/ql/src/codeql-pack.release.yml | 2 +- python/ql/src/qlpack.yml | 2 +- ruby/ql/lib/CHANGELOG.md | 4 ++++ ruby/ql/lib/change-notes/released/2.0.1.md | 3 +++ ruby/ql/lib/codeql-pack.release.yml | 2 +- ruby/ql/lib/qlpack.yml | 2 +- ruby/ql/src/CHANGELOG.md | 4 ++++ ruby/ql/src/change-notes/released/1.1.4.md | 3 +++ ruby/ql/src/codeql-pack.release.yml | 2 +- ruby/ql/src/qlpack.yml | 2 +- shared/controlflow/CHANGELOG.md | 4 ++++ .../change-notes/released/1.0.9.md | 3 +++ shared/controlflow/codeql-pack.release.yml | 2 +- shared/controlflow/qlpack.yml | 2 +- shared/dataflow/CHANGELOG.md | 4 ++++ .../dataflow/change-notes/released/1.1.3.md | 3 +++ shared/dataflow/codeql-pack.release.yml | 2 +- shared/dataflow/qlpack.yml | 2 +- shared/mad/CHANGELOG.md | 4 ++++ shared/mad/change-notes/released/1.0.9.md | 3 +++ shared/mad/codeql-pack.release.yml | 2 +- shared/mad/qlpack.yml | 2 +- shared/rangeanalysis/CHANGELOG.md | 4 ++++ .../change-notes/released/1.0.9.md | 3 +++ shared/rangeanalysis/codeql-pack.release.yml | 2 +- shared/rangeanalysis/qlpack.yml | 2 +- shared/regex/CHANGELOG.md | 4 ++++ shared/regex/change-notes/released/1.0.9.md | 3 +++ shared/regex/codeql-pack.release.yml | 2 +- shared/regex/qlpack.yml | 2 +- shared/ssa/CHANGELOG.md | 4 ++++ shared/ssa/change-notes/released/1.0.9.md | 3 +++ shared/ssa/codeql-pack.release.yml | 2 +- shared/ssa/qlpack.yml | 2 +- shared/threat-models/CHANGELOG.md | 4 ++++ .../change-notes/released/1.0.9.md | 3 +++ shared/threat-models/codeql-pack.release.yml | 2 +- shared/threat-models/qlpack.yml | 2 +- shared/tutorial/CHANGELOG.md | 4 ++++ .../tutorial/change-notes/released/1.0.9.md | 3 +++ shared/tutorial/codeql-pack.release.yml | 2 +- shared/tutorial/qlpack.yml | 2 +- shared/typeflow/CHANGELOG.md | 4 ++++ .../typeflow/change-notes/released/1.0.9.md | 3 +++ shared/typeflow/codeql-pack.release.yml | 2 +- shared/typeflow/qlpack.yml | 2 +- shared/typetracking/CHANGELOG.md | 4 ++++ .../change-notes/released/1.0.9.md | 3 +++ shared/typetracking/codeql-pack.release.yml | 2 +- shared/typetracking/qlpack.yml | 2 +- shared/typos/CHANGELOG.md | 4 ++++ shared/typos/change-notes/released/1.0.9.md | 3 +++ shared/typos/codeql-pack.release.yml | 2 +- shared/typos/qlpack.yml | 2 +- shared/util/CHANGELOG.md | 4 ++++ shared/util/change-notes/released/1.0.9.md | 3 +++ shared/util/codeql-pack.release.yml | 2 +- shared/util/qlpack.yml | 2 +- shared/xml/CHANGELOG.md | 4 ++++ shared/xml/change-notes/released/1.0.9.md | 3 +++ shared/xml/codeql-pack.release.yml | 2 +- shared/xml/qlpack.yml | 2 +- shared/yaml/CHANGELOG.md | 4 ++++ shared/yaml/change-notes/released/1.0.9.md | 3 +++ shared/yaml/codeql-pack.release.yml | 2 +- shared/yaml/qlpack.yml | 2 +- swift/ql/lib/CHANGELOG.md | 6 +++++ .../2.0.1.md} | 7 +++--- swift/ql/lib/codeql-pack.release.yml | 2 +- swift/ql/lib/qlpack.yml | 2 +- swift/ql/src/CHANGELOG.md | 4 ++++ swift/ql/src/change-notes/released/1.0.9.md | 3 +++ swift/ql/src/codeql-pack.release.yml | 2 +- swift/ql/src/qlpack.yml | 2 +- 154 files changed, 412 insertions(+), 156 deletions(-) create mode 100644 cpp/ql/lib/change-notes/released/2.0.1.md rename cpp/ql/src/change-notes/{2024-09-26-wrong-number-format-arguments.md => released/1.2.4.md} (80%) create mode 100644 csharp/ql/campaigns/Solorigate/lib/change-notes/released/1.7.26.md create mode 100644 csharp/ql/campaigns/Solorigate/src/change-notes/released/1.7.26.md delete mode 100644 csharp/ql/lib/change-notes/2024-09-10-ActiveThreatModelSource.md delete mode 100644 csharp/ql/lib/change-notes/2024-09-16-accessor-mad.md delete mode 100644 csharp/ql/lib/change-notes/2024-09-16-delete-cil.md delete mode 100644 csharp/ql/lib/change-notes/2024-09-16-indexer-attributes.md delete mode 100644 csharp/ql/lib/change-notes/2024-09-19-reduced-dataflow-nodes.md create mode 100644 csharp/ql/lib/change-notes/released/3.0.0.md rename csharp/ql/src/change-notes/{2024-09-25-attribute-collection-sink.md => released/1.0.9.md} (72%) create mode 100644 go/ql/consistency-queries/change-notes/released/1.0.9.md delete mode 100644 go/ql/lib/change-notes/2024-09-10-ActiveThreatModelSource.md rename go/ql/lib/change-notes/{2024-09-24-incorrectly-promoted-methods.md => released/2.1.0.md} (55%) rename go/ql/src/change-notes/{2024-09-24-incorrect-integer-conversion-query-precision.md => released/1.1.0.md} (84%) create mode 100644 java/ql/automodel/src/change-notes/released/1.0.9.md delete mode 100644 java/ql/lib/change-notes/2024-09-10-ActiveThreatModelSource.md delete mode 100644 java/ql/lib/change-notes/2024-09-16-nestedName.md delete mode 100644 java/ql/lib/change-notes/2024-09-18-fields.md delete mode 100644 java/ql/lib/change-notes/2024-09-20-kotlin-2.1.0.md delete mode 100644 java/ql/lib/change-notes/2024-09-25-java-23.md create mode 100644 java/ql/lib/change-notes/released/4.1.0.md delete mode 100644 java/ql/src/change-notes/2024-09-18-getInputStream-summary.md create mode 100644 java/ql/src/change-notes/released/1.1.6.md create mode 100644 javascript/ql/lib/change-notes/released/2.0.1.md create mode 100644 javascript/ql/src/change-notes/released/1.2.1.md create mode 100644 misc/suite-helpers/change-notes/released/1.0.9.md delete mode 100644 python/ql/lib/change-notes/2024-09-20-const-compare-gaurd.md rename python/ql/lib/change-notes/{2024-08-16-threat-models.md => released/2.1.0.md} (52%) delete mode 100644 python/ql/src/change-notes/2024-08-26-Cors-misconfiguration-middleware.md create mode 100644 python/ql/src/change-notes/released/1.3.0.md create mode 100644 ruby/ql/lib/change-notes/released/2.0.1.md create mode 100644 ruby/ql/src/change-notes/released/1.1.4.md create mode 100644 shared/controlflow/change-notes/released/1.0.9.md create mode 100644 shared/dataflow/change-notes/released/1.1.3.md create mode 100644 shared/mad/change-notes/released/1.0.9.md create mode 100644 shared/rangeanalysis/change-notes/released/1.0.9.md create mode 100644 shared/regex/change-notes/released/1.0.9.md create mode 100644 shared/ssa/change-notes/released/1.0.9.md create mode 100644 shared/threat-models/change-notes/released/1.0.9.md create mode 100644 shared/tutorial/change-notes/released/1.0.9.md create mode 100644 shared/typeflow/change-notes/released/1.0.9.md create mode 100644 shared/typetracking/change-notes/released/1.0.9.md create mode 100644 shared/typos/change-notes/released/1.0.9.md create mode 100644 shared/util/change-notes/released/1.0.9.md create mode 100644 shared/xml/change-notes/released/1.0.9.md create mode 100644 shared/yaml/change-notes/released/1.0.9.md rename swift/ql/lib/change-notes/{2024-09-16-final-classes.md => released/2.0.1.md} (83%) create mode 100644 swift/ql/src/change-notes/released/1.0.9.md diff --git a/cpp/ql/lib/CHANGELOG.md b/cpp/ql/lib/CHANGELOG.md index 9723b57f127a..5d39629f62b0 100644 --- a/cpp/ql/lib/CHANGELOG.md +++ b/cpp/ql/lib/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.1 + +No user-facing changes. + ## 2.0.0 ### Breaking Changes diff --git a/cpp/ql/lib/change-notes/released/2.0.1.md b/cpp/ql/lib/change-notes/released/2.0.1.md new file mode 100644 index 000000000000..b5b6d0dee915 --- /dev/null +++ b/cpp/ql/lib/change-notes/released/2.0.1.md @@ -0,0 +1,3 @@ +## 2.0.1 + +No user-facing changes. diff --git a/cpp/ql/lib/codeql-pack.release.yml b/cpp/ql/lib/codeql-pack.release.yml index 0abe6ccede0f..fe974a4dbf37 100644 --- a/cpp/ql/lib/codeql-pack.release.yml +++ b/cpp/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.0.0 +lastReleaseVersion: 2.0.1 diff --git a/cpp/ql/lib/qlpack.yml b/cpp/ql/lib/qlpack.yml index ed8138411292..f1a2ac3942f2 100644 --- a/cpp/ql/lib/qlpack.yml +++ b/cpp/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/cpp-all -version: 2.0.1-dev +version: 2.0.1 groups: cpp dbscheme: semmlecode.cpp.dbscheme extractor: cpp diff --git a/cpp/ql/src/CHANGELOG.md b/cpp/ql/src/CHANGELOG.md index 05f179aa8447..8eaccb0404dc 100644 --- a/cpp/ql/src/CHANGELOG.md +++ b/cpp/ql/src/CHANGELOG.md @@ -1,9 +1,15 @@ +## 1.2.4 + +### Minor Analysis Improvements + +* Fixed false positives in the `cpp/wrong-number-format-arguments` ("Too few arguments to formatting function") query when the formatting function has been declared implicitly. + ## 1.2.3 ### Minor Analysis Improvements -* Removed false positives caused by buffer accesses in unreachable code. -* Removed false positives caused by inconsistent type checking. +* Removed false positives caused by buffer accesses in unreachable code +* Removed false positives caused by inconsistent type checking * Add modeling of C functions that don't throw, thereby increasing the precision of the `cpp/incorrect-allocation-error-handling` ("Incorrect allocation-error handling") query. The query now produces additional true positives. ## 1.2.2 diff --git a/cpp/ql/src/change-notes/2024-09-26-wrong-number-format-arguments.md b/cpp/ql/src/change-notes/released/1.2.4.md similarity index 80% rename from cpp/ql/src/change-notes/2024-09-26-wrong-number-format-arguments.md rename to cpp/ql/src/change-notes/released/1.2.4.md index 826a2365e24b..a603dc14047a 100644 --- a/cpp/ql/src/change-notes/2024-09-26-wrong-number-format-arguments.md +++ b/cpp/ql/src/change-notes/released/1.2.4.md @@ -1,4 +1,5 @@ ---- -category: minorAnalysis ---- +## 1.2.4 + +### Minor Analysis Improvements + * Fixed false positives in the `cpp/wrong-number-format-arguments` ("Too few arguments to formatting function") query when the formatting function has been declared implicitly. diff --git a/cpp/ql/src/codeql-pack.release.yml b/cpp/ql/src/codeql-pack.release.yml index 09a7400b5941..172090f46b6d 100644 --- a/cpp/ql/src/codeql-pack.release.yml +++ b/cpp/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.2.3 +lastReleaseVersion: 1.2.4 diff --git a/cpp/ql/src/qlpack.yml b/cpp/ql/src/qlpack.yml index 0715feb8e013..e541f95cd85f 100644 --- a/cpp/ql/src/qlpack.yml +++ b/cpp/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/cpp-queries -version: 1.2.4-dev +version: 1.2.4 groups: - cpp - queries diff --git a/csharp/ql/campaigns/Solorigate/lib/CHANGELOG.md b/csharp/ql/campaigns/Solorigate/lib/CHANGELOG.md index c469ca5f4ffc..989d5e74408f 100644 --- a/csharp/ql/campaigns/Solorigate/lib/CHANGELOG.md +++ b/csharp/ql/campaigns/Solorigate/lib/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.7.26 + +No user-facing changes. + ## 1.7.25 No user-facing changes. diff --git a/csharp/ql/campaigns/Solorigate/lib/change-notes/released/1.7.26.md b/csharp/ql/campaigns/Solorigate/lib/change-notes/released/1.7.26.md new file mode 100644 index 000000000000..468fc7681dfb --- /dev/null +++ b/csharp/ql/campaigns/Solorigate/lib/change-notes/released/1.7.26.md @@ -0,0 +1,3 @@ +## 1.7.26 + +No user-facing changes. diff --git a/csharp/ql/campaigns/Solorigate/lib/codeql-pack.release.yml b/csharp/ql/campaigns/Solorigate/lib/codeql-pack.release.yml index 317528bce5fc..ca4c34e70d1b 100644 --- a/csharp/ql/campaigns/Solorigate/lib/codeql-pack.release.yml +++ b/csharp/ql/campaigns/Solorigate/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.7.25 +lastReleaseVersion: 1.7.26 diff --git a/csharp/ql/campaigns/Solorigate/lib/qlpack.yml b/csharp/ql/campaigns/Solorigate/lib/qlpack.yml index ca0697ac40be..871d2ed3619a 100644 --- a/csharp/ql/campaigns/Solorigate/lib/qlpack.yml +++ b/csharp/ql/campaigns/Solorigate/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-solorigate-all -version: 1.7.26-dev +version: 1.7.26 groups: - csharp - solorigate diff --git a/csharp/ql/campaigns/Solorigate/src/CHANGELOG.md b/csharp/ql/campaigns/Solorigate/src/CHANGELOG.md index c469ca5f4ffc..989d5e74408f 100644 --- a/csharp/ql/campaigns/Solorigate/src/CHANGELOG.md +++ b/csharp/ql/campaigns/Solorigate/src/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.7.26 + +No user-facing changes. + ## 1.7.25 No user-facing changes. diff --git a/csharp/ql/campaigns/Solorigate/src/change-notes/released/1.7.26.md b/csharp/ql/campaigns/Solorigate/src/change-notes/released/1.7.26.md new file mode 100644 index 000000000000..468fc7681dfb --- /dev/null +++ b/csharp/ql/campaigns/Solorigate/src/change-notes/released/1.7.26.md @@ -0,0 +1,3 @@ +## 1.7.26 + +No user-facing changes. diff --git a/csharp/ql/campaigns/Solorigate/src/codeql-pack.release.yml b/csharp/ql/campaigns/Solorigate/src/codeql-pack.release.yml index 317528bce5fc..ca4c34e70d1b 100644 --- a/csharp/ql/campaigns/Solorigate/src/codeql-pack.release.yml +++ b/csharp/ql/campaigns/Solorigate/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.7.25 +lastReleaseVersion: 1.7.26 diff --git a/csharp/ql/campaigns/Solorigate/src/qlpack.yml b/csharp/ql/campaigns/Solorigate/src/qlpack.yml index 221eca049fe5..00c3209afe98 100644 --- a/csharp/ql/campaigns/Solorigate/src/qlpack.yml +++ b/csharp/ql/campaigns/Solorigate/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-solorigate-queries -version: 1.7.26-dev +version: 1.7.26 groups: - csharp - solorigate diff --git a/csharp/ql/lib/CHANGELOG.md b/csharp/ql/lib/CHANGELOG.md index f27c109e2693..7e8378798830 100644 --- a/csharp/ql/lib/CHANGELOG.md +++ b/csharp/ql/lib/CHANGELOG.md @@ -1,3 +1,19 @@ +## 3.0.0 + +### Breaking Changes + +* C#: Add support for MaD directly on properties and indexers using *attributes*. Using `Attribute.Getter` or `Attribute.Setter` in the model `ext` field applies the model to the getter or setter for properties and indexers. Prior to this change `Attribute` models unintentionally worked for property setters (if the property is decorated with the matching attribute). That is, a model that uses the `Attribute` feature directly on a property for a property setter needs to be changed to `Attribute.Setter`. +* C#: Remove all CIL tables and related QL library functionality. + +### Deprecated APIs + +* The class `ThreatModelFlowSource` has been renamed to `ActiveThreatModelSource` to more clearly reflect it only contains the currently active threat model sources. `ThreatModelFlowSource` has been marked as deprecated. + +### Minor Analysis Improvements + +* `DataFlow::Node` instances are no longer created for library methods and fields that are not callable (either statically or dynamically) or otherwise referred to from source code. This may affect third-party queries that use these nodes to identify library methods or fields that are present in DLL files where those methods or fields are unreferenced. If this presents a problem, consider using `Callable` and other non-dataflow classes to identify such library entities. +* C#: Add extractor support for attributes on indexers. + ## 2.0.0 ### Breaking Changes diff --git a/csharp/ql/lib/change-notes/2024-09-10-ActiveThreatModelSource.md b/csharp/ql/lib/change-notes/2024-09-10-ActiveThreatModelSource.md deleted file mode 100644 index a51e3e1deaf0..000000000000 --- a/csharp/ql/lib/change-notes/2024-09-10-ActiveThreatModelSource.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: deprecated ---- -* The class `ThreatModelFlowSource` has been renamed to `ActiveThreatModelSource` to more clearly reflect it only contains the currently active threat model sources. `ThreatModelFlowSource` has been marked as deprecated. diff --git a/csharp/ql/lib/change-notes/2024-09-16-accessor-mad.md b/csharp/ql/lib/change-notes/2024-09-16-accessor-mad.md deleted file mode 100644 index 3ccdcffef24b..000000000000 --- a/csharp/ql/lib/change-notes/2024-09-16-accessor-mad.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: breaking ---- -* C#: Add support for MaD directly on properties and indexers using *attributes*. Using `Attribute.Getter` or `Attribute.Setter` in the model `ext` field applies the model to the getter or setter for properties and indexers. Prior to this change `Attribute` models unintentionally worked for property setters (if the property is decorated with the matching attribute). That is, a model that uses the `Attribute` feature directly on a property for a property setter needs to be changed to `Attribute.Setter`. diff --git a/csharp/ql/lib/change-notes/2024-09-16-delete-cil.md b/csharp/ql/lib/change-notes/2024-09-16-delete-cil.md deleted file mode 100644 index 288fc29e5cb9..000000000000 --- a/csharp/ql/lib/change-notes/2024-09-16-delete-cil.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: breaking ---- -* C#: Remove all CIL tables and related QL library functionality. diff --git a/csharp/ql/lib/change-notes/2024-09-16-indexer-attributes.md b/csharp/ql/lib/change-notes/2024-09-16-indexer-attributes.md deleted file mode 100644 index 4d1fbee6d4cb..000000000000 --- a/csharp/ql/lib/change-notes/2024-09-16-indexer-attributes.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: minorAnalysis ---- -* C#: Add extractor support for attributes on indexers. diff --git a/csharp/ql/lib/change-notes/2024-09-19-reduced-dataflow-nodes.md b/csharp/ql/lib/change-notes/2024-09-19-reduced-dataflow-nodes.md deleted file mode 100644 index da1c4cc54bc7..000000000000 --- a/csharp/ql/lib/change-notes/2024-09-19-reduced-dataflow-nodes.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: minorAnalysis ---- -* `DataFlow::Node` instances are no longer created for library methods and fields that are not callable (either statically or dynamically) or otherwise referred to from source code. This may affect third-party queries that use these nodes to identify library methods or fields that are present in DLL files where those methods or fields are unreferenced. If this presents a problem, consider using `Callable` and other non-dataflow classes to identify such library entities. diff --git a/csharp/ql/lib/change-notes/released/3.0.0.md b/csharp/ql/lib/change-notes/released/3.0.0.md new file mode 100644 index 000000000000..1042cc6d7248 --- /dev/null +++ b/csharp/ql/lib/change-notes/released/3.0.0.md @@ -0,0 +1,15 @@ +## 3.0.0 + +### Breaking Changes + +* C#: Add support for MaD directly on properties and indexers using *attributes*. Using `Attribute.Getter` or `Attribute.Setter` in the model `ext` field applies the model to the getter or setter for properties and indexers. Prior to this change `Attribute` models unintentionally worked for property setters (if the property is decorated with the matching attribute). That is, a model that uses the `Attribute` feature directly on a property for a property setter needs to be changed to `Attribute.Setter`. +* C#: Remove all CIL tables and related QL library functionality. + +### Deprecated APIs + +* The class `ThreatModelFlowSource` has been renamed to `ActiveThreatModelSource` to more clearly reflect it only contains the currently active threat model sources. `ThreatModelFlowSource` has been marked as deprecated. + +### Minor Analysis Improvements + +* `DataFlow::Node` instances are no longer created for library methods and fields that are not callable (either statically or dynamically) or otherwise referred to from source code. This may affect third-party queries that use these nodes to identify library methods or fields that are present in DLL files where those methods or fields are unreferenced. If this presents a problem, consider using `Callable` and other non-dataflow classes to identify such library entities. +* C#: Add extractor support for attributes on indexers. diff --git a/csharp/ql/lib/codeql-pack.release.yml b/csharp/ql/lib/codeql-pack.release.yml index 0abe6ccede0f..33d3a2cd1139 100644 --- a/csharp/ql/lib/codeql-pack.release.yml +++ b/csharp/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.0.0 +lastReleaseVersion: 3.0.0 diff --git a/csharp/ql/lib/qlpack.yml b/csharp/ql/lib/qlpack.yml index 9fdd0511ccd0..a8e9c68cfb44 100644 --- a/csharp/ql/lib/qlpack.yml +++ b/csharp/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-all -version: 2.0.1-dev +version: 3.0.0 groups: csharp dbscheme: semmlecode.csharp.dbscheme extractor: csharp diff --git a/csharp/ql/src/CHANGELOG.md b/csharp/ql/src/CHANGELOG.md index c1d05cc119ef..4c162b64d8f7 100644 --- a/csharp/ql/src/CHANGELOG.md +++ b/csharp/ql/src/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.0.9 + +### Minor Analysis Improvements + +* C#: The indexer and `Add` method on `System.Web.UI.AttributeCollection` is no longer considered an HTML sink. + ## 1.0.8 No user-facing changes. diff --git a/csharp/ql/src/change-notes/2024-09-25-attribute-collection-sink.md b/csharp/ql/src/change-notes/released/1.0.9.md similarity index 72% rename from csharp/ql/src/change-notes/2024-09-25-attribute-collection-sink.md rename to csharp/ql/src/change-notes/released/1.0.9.md index 35e959f6f3db..85944dc2a71d 100644 --- a/csharp/ql/src/change-notes/2024-09-25-attribute-collection-sink.md +++ b/csharp/ql/src/change-notes/released/1.0.9.md @@ -1,4 +1,5 @@ ---- -category: minorAnalysis ---- +## 1.0.9 + +### Minor Analysis Improvements + * C#: The indexer and `Add` method on `System.Web.UI.AttributeCollection` is no longer considered an HTML sink. diff --git a/csharp/ql/src/codeql-pack.release.yml b/csharp/ql/src/codeql-pack.release.yml index 5c55fbd52ed1..fb813c5ee050 100644 --- a/csharp/ql/src/codeql-pack.release.yml +++ b/csharp/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.8 +lastReleaseVersion: 1.0.9 diff --git a/csharp/ql/src/qlpack.yml b/csharp/ql/src/qlpack.yml index 363cfe14e3d1..82e9607d7ab7 100644 --- a/csharp/ql/src/qlpack.yml +++ b/csharp/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-queries -version: 1.0.9-dev +version: 1.0.9 groups: - csharp - queries diff --git a/go/ql/consistency-queries/CHANGELOG.md b/go/ql/consistency-queries/CHANGELOG.md index 7e87aa463576..9589b67148fa 100644 --- a/go/ql/consistency-queries/CHANGELOG.md +++ b/go/ql/consistency-queries/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.9 + +No user-facing changes. + ## 1.0.8 No user-facing changes. diff --git a/go/ql/consistency-queries/change-notes/released/1.0.9.md b/go/ql/consistency-queries/change-notes/released/1.0.9.md new file mode 100644 index 000000000000..ee073f7ec16d --- /dev/null +++ b/go/ql/consistency-queries/change-notes/released/1.0.9.md @@ -0,0 +1,3 @@ +## 1.0.9 + +No user-facing changes. diff --git a/go/ql/consistency-queries/codeql-pack.release.yml b/go/ql/consistency-queries/codeql-pack.release.yml index 5c55fbd52ed1..fb813c5ee050 100644 --- a/go/ql/consistency-queries/codeql-pack.release.yml +++ b/go/ql/consistency-queries/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.8 +lastReleaseVersion: 1.0.9 diff --git a/go/ql/consistency-queries/qlpack.yml b/go/ql/consistency-queries/qlpack.yml index b7a6550ede1a..9800f5090fac 100644 --- a/go/ql/consistency-queries/qlpack.yml +++ b/go/ql/consistency-queries/qlpack.yml @@ -1,5 +1,5 @@ name: codeql-go-consistency-queries -version: 1.0.9-dev +version: 1.0.9 groups: - go - queries diff --git a/go/ql/lib/CHANGELOG.md b/go/ql/lib/CHANGELOG.md index 6fe67e276c31..a9a8190e6acc 100644 --- a/go/ql/lib/CHANGELOG.md +++ b/go/ql/lib/CHANGELOG.md @@ -1,3 +1,13 @@ +## 2.1.0 + +### Deprecated APIs + +* The class `ThreatModelFlowSource` has been renamed to `ActiveThreatModelSource` to more clearly reflect it only contains the currently active threat model sources. `ThreatModelFlowSource` has been marked as deprecated. + +### Minor Analysis Improvements + +* A method in the method set of an embedded field of a struct should not be promoted to the method set of the struct if the struct has a method with the same name. This was not being enforced, which meant that there were two methods with the same qualified name, and models were sometimes being applied when they shouldn't have been. This has now been fixed. + ## 2.0.0 ### Breaking Changes @@ -9,13 +19,13 @@ * When a function or type has more than one anonymous type parameters, they were mistakenly being treated as the same type parameter. This has now been fixed. * Local source models for reading and parsing environment variables have been added for the following libraries: - * `os` - * `syscall` - * `github.com/caarlos0/env` - * `github.com/gobuffalo/envy` - * `github.com/hashicorp/go-envparse` - * `github.com/joho/godotenv` - * `github.com/kelseyhightower/envconfig` + * os + * syscall + * github.com/caarlos0/env + * github.com/gobuffalo/envy + * github.com/hashicorp/go-envparse + * github.com/joho/godotenv + * github.com/kelseyhightower/envconfig * Local source models have been added for the APIs which open files in the `io/fs`, `io/ioutil` and `os` packages in the Go standard library. You can optionally include threat models as appropriate when using the CodeQL CLI and in GitHub code scanning. For more information, see [Analyzing your code with CodeQL queries](https://docs.github.com/code-security/codeql-cli/getting-started-with-the-codeql-cli/analyzing-your-code-with-codeql-queries#including-model-packs-to-add-potential-sources-of-tainted-data>) and [Customizing your advanced setup for code scanning](https://docs.github.com/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#extending-codeql-coverage-with-threat-models). ### Bug Fixes diff --git a/go/ql/lib/change-notes/2024-09-10-ActiveThreatModelSource.md b/go/ql/lib/change-notes/2024-09-10-ActiveThreatModelSource.md deleted file mode 100644 index a51e3e1deaf0..000000000000 --- a/go/ql/lib/change-notes/2024-09-10-ActiveThreatModelSource.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: deprecated ---- -* The class `ThreatModelFlowSource` has been renamed to `ActiveThreatModelSource` to more clearly reflect it only contains the currently active threat model sources. `ThreatModelFlowSource` has been marked as deprecated. diff --git a/go/ql/lib/change-notes/2024-09-24-incorrectly-promoted-methods.md b/go/ql/lib/change-notes/released/2.1.0.md similarity index 55% rename from go/ql/lib/change-notes/2024-09-24-incorrectly-promoted-methods.md rename to go/ql/lib/change-notes/released/2.1.0.md index 32802982b75e..2feedfb0c15d 100644 --- a/go/ql/lib/change-notes/2024-09-24-incorrectly-promoted-methods.md +++ b/go/ql/lib/change-notes/released/2.1.0.md @@ -1,4 +1,9 @@ ---- -category: minorAnalysis ---- +## 2.1.0 + +### Deprecated APIs + +* The class `ThreatModelFlowSource` has been renamed to `ActiveThreatModelSource` to more clearly reflect it only contains the currently active threat model sources. `ThreatModelFlowSource` has been marked as deprecated. + +### Minor Analysis Improvements + * A method in the method set of an embedded field of a struct should not be promoted to the method set of the struct if the struct has a method with the same name. This was not being enforced, which meant that there were two methods with the same qualified name, and models were sometimes being applied when they shouldn't have been. This has now been fixed. diff --git a/go/ql/lib/codeql-pack.release.yml b/go/ql/lib/codeql-pack.release.yml index 0abe6ccede0f..487a1a58b2b8 100644 --- a/go/ql/lib/codeql-pack.release.yml +++ b/go/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.0.0 +lastReleaseVersion: 2.1.0 diff --git a/go/ql/lib/qlpack.yml b/go/ql/lib/qlpack.yml index d86c9a07eed9..b6987a250d1a 100644 --- a/go/ql/lib/qlpack.yml +++ b/go/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/go-all -version: 2.0.1-dev +version: 2.1.0 groups: go dbscheme: go.dbscheme extractor: go diff --git a/go/ql/src/CHANGELOG.md b/go/ql/src/CHANGELOG.md index cf6d235f496b..69a5ed3e9f83 100644 --- a/go/ql/src/CHANGELOG.md +++ b/go/ql/src/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.1.0 + +### Query Metadata Changes + +* The precision of the `go/incorrect-integer-conversion-query` query was decreased from `very-high` to `high`, since there is at least one known class of false positives involving dynamic bounds checking. + ## 1.0.8 No user-facing changes. diff --git a/go/ql/src/change-notes/2024-09-24-incorrect-integer-conversion-query-precision.md b/go/ql/src/change-notes/released/1.1.0.md similarity index 84% rename from go/ql/src/change-notes/2024-09-24-incorrect-integer-conversion-query-precision.md rename to go/ql/src/change-notes/released/1.1.0.md index b8acf46c9c5b..b29676add16e 100644 --- a/go/ql/src/change-notes/2024-09-24-incorrect-integer-conversion-query-precision.md +++ b/go/ql/src/change-notes/released/1.1.0.md @@ -1,4 +1,5 @@ ---- -category: queryMetadata ---- +## 1.1.0 + +### Query Metadata Changes + * The precision of the `go/incorrect-integer-conversion-query` query was decreased from `very-high` to `high`, since there is at least one known class of false positives involving dynamic bounds checking. diff --git a/go/ql/src/codeql-pack.release.yml b/go/ql/src/codeql-pack.release.yml index 5c55fbd52ed1..2ac15439f561 100644 --- a/go/ql/src/codeql-pack.release.yml +++ b/go/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.8 +lastReleaseVersion: 1.1.0 diff --git a/go/ql/src/qlpack.yml b/go/ql/src/qlpack.yml index cd5903f6d7f4..e783026f6cfd 100644 --- a/go/ql/src/qlpack.yml +++ b/go/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/go-queries -version: 1.0.9-dev +version: 1.1.0 groups: - go - queries diff --git a/java/ql/automodel/src/CHANGELOG.md b/java/ql/automodel/src/CHANGELOG.md index 0a51a6089138..4d632a2ae2d2 100644 --- a/java/ql/automodel/src/CHANGELOG.md +++ b/java/ql/automodel/src/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.9 + +No user-facing changes. + ## 1.0.8 No user-facing changes. diff --git a/java/ql/automodel/src/change-notes/released/1.0.9.md b/java/ql/automodel/src/change-notes/released/1.0.9.md new file mode 100644 index 000000000000..ee073f7ec16d --- /dev/null +++ b/java/ql/automodel/src/change-notes/released/1.0.9.md @@ -0,0 +1,3 @@ +## 1.0.9 + +No user-facing changes. diff --git a/java/ql/automodel/src/codeql-pack.release.yml b/java/ql/automodel/src/codeql-pack.release.yml index 5c55fbd52ed1..fb813c5ee050 100644 --- a/java/ql/automodel/src/codeql-pack.release.yml +++ b/java/ql/automodel/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.8 +lastReleaseVersion: 1.0.9 diff --git a/java/ql/automodel/src/qlpack.yml b/java/ql/automodel/src/qlpack.yml index 8e4863f23b81..1e1fdbb9f38d 100644 --- a/java/ql/automodel/src/qlpack.yml +++ b/java/ql/automodel/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/java-automodel-queries -version: 1.0.9-dev +version: 1.0.9 groups: - java - automodel diff --git a/java/ql/lib/CHANGELOG.md b/java/ql/lib/CHANGELOG.md index 418043171763..5441126d72c9 100644 --- a/java/ql/lib/CHANGELOG.md +++ b/java/ql/lib/CHANGELOG.md @@ -1,3 +1,17 @@ +## 4.1.0 + +### Deprecated APIs + +* The `Field.getSourceDeclaration()` predicate has been deprecated. The result was always the original field, so calls to it can simply be removed. +* The `Field.isSourceDeclaration()` predicate has been deprecated. It always holds. +* The `RefType.nestedName()` predicate has been deprecated, and `RefType.getNestedName()` added to replace it. +* The class `ThreatModelFlowSource` has been renamed to `ActiveThreatModelSource` to more clearly reflect it only contains the currently active threat model sources. `ThreatModelFlowSource` has been marked as deprecated. + +### New Features + +* The Java extractor and QL libraries now support Java 23. +* Kotlin versions up to 2.1.0\ *x* are now supported. + ## 4.0.0 ### Breaking Changes @@ -13,7 +27,7 @@ ### Major Analysis Improvements -* When a method exists as source code, we will no longer use a models-as-data (MaD) model of that method. This primarily affects query results when the analysis includes generated models for the source code being analysed. +* A generated (Models as Data) summary model is no longer used, if there exists a source code alternative. This primarily affects the analysis, when the analysis includes generated models for the source code being analysed. ## 3.0.2 diff --git a/java/ql/lib/change-notes/2024-09-10-ActiveThreatModelSource.md b/java/ql/lib/change-notes/2024-09-10-ActiveThreatModelSource.md deleted file mode 100644 index a51e3e1deaf0..000000000000 --- a/java/ql/lib/change-notes/2024-09-10-ActiveThreatModelSource.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: deprecated ---- -* The class `ThreatModelFlowSource` has been renamed to `ActiveThreatModelSource` to more clearly reflect it only contains the currently active threat model sources. `ThreatModelFlowSource` has been marked as deprecated. diff --git a/java/ql/lib/change-notes/2024-09-16-nestedName.md b/java/ql/lib/change-notes/2024-09-16-nestedName.md deleted file mode 100644 index 26e384e99da3..000000000000 --- a/java/ql/lib/change-notes/2024-09-16-nestedName.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: deprecated ---- -* The `RefType.nestedName()` predicate has been deprecated, and `RefType.getNestedName()` added to replace it. diff --git a/java/ql/lib/change-notes/2024-09-18-fields.md b/java/ql/lib/change-notes/2024-09-18-fields.md deleted file mode 100644 index d2367bf2b04e..000000000000 --- a/java/ql/lib/change-notes/2024-09-18-fields.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -category: deprecated ---- -* The `Field.getSourceDeclaration()` predicate has been deprecated. The result was always the original field, so calls to it can simply be removed. -* The `Field.isSourceDeclaration()` predicate has been deprecated. It always holds. diff --git a/java/ql/lib/change-notes/2024-09-20-kotlin-2.1.0.md b/java/ql/lib/change-notes/2024-09-20-kotlin-2.1.0.md deleted file mode 100644 index f9b19e63d320..000000000000 --- a/java/ql/lib/change-notes/2024-09-20-kotlin-2.1.0.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: feature ---- -* Kotlin versions up to 2.1.0\ *x* are now supported. diff --git a/java/ql/lib/change-notes/2024-09-25-java-23.md b/java/ql/lib/change-notes/2024-09-25-java-23.md deleted file mode 100644 index cc620c54d6e7..000000000000 --- a/java/ql/lib/change-notes/2024-09-25-java-23.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: feature ---- -* The Java extractor and QL libraries now support Java 23. diff --git a/java/ql/lib/change-notes/released/4.1.0.md b/java/ql/lib/change-notes/released/4.1.0.md new file mode 100644 index 000000000000..579567e1edd0 --- /dev/null +++ b/java/ql/lib/change-notes/released/4.1.0.md @@ -0,0 +1,13 @@ +## 4.1.0 + +### Deprecated APIs + +* The `Field.getSourceDeclaration()` predicate has been deprecated. The result was always the original field, so calls to it can simply be removed. +* The `Field.isSourceDeclaration()` predicate has been deprecated. It always holds. +* The `RefType.nestedName()` predicate has been deprecated, and `RefType.getNestedName()` added to replace it. +* The class `ThreatModelFlowSource` has been renamed to `ActiveThreatModelSource` to more clearly reflect it only contains the currently active threat model sources. `ThreatModelFlowSource` has been marked as deprecated. + +### New Features + +* The Java extractor and QL libraries now support Java 23. +* Kotlin versions up to 2.1.0\ *x* are now supported. diff --git a/java/ql/lib/codeql-pack.release.yml b/java/ql/lib/codeql-pack.release.yml index 49fe3eef6973..d5b1bf88d10e 100644 --- a/java/ql/lib/codeql-pack.release.yml +++ b/java/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 4.0.0 +lastReleaseVersion: 4.1.0 diff --git a/java/ql/lib/qlpack.yml b/java/ql/lib/qlpack.yml index 9189b611545b..9c69e18a30b8 100644 --- a/java/ql/lib/qlpack.yml +++ b/java/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/java-all -version: 4.0.1-dev +version: 4.1.0 groups: java dbscheme: config/semmlecode.dbscheme extractor: java diff --git a/java/ql/src/CHANGELOG.md b/java/ql/src/CHANGELOG.md index c33e27c7b655..20e7a248aebb 100644 --- a/java/ql/src/CHANGELOG.md +++ b/java/ql/src/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.1.6 + +### Minor Analysis Improvements + +* Added taint summary model for `org.springframework.core.io.InputStreamSource#getInputStream()`. + ## 1.1.5 No user-facing changes. diff --git a/java/ql/src/change-notes/2024-09-18-getInputStream-summary.md b/java/ql/src/change-notes/2024-09-18-getInputStream-summary.md deleted file mode 100644 index be8056173301..000000000000 --- a/java/ql/src/change-notes/2024-09-18-getInputStream-summary.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: minorAnalysis ---- -* Added taint summary model for `org.springframework.core.io.InputStreamSource#getInputStream()`. \ No newline at end of file diff --git a/java/ql/src/change-notes/released/1.1.6.md b/java/ql/src/change-notes/released/1.1.6.md new file mode 100644 index 000000000000..dc156b8a5bea --- /dev/null +++ b/java/ql/src/change-notes/released/1.1.6.md @@ -0,0 +1,5 @@ +## 1.1.6 + +### Minor Analysis Improvements + +* Added taint summary model for `org.springframework.core.io.InputStreamSource#getInputStream()`. diff --git a/java/ql/src/codeql-pack.release.yml b/java/ql/src/codeql-pack.release.yml index df39a9de059d..9e712a00a21d 100644 --- a/java/ql/src/codeql-pack.release.yml +++ b/java/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.1.5 +lastReleaseVersion: 1.1.6 diff --git a/java/ql/src/qlpack.yml b/java/ql/src/qlpack.yml index 28de019af811..635ef97836fe 100644 --- a/java/ql/src/qlpack.yml +++ b/java/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/java-queries -version: 1.1.6-dev +version: 1.1.6 groups: - java - queries diff --git a/javascript/ql/lib/CHANGELOG.md b/javascript/ql/lib/CHANGELOG.md index 105414b5b37f..bb77b4f1f496 100644 --- a/javascript/ql/lib/CHANGELOG.md +++ b/javascript/ql/lib/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.1 + +No user-facing changes. + ## 2.0.0 ### Breaking Changes diff --git a/javascript/ql/lib/change-notes/released/2.0.1.md b/javascript/ql/lib/change-notes/released/2.0.1.md new file mode 100644 index 000000000000..b5b6d0dee915 --- /dev/null +++ b/javascript/ql/lib/change-notes/released/2.0.1.md @@ -0,0 +1,3 @@ +## 2.0.1 + +No user-facing changes. diff --git a/javascript/ql/lib/codeql-pack.release.yml b/javascript/ql/lib/codeql-pack.release.yml index 0abe6ccede0f..fe974a4dbf37 100644 --- a/javascript/ql/lib/codeql-pack.release.yml +++ b/javascript/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.0.0 +lastReleaseVersion: 2.0.1 diff --git a/javascript/ql/lib/qlpack.yml b/javascript/ql/lib/qlpack.yml index 6355ae8868a9..a93cb421a869 100644 --- a/javascript/ql/lib/qlpack.yml +++ b/javascript/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/javascript-all -version: 2.0.1-dev +version: 2.0.1 groups: javascript dbscheme: semmlecode.javascript.dbscheme extractor: javascript diff --git a/javascript/ql/src/CHANGELOG.md b/javascript/ql/src/CHANGELOG.md index e337a585f634..adf7daa3eb43 100644 --- a/javascript/ql/src/CHANGELOG.md +++ b/javascript/ql/src/CHANGELOG.md @@ -1,8 +1,12 @@ +## 1.2.1 + +No user-facing changes. + ## 1.2.0 ### Major Analysis Improvements -- Added a new query (`js/actions/actions-artifact-leak`) to detect GitHub Actions artifacts that may leak the `GITHUB_TOKEN` token. +- Added a new query (`js/actions/actions-artifact-leak`) to detect GitHub Actions artifacts that may leak the GITHUB_TOKEN token. ## 1.1.3 diff --git a/javascript/ql/src/change-notes/released/1.2.1.md b/javascript/ql/src/change-notes/released/1.2.1.md new file mode 100644 index 000000000000..67aaa1465fd7 --- /dev/null +++ b/javascript/ql/src/change-notes/released/1.2.1.md @@ -0,0 +1,3 @@ +## 1.2.1 + +No user-facing changes. diff --git a/javascript/ql/src/codeql-pack.release.yml b/javascript/ql/src/codeql-pack.release.yml index 75430e73d1c4..73dd403938c9 100644 --- a/javascript/ql/src/codeql-pack.release.yml +++ b/javascript/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.2.0 +lastReleaseVersion: 1.2.1 diff --git a/javascript/ql/src/qlpack.yml b/javascript/ql/src/qlpack.yml index 9b1f749b8ac4..49489696e79a 100644 --- a/javascript/ql/src/qlpack.yml +++ b/javascript/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/javascript-queries -version: 1.2.1-dev +version: 1.2.1 groups: - javascript - queries diff --git a/misc/suite-helpers/CHANGELOG.md b/misc/suite-helpers/CHANGELOG.md index 1d5d3b7b3869..729794553521 100644 --- a/misc/suite-helpers/CHANGELOG.md +++ b/misc/suite-helpers/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.9 + +No user-facing changes. + ## 1.0.8 No user-facing changes. diff --git a/misc/suite-helpers/change-notes/released/1.0.9.md b/misc/suite-helpers/change-notes/released/1.0.9.md new file mode 100644 index 000000000000..ee073f7ec16d --- /dev/null +++ b/misc/suite-helpers/change-notes/released/1.0.9.md @@ -0,0 +1,3 @@ +## 1.0.9 + +No user-facing changes. diff --git a/misc/suite-helpers/codeql-pack.release.yml b/misc/suite-helpers/codeql-pack.release.yml index 5c55fbd52ed1..fb813c5ee050 100644 --- a/misc/suite-helpers/codeql-pack.release.yml +++ b/misc/suite-helpers/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.8 +lastReleaseVersion: 1.0.9 diff --git a/misc/suite-helpers/qlpack.yml b/misc/suite-helpers/qlpack.yml index a349dd3c6d23..a4d970e31297 100644 --- a/misc/suite-helpers/qlpack.yml +++ b/misc/suite-helpers/qlpack.yml @@ -1,4 +1,4 @@ name: codeql/suite-helpers -version: 1.0.9-dev +version: 1.0.9 groups: shared warnOnImplicitThis: true diff --git a/python/ql/lib/CHANGELOG.md b/python/ql/lib/CHANGELOG.md index bd673aa9edc1..4cadb40bc2f5 100644 --- a/python/ql/lib/CHANGELOG.md +++ b/python/ql/lib/CHANGELOG.md @@ -1,3 +1,13 @@ +## 2.1.0 + +### New Features + +* Added support for custom threat-models, which can be used in most of our taint-tracking queries, see our [documentation](https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#extending-codeql-coverage-with-threat-models) for more details. + +### Minor Analysis Improvements + +* The common sanitizer guard `StringConstCompareBarrier` has been renamed to `ConstCompareBarrier` and expanded to cover comparisons with other constant values such as `None`. This may result in fewer false positive results for several queries. + ## 2.0.0 ### Breaking Changes diff --git a/python/ql/lib/change-notes/2024-09-20-const-compare-gaurd.md b/python/ql/lib/change-notes/2024-09-20-const-compare-gaurd.md deleted file mode 100644 index 2adb7fa82a88..000000000000 --- a/python/ql/lib/change-notes/2024-09-20-const-compare-gaurd.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: minorAnalysis ---- -* The common sanitizer guard `StringConstCompareBarrier` has been renamed to `ConstCompareBarrier` and expanded to cover comparisons with other constant values such as `None`. This may result in fewer false positive results for several queries. \ No newline at end of file diff --git a/python/ql/lib/change-notes/2024-08-16-threat-models.md b/python/ql/lib/change-notes/released/2.1.0.md similarity index 52% rename from python/ql/lib/change-notes/2024-08-16-threat-models.md rename to python/ql/lib/change-notes/released/2.1.0.md index ba01e6f6fbda..e399bad51197 100644 --- a/python/ql/lib/change-notes/2024-08-16-threat-models.md +++ b/python/ql/lib/change-notes/released/2.1.0.md @@ -1,4 +1,9 @@ ---- -category: feature ---- +## 2.1.0 + +### New Features + * Added support for custom threat-models, which can be used in most of our taint-tracking queries, see our [documentation](https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#extending-codeql-coverage-with-threat-models) for more details. + +### Minor Analysis Improvements + +* The common sanitizer guard `StringConstCompareBarrier` has been renamed to `ConstCompareBarrier` and expanded to cover comparisons with other constant values such as `None`. This may result in fewer false positive results for several queries. diff --git a/python/ql/lib/codeql-pack.release.yml b/python/ql/lib/codeql-pack.release.yml index 0abe6ccede0f..487a1a58b2b8 100644 --- a/python/ql/lib/codeql-pack.release.yml +++ b/python/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.0.0 +lastReleaseVersion: 2.1.0 diff --git a/python/ql/lib/qlpack.yml b/python/ql/lib/qlpack.yml index 5c71504afecc..316f7a1cc1e6 100644 --- a/python/ql/lib/qlpack.yml +++ b/python/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/python-all -version: 2.0.1-dev +version: 2.1.0 groups: python dbscheme: semmlecode.python.dbscheme extractor: python diff --git a/python/ql/src/CHANGELOG.md b/python/ql/src/CHANGELOG.md index 045938a0cde6..21c9ebcf16f9 100644 --- a/python/ql/src/CHANGELOG.md +++ b/python/ql/src/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.3.0 + +### New Queries + +* The `py/cors-misconfiguration-with-credentials` query, which finds insecure CORS middleware configurations. + ## 1.2.2 ### Minor Analysis Improvements diff --git a/python/ql/src/change-notes/2024-08-26-Cors-misconfiguration-middleware.md b/python/ql/src/change-notes/2024-08-26-Cors-misconfiguration-middleware.md deleted file mode 100644 index aa8bc7198b31..000000000000 --- a/python/ql/src/change-notes/2024-08-26-Cors-misconfiguration-middleware.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: newQuery ---- -* The `py/cors-misconfiguration-with-credentials` query, which finds insecure CORS middleware configurations. \ No newline at end of file diff --git a/python/ql/src/change-notes/released/1.3.0.md b/python/ql/src/change-notes/released/1.3.0.md new file mode 100644 index 000000000000..5679632843a0 --- /dev/null +++ b/python/ql/src/change-notes/released/1.3.0.md @@ -0,0 +1,5 @@ +## 1.3.0 + +### New Queries + +* The `py/cors-misconfiguration-with-credentials` query, which finds insecure CORS middleware configurations. diff --git a/python/ql/src/codeql-pack.release.yml b/python/ql/src/codeql-pack.release.yml index 0a70a9a01a7e..ec16350ed6fd 100644 --- a/python/ql/src/codeql-pack.release.yml +++ b/python/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.2.2 +lastReleaseVersion: 1.3.0 diff --git a/python/ql/src/qlpack.yml b/python/ql/src/qlpack.yml index 17a8639b4160..02c861d40e1d 100644 --- a/python/ql/src/qlpack.yml +++ b/python/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/python-queries -version: 1.2.3-dev +version: 1.3.0 groups: - python - queries diff --git a/ruby/ql/lib/CHANGELOG.md b/ruby/ql/lib/CHANGELOG.md index 160b3b2b6e73..59c058c1c45c 100644 --- a/ruby/ql/lib/CHANGELOG.md +++ b/ruby/ql/lib/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.1 + +No user-facing changes. + ## 2.0.0 ### Breaking Changes diff --git a/ruby/ql/lib/change-notes/released/2.0.1.md b/ruby/ql/lib/change-notes/released/2.0.1.md new file mode 100644 index 000000000000..b5b6d0dee915 --- /dev/null +++ b/ruby/ql/lib/change-notes/released/2.0.1.md @@ -0,0 +1,3 @@ +## 2.0.1 + +No user-facing changes. diff --git a/ruby/ql/lib/codeql-pack.release.yml b/ruby/ql/lib/codeql-pack.release.yml index 0abe6ccede0f..fe974a4dbf37 100644 --- a/ruby/ql/lib/codeql-pack.release.yml +++ b/ruby/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.0.0 +lastReleaseVersion: 2.0.1 diff --git a/ruby/ql/lib/qlpack.yml b/ruby/ql/lib/qlpack.yml index aa67854634a3..da808214ea50 100644 --- a/ruby/ql/lib/qlpack.yml +++ b/ruby/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/ruby-all -version: 2.0.1-dev +version: 2.0.1 groups: ruby extractor: ruby dbscheme: ruby.dbscheme diff --git a/ruby/ql/src/CHANGELOG.md b/ruby/ql/src/CHANGELOG.md index 2598b88aa0bd..5e9c68a56a01 100644 --- a/ruby/ql/src/CHANGELOG.md +++ b/ruby/ql/src/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.1.4 + +No user-facing changes. + ## 1.1.3 No user-facing changes. diff --git a/ruby/ql/src/change-notes/released/1.1.4.md b/ruby/ql/src/change-notes/released/1.1.4.md new file mode 100644 index 000000000000..b95051903c5a --- /dev/null +++ b/ruby/ql/src/change-notes/released/1.1.4.md @@ -0,0 +1,3 @@ +## 1.1.4 + +No user-facing changes. diff --git a/ruby/ql/src/codeql-pack.release.yml b/ruby/ql/src/codeql-pack.release.yml index 35e710ab1bf0..26cbcd3f123b 100644 --- a/ruby/ql/src/codeql-pack.release.yml +++ b/ruby/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.1.3 +lastReleaseVersion: 1.1.4 diff --git a/ruby/ql/src/qlpack.yml b/ruby/ql/src/qlpack.yml index 6fe83794b898..47651d248c01 100644 --- a/ruby/ql/src/qlpack.yml +++ b/ruby/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/ruby-queries -version: 1.1.4-dev +version: 1.1.4 groups: - ruby - queries diff --git a/shared/controlflow/CHANGELOG.md b/shared/controlflow/CHANGELOG.md index 15a3aca14c62..52b731626290 100644 --- a/shared/controlflow/CHANGELOG.md +++ b/shared/controlflow/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.9 + +No user-facing changes. + ## 1.0.8 No user-facing changes. diff --git a/shared/controlflow/change-notes/released/1.0.9.md b/shared/controlflow/change-notes/released/1.0.9.md new file mode 100644 index 000000000000..ee073f7ec16d --- /dev/null +++ b/shared/controlflow/change-notes/released/1.0.9.md @@ -0,0 +1,3 @@ +## 1.0.9 + +No user-facing changes. diff --git a/shared/controlflow/codeql-pack.release.yml b/shared/controlflow/codeql-pack.release.yml index 5c55fbd52ed1..fb813c5ee050 100644 --- a/shared/controlflow/codeql-pack.release.yml +++ b/shared/controlflow/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.8 +lastReleaseVersion: 1.0.9 diff --git a/shared/controlflow/qlpack.yml b/shared/controlflow/qlpack.yml index 8e88b6d4da37..fc8bdde934d4 100644 --- a/shared/controlflow/qlpack.yml +++ b/shared/controlflow/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/controlflow -version: 1.0.9-dev +version: 1.0.9 groups: shared library: true dependencies: diff --git a/shared/dataflow/CHANGELOG.md b/shared/dataflow/CHANGELOG.md index 594e7e40d60e..360dc9cc8bff 100644 --- a/shared/dataflow/CHANGELOG.md +++ b/shared/dataflow/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.1.3 + +No user-facing changes. + ## 1.1.2 No user-facing changes. diff --git a/shared/dataflow/change-notes/released/1.1.3.md b/shared/dataflow/change-notes/released/1.1.3.md new file mode 100644 index 000000000000..e8f1701bd624 --- /dev/null +++ b/shared/dataflow/change-notes/released/1.1.3.md @@ -0,0 +1,3 @@ +## 1.1.3 + +No user-facing changes. diff --git a/shared/dataflow/codeql-pack.release.yml b/shared/dataflow/codeql-pack.release.yml index 53ab127707fc..35e710ab1bf0 100644 --- a/shared/dataflow/codeql-pack.release.yml +++ b/shared/dataflow/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.1.2 +lastReleaseVersion: 1.1.3 diff --git a/shared/dataflow/qlpack.yml b/shared/dataflow/qlpack.yml index 025663097319..2ad3f8bc73c0 100644 --- a/shared/dataflow/qlpack.yml +++ b/shared/dataflow/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/dataflow -version: 1.1.3-dev +version: 1.1.3 groups: shared library: true dependencies: diff --git a/shared/mad/CHANGELOG.md b/shared/mad/CHANGELOG.md index 74187f361120..7857f62905c7 100644 --- a/shared/mad/CHANGELOG.md +++ b/shared/mad/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.9 + +No user-facing changes. + ## 1.0.8 No user-facing changes. diff --git a/shared/mad/change-notes/released/1.0.9.md b/shared/mad/change-notes/released/1.0.9.md new file mode 100644 index 000000000000..ee073f7ec16d --- /dev/null +++ b/shared/mad/change-notes/released/1.0.9.md @@ -0,0 +1,3 @@ +## 1.0.9 + +No user-facing changes. diff --git a/shared/mad/codeql-pack.release.yml b/shared/mad/codeql-pack.release.yml index 5c55fbd52ed1..fb813c5ee050 100644 --- a/shared/mad/codeql-pack.release.yml +++ b/shared/mad/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.8 +lastReleaseVersion: 1.0.9 diff --git a/shared/mad/qlpack.yml b/shared/mad/qlpack.yml index e1bb442e4aee..ed0c1f7113c5 100644 --- a/shared/mad/qlpack.yml +++ b/shared/mad/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/mad -version: 1.0.9-dev +version: 1.0.9 groups: shared library: true dependencies: diff --git a/shared/rangeanalysis/CHANGELOG.md b/shared/rangeanalysis/CHANGELOG.md index 8a3b99e0bdf0..5878f9b564c0 100644 --- a/shared/rangeanalysis/CHANGELOG.md +++ b/shared/rangeanalysis/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.9 + +No user-facing changes. + ## 1.0.8 No user-facing changes. diff --git a/shared/rangeanalysis/change-notes/released/1.0.9.md b/shared/rangeanalysis/change-notes/released/1.0.9.md new file mode 100644 index 000000000000..ee073f7ec16d --- /dev/null +++ b/shared/rangeanalysis/change-notes/released/1.0.9.md @@ -0,0 +1,3 @@ +## 1.0.9 + +No user-facing changes. diff --git a/shared/rangeanalysis/codeql-pack.release.yml b/shared/rangeanalysis/codeql-pack.release.yml index 5c55fbd52ed1..fb813c5ee050 100644 --- a/shared/rangeanalysis/codeql-pack.release.yml +++ b/shared/rangeanalysis/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.8 +lastReleaseVersion: 1.0.9 diff --git a/shared/rangeanalysis/qlpack.yml b/shared/rangeanalysis/qlpack.yml index e443eea184f0..aaf1b1903576 100644 --- a/shared/rangeanalysis/qlpack.yml +++ b/shared/rangeanalysis/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/rangeanalysis -version: 1.0.9-dev +version: 1.0.9 groups: shared library: true dependencies: diff --git a/shared/regex/CHANGELOG.md b/shared/regex/CHANGELOG.md index f0b74ab2c7e4..01154f6c5f52 100644 --- a/shared/regex/CHANGELOG.md +++ b/shared/regex/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.9 + +No user-facing changes. + ## 1.0.8 No user-facing changes. diff --git a/shared/regex/change-notes/released/1.0.9.md b/shared/regex/change-notes/released/1.0.9.md new file mode 100644 index 000000000000..ee073f7ec16d --- /dev/null +++ b/shared/regex/change-notes/released/1.0.9.md @@ -0,0 +1,3 @@ +## 1.0.9 + +No user-facing changes. diff --git a/shared/regex/codeql-pack.release.yml b/shared/regex/codeql-pack.release.yml index 5c55fbd52ed1..fb813c5ee050 100644 --- a/shared/regex/codeql-pack.release.yml +++ b/shared/regex/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.8 +lastReleaseVersion: 1.0.9 diff --git a/shared/regex/qlpack.yml b/shared/regex/qlpack.yml index 56deb3800a17..d8b03f4ad2f5 100644 --- a/shared/regex/qlpack.yml +++ b/shared/regex/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/regex -version: 1.0.9-dev +version: 1.0.9 groups: shared library: true dependencies: diff --git a/shared/ssa/CHANGELOG.md b/shared/ssa/CHANGELOG.md index 8d36e2ab664a..85bef6a32845 100644 --- a/shared/ssa/CHANGELOG.md +++ b/shared/ssa/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.9 + +No user-facing changes. + ## 1.0.8 No user-facing changes. diff --git a/shared/ssa/change-notes/released/1.0.9.md b/shared/ssa/change-notes/released/1.0.9.md new file mode 100644 index 000000000000..ee073f7ec16d --- /dev/null +++ b/shared/ssa/change-notes/released/1.0.9.md @@ -0,0 +1,3 @@ +## 1.0.9 + +No user-facing changes. diff --git a/shared/ssa/codeql-pack.release.yml b/shared/ssa/codeql-pack.release.yml index 5c55fbd52ed1..fb813c5ee050 100644 --- a/shared/ssa/codeql-pack.release.yml +++ b/shared/ssa/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.8 +lastReleaseVersion: 1.0.9 diff --git a/shared/ssa/qlpack.yml b/shared/ssa/qlpack.yml index f412d56b9952..1bd2bea757b3 100644 --- a/shared/ssa/qlpack.yml +++ b/shared/ssa/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/ssa -version: 1.0.9-dev +version: 1.0.9 groups: shared library: true dependencies: diff --git a/shared/threat-models/CHANGELOG.md b/shared/threat-models/CHANGELOG.md index 7e87aa463576..9589b67148fa 100644 --- a/shared/threat-models/CHANGELOG.md +++ b/shared/threat-models/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.9 + +No user-facing changes. + ## 1.0.8 No user-facing changes. diff --git a/shared/threat-models/change-notes/released/1.0.9.md b/shared/threat-models/change-notes/released/1.0.9.md new file mode 100644 index 000000000000..ee073f7ec16d --- /dev/null +++ b/shared/threat-models/change-notes/released/1.0.9.md @@ -0,0 +1,3 @@ +## 1.0.9 + +No user-facing changes. diff --git a/shared/threat-models/codeql-pack.release.yml b/shared/threat-models/codeql-pack.release.yml index 5c55fbd52ed1..fb813c5ee050 100644 --- a/shared/threat-models/codeql-pack.release.yml +++ b/shared/threat-models/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.8 +lastReleaseVersion: 1.0.9 diff --git a/shared/threat-models/qlpack.yml b/shared/threat-models/qlpack.yml index 0035335c6e3f..434466938b1c 100644 --- a/shared/threat-models/qlpack.yml +++ b/shared/threat-models/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/threat-models -version: 1.0.9-dev +version: 1.0.9 library: true groups: shared dataExtensions: diff --git a/shared/tutorial/CHANGELOG.md b/shared/tutorial/CHANGELOG.md index 93d06a2b74f3..ba77e020439d 100644 --- a/shared/tutorial/CHANGELOG.md +++ b/shared/tutorial/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.9 + +No user-facing changes. + ## 1.0.8 No user-facing changes. diff --git a/shared/tutorial/change-notes/released/1.0.9.md b/shared/tutorial/change-notes/released/1.0.9.md new file mode 100644 index 000000000000..ee073f7ec16d --- /dev/null +++ b/shared/tutorial/change-notes/released/1.0.9.md @@ -0,0 +1,3 @@ +## 1.0.9 + +No user-facing changes. diff --git a/shared/tutorial/codeql-pack.release.yml b/shared/tutorial/codeql-pack.release.yml index 5c55fbd52ed1..fb813c5ee050 100644 --- a/shared/tutorial/codeql-pack.release.yml +++ b/shared/tutorial/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.8 +lastReleaseVersion: 1.0.9 diff --git a/shared/tutorial/qlpack.yml b/shared/tutorial/qlpack.yml index 6f745d6c77e8..9a89b262a321 100644 --- a/shared/tutorial/qlpack.yml +++ b/shared/tutorial/qlpack.yml @@ -1,7 +1,7 @@ name: codeql/tutorial description: Library for the CodeQL detective tutorials, helping new users learn to write CodeQL queries. -version: 1.0.9-dev +version: 1.0.9 groups: shared library: true warnOnImplicitThis: true diff --git a/shared/typeflow/CHANGELOG.md b/shared/typeflow/CHANGELOG.md index de58be267d73..93c030dee3e4 100644 --- a/shared/typeflow/CHANGELOG.md +++ b/shared/typeflow/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.9 + +No user-facing changes. + ## 1.0.8 No user-facing changes. diff --git a/shared/typeflow/change-notes/released/1.0.9.md b/shared/typeflow/change-notes/released/1.0.9.md new file mode 100644 index 000000000000..ee073f7ec16d --- /dev/null +++ b/shared/typeflow/change-notes/released/1.0.9.md @@ -0,0 +1,3 @@ +## 1.0.9 + +No user-facing changes. diff --git a/shared/typeflow/codeql-pack.release.yml b/shared/typeflow/codeql-pack.release.yml index 5c55fbd52ed1..fb813c5ee050 100644 --- a/shared/typeflow/codeql-pack.release.yml +++ b/shared/typeflow/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.8 +lastReleaseVersion: 1.0.9 diff --git a/shared/typeflow/qlpack.yml b/shared/typeflow/qlpack.yml index 71d74cb3af5b..21b1ddbc9654 100644 --- a/shared/typeflow/qlpack.yml +++ b/shared/typeflow/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/typeflow -version: 1.0.9-dev +version: 1.0.9 groups: shared library: true dependencies: diff --git a/shared/typetracking/CHANGELOG.md b/shared/typetracking/CHANGELOG.md index 0135f24d76b0..a4e57c221876 100644 --- a/shared/typetracking/CHANGELOG.md +++ b/shared/typetracking/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.9 + +No user-facing changes. + ## 1.0.8 No user-facing changes. diff --git a/shared/typetracking/change-notes/released/1.0.9.md b/shared/typetracking/change-notes/released/1.0.9.md new file mode 100644 index 000000000000..ee073f7ec16d --- /dev/null +++ b/shared/typetracking/change-notes/released/1.0.9.md @@ -0,0 +1,3 @@ +## 1.0.9 + +No user-facing changes. diff --git a/shared/typetracking/codeql-pack.release.yml b/shared/typetracking/codeql-pack.release.yml index 5c55fbd52ed1..fb813c5ee050 100644 --- a/shared/typetracking/codeql-pack.release.yml +++ b/shared/typetracking/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.8 +lastReleaseVersion: 1.0.9 diff --git a/shared/typetracking/qlpack.yml b/shared/typetracking/qlpack.yml index 3f61875e42fb..6f7282c54e9e 100644 --- a/shared/typetracking/qlpack.yml +++ b/shared/typetracking/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/typetracking -version: 1.0.9-dev +version: 1.0.9 groups: shared library: true dependencies: diff --git a/shared/typos/CHANGELOG.md b/shared/typos/CHANGELOG.md index 415174b3b07d..acee82ce867b 100644 --- a/shared/typos/CHANGELOG.md +++ b/shared/typos/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.9 + +No user-facing changes. + ## 1.0.8 No user-facing changes. diff --git a/shared/typos/change-notes/released/1.0.9.md b/shared/typos/change-notes/released/1.0.9.md new file mode 100644 index 000000000000..ee073f7ec16d --- /dev/null +++ b/shared/typos/change-notes/released/1.0.9.md @@ -0,0 +1,3 @@ +## 1.0.9 + +No user-facing changes. diff --git a/shared/typos/codeql-pack.release.yml b/shared/typos/codeql-pack.release.yml index 5c55fbd52ed1..fb813c5ee050 100644 --- a/shared/typos/codeql-pack.release.yml +++ b/shared/typos/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.8 +lastReleaseVersion: 1.0.9 diff --git a/shared/typos/qlpack.yml b/shared/typos/qlpack.yml index 4df1e7c6e6a6..3e644f92d6d1 100644 --- a/shared/typos/qlpack.yml +++ b/shared/typos/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/typos -version: 1.0.9-dev +version: 1.0.9 groups: shared library: true warnOnImplicitThis: true diff --git a/shared/util/CHANGELOG.md b/shared/util/CHANGELOG.md index 5213509f1c7b..2f918fd0416f 100644 --- a/shared/util/CHANGELOG.md +++ b/shared/util/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.9 + +No user-facing changes. + ## 1.0.8 No user-facing changes. diff --git a/shared/util/change-notes/released/1.0.9.md b/shared/util/change-notes/released/1.0.9.md new file mode 100644 index 000000000000..ee073f7ec16d --- /dev/null +++ b/shared/util/change-notes/released/1.0.9.md @@ -0,0 +1,3 @@ +## 1.0.9 + +No user-facing changes. diff --git a/shared/util/codeql-pack.release.yml b/shared/util/codeql-pack.release.yml index 5c55fbd52ed1..fb813c5ee050 100644 --- a/shared/util/codeql-pack.release.yml +++ b/shared/util/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.8 +lastReleaseVersion: 1.0.9 diff --git a/shared/util/qlpack.yml b/shared/util/qlpack.yml index 2e46755f89fe..ab191310e567 100644 --- a/shared/util/qlpack.yml +++ b/shared/util/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/util -version: 1.0.9-dev +version: 1.0.9 groups: shared library: true dependencies: null diff --git a/shared/xml/CHANGELOG.md b/shared/xml/CHANGELOG.md index e776ce85b589..90afd761e7d4 100644 --- a/shared/xml/CHANGELOG.md +++ b/shared/xml/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.9 + +No user-facing changes. + ## 1.0.8 No user-facing changes. diff --git a/shared/xml/change-notes/released/1.0.9.md b/shared/xml/change-notes/released/1.0.9.md new file mode 100644 index 000000000000..ee073f7ec16d --- /dev/null +++ b/shared/xml/change-notes/released/1.0.9.md @@ -0,0 +1,3 @@ +## 1.0.9 + +No user-facing changes. diff --git a/shared/xml/codeql-pack.release.yml b/shared/xml/codeql-pack.release.yml index 5c55fbd52ed1..fb813c5ee050 100644 --- a/shared/xml/codeql-pack.release.yml +++ b/shared/xml/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.8 +lastReleaseVersion: 1.0.9 diff --git a/shared/xml/qlpack.yml b/shared/xml/qlpack.yml index 50b2e44a4b77..f43260879fb6 100644 --- a/shared/xml/qlpack.yml +++ b/shared/xml/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/xml -version: 1.0.9-dev +version: 1.0.9 groups: shared library: true dependencies: diff --git a/shared/yaml/CHANGELOG.md b/shared/yaml/CHANGELOG.md index 3b774c7dc4c7..222c0ec037c6 100644 --- a/shared/yaml/CHANGELOG.md +++ b/shared/yaml/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.9 + +No user-facing changes. + ## 1.0.8 No user-facing changes. diff --git a/shared/yaml/change-notes/released/1.0.9.md b/shared/yaml/change-notes/released/1.0.9.md new file mode 100644 index 000000000000..ee073f7ec16d --- /dev/null +++ b/shared/yaml/change-notes/released/1.0.9.md @@ -0,0 +1,3 @@ +## 1.0.9 + +No user-facing changes. diff --git a/shared/yaml/codeql-pack.release.yml b/shared/yaml/codeql-pack.release.yml index 5c55fbd52ed1..fb813c5ee050 100644 --- a/shared/yaml/codeql-pack.release.yml +++ b/shared/yaml/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.8 +lastReleaseVersion: 1.0.9 diff --git a/shared/yaml/qlpack.yml b/shared/yaml/qlpack.yml index 4fa80cf5c0c9..4a63da564e55 100644 --- a/shared/yaml/qlpack.yml +++ b/shared/yaml/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/yaml -version: 1.0.9-dev +version: 1.0.9 groups: shared library: true warnOnImplicitThis: true diff --git a/swift/ql/lib/CHANGELOG.md b/swift/ql/lib/CHANGELOG.md index 07ce1b3e9dee..5602ebc7d231 100644 --- a/swift/ql/lib/CHANGELOG.md +++ b/swift/ql/lib/CHANGELOG.md @@ -1,3 +1,9 @@ +## 2.0.1 + +### Minor Analysis Improvements + +* All AST classes in `codeql.swift.elements` are now `final`, which means that it is no longer possible to `override` predicates defined in those classes (it is, however, still possible to `extend` the classes). + ## 2.0.0 ### Breaking Changes diff --git a/swift/ql/lib/change-notes/2024-09-16-final-classes.md b/swift/ql/lib/change-notes/released/2.0.1.md similarity index 83% rename from swift/ql/lib/change-notes/2024-09-16-final-classes.md rename to swift/ql/lib/change-notes/released/2.0.1.md index 32f46efd9796..ea35dc1370bd 100644 --- a/swift/ql/lib/change-notes/2024-09-16-final-classes.md +++ b/swift/ql/lib/change-notes/released/2.0.1.md @@ -1,4 +1,5 @@ ---- -category: minorAnalysis ---- +## 2.0.1 + +### Minor Analysis Improvements + * All AST classes in `codeql.swift.elements` are now `final`, which means that it is no longer possible to `override` predicates defined in those classes (it is, however, still possible to `extend` the classes). diff --git a/swift/ql/lib/codeql-pack.release.yml b/swift/ql/lib/codeql-pack.release.yml index 0abe6ccede0f..fe974a4dbf37 100644 --- a/swift/ql/lib/codeql-pack.release.yml +++ b/swift/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.0.0 +lastReleaseVersion: 2.0.1 diff --git a/swift/ql/lib/qlpack.yml b/swift/ql/lib/qlpack.yml index dac64ed9ea91..dd1896b3c291 100644 --- a/swift/ql/lib/qlpack.yml +++ b/swift/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/swift-all -version: 2.0.1-dev +version: 2.0.1 groups: swift extractor: swift dbscheme: swift.dbscheme diff --git a/swift/ql/src/CHANGELOG.md b/swift/ql/src/CHANGELOG.md index 6e8b43032bde..b47f96f9eb9e 100644 --- a/swift/ql/src/CHANGELOG.md +++ b/swift/ql/src/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.9 + +No user-facing changes. + ## 1.0.8 No user-facing changes. diff --git a/swift/ql/src/change-notes/released/1.0.9.md b/swift/ql/src/change-notes/released/1.0.9.md new file mode 100644 index 000000000000..ee073f7ec16d --- /dev/null +++ b/swift/ql/src/change-notes/released/1.0.9.md @@ -0,0 +1,3 @@ +## 1.0.9 + +No user-facing changes. diff --git a/swift/ql/src/codeql-pack.release.yml b/swift/ql/src/codeql-pack.release.yml index 5c55fbd52ed1..fb813c5ee050 100644 --- a/swift/ql/src/codeql-pack.release.yml +++ b/swift/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.8 +lastReleaseVersion: 1.0.9 diff --git a/swift/ql/src/qlpack.yml b/swift/ql/src/qlpack.yml index ff1a0b18e740..8f33acf16a69 100644 --- a/swift/ql/src/qlpack.yml +++ b/swift/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/swift-queries -version: 1.0.9-dev +version: 1.0.9 groups: - swift - queries From 98d587c482264fe107e47e866e25e01ebd7adc00 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 2 Oct 2024 22:40:35 +0000 Subject: [PATCH 58/79] Post-release preparation for codeql-cli-2.19.1 --- cpp/ql/lib/qlpack.yml | 2 +- cpp/ql/src/qlpack.yml | 2 +- csharp/ql/campaigns/Solorigate/lib/qlpack.yml | 2 +- csharp/ql/campaigns/Solorigate/src/qlpack.yml | 2 +- csharp/ql/lib/qlpack.yml | 2 +- csharp/ql/src/qlpack.yml | 2 +- go/ql/consistency-queries/qlpack.yml | 2 +- go/ql/lib/qlpack.yml | 2 +- go/ql/src/qlpack.yml | 2 +- java/ql/automodel/src/qlpack.yml | 2 +- java/ql/lib/qlpack.yml | 2 +- java/ql/src/qlpack.yml | 2 +- javascript/ql/lib/qlpack.yml | 2 +- javascript/ql/src/qlpack.yml | 2 +- misc/suite-helpers/qlpack.yml | 2 +- python/ql/lib/qlpack.yml | 2 +- python/ql/src/qlpack.yml | 2 +- ruby/ql/lib/qlpack.yml | 2 +- ruby/ql/src/qlpack.yml | 2 +- shared/controlflow/qlpack.yml | 2 +- shared/dataflow/qlpack.yml | 2 +- shared/mad/qlpack.yml | 2 +- shared/rangeanalysis/qlpack.yml | 2 +- shared/regex/qlpack.yml | 2 +- shared/ssa/qlpack.yml | 2 +- shared/threat-models/qlpack.yml | 2 +- shared/tutorial/qlpack.yml | 2 +- shared/typeflow/qlpack.yml | 2 +- shared/typetracking/qlpack.yml | 2 +- shared/typos/qlpack.yml | 2 +- shared/util/qlpack.yml | 2 +- shared/xml/qlpack.yml | 2 +- shared/yaml/qlpack.yml | 2 +- swift/ql/lib/qlpack.yml | 2 +- swift/ql/src/qlpack.yml | 2 +- 35 files changed, 35 insertions(+), 35 deletions(-) diff --git a/cpp/ql/lib/qlpack.yml b/cpp/ql/lib/qlpack.yml index f1a2ac3942f2..ba5db8c6e6f9 100644 --- a/cpp/ql/lib/qlpack.yml +++ b/cpp/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/cpp-all -version: 2.0.1 +version: 2.0.2-dev groups: cpp dbscheme: semmlecode.cpp.dbscheme extractor: cpp diff --git a/cpp/ql/src/qlpack.yml b/cpp/ql/src/qlpack.yml index e541f95cd85f..d01ac2f048c2 100644 --- a/cpp/ql/src/qlpack.yml +++ b/cpp/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/cpp-queries -version: 1.2.4 +version: 1.2.5-dev groups: - cpp - queries diff --git a/csharp/ql/campaigns/Solorigate/lib/qlpack.yml b/csharp/ql/campaigns/Solorigate/lib/qlpack.yml index 871d2ed3619a..3cab08a0f3ec 100644 --- a/csharp/ql/campaigns/Solorigate/lib/qlpack.yml +++ b/csharp/ql/campaigns/Solorigate/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-solorigate-all -version: 1.7.26 +version: 1.7.27-dev groups: - csharp - solorigate diff --git a/csharp/ql/campaigns/Solorigate/src/qlpack.yml b/csharp/ql/campaigns/Solorigate/src/qlpack.yml index 00c3209afe98..c46baf0b2518 100644 --- a/csharp/ql/campaigns/Solorigate/src/qlpack.yml +++ b/csharp/ql/campaigns/Solorigate/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-solorigate-queries -version: 1.7.26 +version: 1.7.27-dev groups: - csharp - solorigate diff --git a/csharp/ql/lib/qlpack.yml b/csharp/ql/lib/qlpack.yml index a8e9c68cfb44..55a99929ac87 100644 --- a/csharp/ql/lib/qlpack.yml +++ b/csharp/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-all -version: 3.0.0 +version: 3.0.1-dev groups: csharp dbscheme: semmlecode.csharp.dbscheme extractor: csharp diff --git a/csharp/ql/src/qlpack.yml b/csharp/ql/src/qlpack.yml index 82e9607d7ab7..6209cc5f88d5 100644 --- a/csharp/ql/src/qlpack.yml +++ b/csharp/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-queries -version: 1.0.9 +version: 1.0.10-dev groups: - csharp - queries diff --git a/go/ql/consistency-queries/qlpack.yml b/go/ql/consistency-queries/qlpack.yml index 9800f5090fac..5a7ca8082a53 100644 --- a/go/ql/consistency-queries/qlpack.yml +++ b/go/ql/consistency-queries/qlpack.yml @@ -1,5 +1,5 @@ name: codeql-go-consistency-queries -version: 1.0.9 +version: 1.0.10-dev groups: - go - queries diff --git a/go/ql/lib/qlpack.yml b/go/ql/lib/qlpack.yml index b6987a250d1a..9cb5e3620117 100644 --- a/go/ql/lib/qlpack.yml +++ b/go/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/go-all -version: 2.1.0 +version: 2.1.1-dev groups: go dbscheme: go.dbscheme extractor: go diff --git a/go/ql/src/qlpack.yml b/go/ql/src/qlpack.yml index e783026f6cfd..0b3f5076bb6d 100644 --- a/go/ql/src/qlpack.yml +++ b/go/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/go-queries -version: 1.1.0 +version: 1.1.1-dev groups: - go - queries diff --git a/java/ql/automodel/src/qlpack.yml b/java/ql/automodel/src/qlpack.yml index 1e1fdbb9f38d..fe961cb4392c 100644 --- a/java/ql/automodel/src/qlpack.yml +++ b/java/ql/automodel/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/java-automodel-queries -version: 1.0.9 +version: 1.0.10-dev groups: - java - automodel diff --git a/java/ql/lib/qlpack.yml b/java/ql/lib/qlpack.yml index 9c69e18a30b8..0d4f67146c1b 100644 --- a/java/ql/lib/qlpack.yml +++ b/java/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/java-all -version: 4.1.0 +version: 4.1.1-dev groups: java dbscheme: config/semmlecode.dbscheme extractor: java diff --git a/java/ql/src/qlpack.yml b/java/ql/src/qlpack.yml index 635ef97836fe..c8e95f52ca4a 100644 --- a/java/ql/src/qlpack.yml +++ b/java/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/java-queries -version: 1.1.6 +version: 1.1.7-dev groups: - java - queries diff --git a/javascript/ql/lib/qlpack.yml b/javascript/ql/lib/qlpack.yml index a93cb421a869..bea3bbacd5fa 100644 --- a/javascript/ql/lib/qlpack.yml +++ b/javascript/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/javascript-all -version: 2.0.1 +version: 2.0.2-dev groups: javascript dbscheme: semmlecode.javascript.dbscheme extractor: javascript diff --git a/javascript/ql/src/qlpack.yml b/javascript/ql/src/qlpack.yml index 49489696e79a..407aa03f7802 100644 --- a/javascript/ql/src/qlpack.yml +++ b/javascript/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/javascript-queries -version: 1.2.1 +version: 1.2.2-dev groups: - javascript - queries diff --git a/misc/suite-helpers/qlpack.yml b/misc/suite-helpers/qlpack.yml index a4d970e31297..76c86b26be6b 100644 --- a/misc/suite-helpers/qlpack.yml +++ b/misc/suite-helpers/qlpack.yml @@ -1,4 +1,4 @@ name: codeql/suite-helpers -version: 1.0.9 +version: 1.0.10-dev groups: shared warnOnImplicitThis: true diff --git a/python/ql/lib/qlpack.yml b/python/ql/lib/qlpack.yml index 316f7a1cc1e6..445940cdd889 100644 --- a/python/ql/lib/qlpack.yml +++ b/python/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/python-all -version: 2.1.0 +version: 2.1.1-dev groups: python dbscheme: semmlecode.python.dbscheme extractor: python diff --git a/python/ql/src/qlpack.yml b/python/ql/src/qlpack.yml index 02c861d40e1d..3f5ee4e78041 100644 --- a/python/ql/src/qlpack.yml +++ b/python/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/python-queries -version: 1.3.0 +version: 1.3.1-dev groups: - python - queries diff --git a/ruby/ql/lib/qlpack.yml b/ruby/ql/lib/qlpack.yml index da808214ea50..dc0b471a171d 100644 --- a/ruby/ql/lib/qlpack.yml +++ b/ruby/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/ruby-all -version: 2.0.1 +version: 2.0.2-dev groups: ruby extractor: ruby dbscheme: ruby.dbscheme diff --git a/ruby/ql/src/qlpack.yml b/ruby/ql/src/qlpack.yml index 47651d248c01..b7eee713fbaa 100644 --- a/ruby/ql/src/qlpack.yml +++ b/ruby/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/ruby-queries -version: 1.1.4 +version: 1.1.5-dev groups: - ruby - queries diff --git a/shared/controlflow/qlpack.yml b/shared/controlflow/qlpack.yml index fc8bdde934d4..532b2fa69a09 100644 --- a/shared/controlflow/qlpack.yml +++ b/shared/controlflow/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/controlflow -version: 1.0.9 +version: 1.0.10-dev groups: shared library: true dependencies: diff --git a/shared/dataflow/qlpack.yml b/shared/dataflow/qlpack.yml index 2ad3f8bc73c0..df5c8c4c38af 100644 --- a/shared/dataflow/qlpack.yml +++ b/shared/dataflow/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/dataflow -version: 1.1.3 +version: 1.1.4-dev groups: shared library: true dependencies: diff --git a/shared/mad/qlpack.yml b/shared/mad/qlpack.yml index ed0c1f7113c5..ef3755c80bc4 100644 --- a/shared/mad/qlpack.yml +++ b/shared/mad/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/mad -version: 1.0.9 +version: 1.0.10-dev groups: shared library: true dependencies: diff --git a/shared/rangeanalysis/qlpack.yml b/shared/rangeanalysis/qlpack.yml index aaf1b1903576..b4deed51c9d8 100644 --- a/shared/rangeanalysis/qlpack.yml +++ b/shared/rangeanalysis/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/rangeanalysis -version: 1.0.9 +version: 1.0.10-dev groups: shared library: true dependencies: diff --git a/shared/regex/qlpack.yml b/shared/regex/qlpack.yml index d8b03f4ad2f5..5593197f674b 100644 --- a/shared/regex/qlpack.yml +++ b/shared/regex/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/regex -version: 1.0.9 +version: 1.0.10-dev groups: shared library: true dependencies: diff --git a/shared/ssa/qlpack.yml b/shared/ssa/qlpack.yml index 1bd2bea757b3..7bc3773a575f 100644 --- a/shared/ssa/qlpack.yml +++ b/shared/ssa/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/ssa -version: 1.0.9 +version: 1.0.10-dev groups: shared library: true dependencies: diff --git a/shared/threat-models/qlpack.yml b/shared/threat-models/qlpack.yml index 434466938b1c..dd4331d7e749 100644 --- a/shared/threat-models/qlpack.yml +++ b/shared/threat-models/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/threat-models -version: 1.0.9 +version: 1.0.10-dev library: true groups: shared dataExtensions: diff --git a/shared/tutorial/qlpack.yml b/shared/tutorial/qlpack.yml index 9a89b262a321..2390ce7ad116 100644 --- a/shared/tutorial/qlpack.yml +++ b/shared/tutorial/qlpack.yml @@ -1,7 +1,7 @@ name: codeql/tutorial description: Library for the CodeQL detective tutorials, helping new users learn to write CodeQL queries. -version: 1.0.9 +version: 1.0.10-dev groups: shared library: true warnOnImplicitThis: true diff --git a/shared/typeflow/qlpack.yml b/shared/typeflow/qlpack.yml index 21b1ddbc9654..04f843aacb5f 100644 --- a/shared/typeflow/qlpack.yml +++ b/shared/typeflow/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/typeflow -version: 1.0.9 +version: 1.0.10-dev groups: shared library: true dependencies: diff --git a/shared/typetracking/qlpack.yml b/shared/typetracking/qlpack.yml index 6f7282c54e9e..e48446dc3e0b 100644 --- a/shared/typetracking/qlpack.yml +++ b/shared/typetracking/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/typetracking -version: 1.0.9 +version: 1.0.10-dev groups: shared library: true dependencies: diff --git a/shared/typos/qlpack.yml b/shared/typos/qlpack.yml index 3e644f92d6d1..5eccd54b2afa 100644 --- a/shared/typos/qlpack.yml +++ b/shared/typos/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/typos -version: 1.0.9 +version: 1.0.10-dev groups: shared library: true warnOnImplicitThis: true diff --git a/shared/util/qlpack.yml b/shared/util/qlpack.yml index ab191310e567..508143471db4 100644 --- a/shared/util/qlpack.yml +++ b/shared/util/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/util -version: 1.0.9 +version: 1.0.10-dev groups: shared library: true dependencies: null diff --git a/shared/xml/qlpack.yml b/shared/xml/qlpack.yml index f43260879fb6..a81184e65886 100644 --- a/shared/xml/qlpack.yml +++ b/shared/xml/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/xml -version: 1.0.9 +version: 1.0.10-dev groups: shared library: true dependencies: diff --git a/shared/yaml/qlpack.yml b/shared/yaml/qlpack.yml index 4a63da564e55..1df4193b862f 100644 --- a/shared/yaml/qlpack.yml +++ b/shared/yaml/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/yaml -version: 1.0.9 +version: 1.0.10-dev groups: shared library: true warnOnImplicitThis: true diff --git a/swift/ql/lib/qlpack.yml b/swift/ql/lib/qlpack.yml index dd1896b3c291..1904a1b1ca48 100644 --- a/swift/ql/lib/qlpack.yml +++ b/swift/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/swift-all -version: 2.0.1 +version: 2.0.2-dev groups: swift extractor: swift dbscheme: swift.dbscheme diff --git a/swift/ql/src/qlpack.yml b/swift/ql/src/qlpack.yml index 8f33acf16a69..6fbae9403605 100644 --- a/swift/ql/src/qlpack.yml +++ b/swift/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/swift-queries -version: 1.0.9 +version: 1.0.10-dev groups: - swift - queries From 56d0affe38fbe469e241c7854232b4f43adde619 Mon Sep 17 00:00:00 2001 From: yoff Date: Thu, 3 Oct 2024 10:18:25 +0200 Subject: [PATCH 59/79] Update python/ql/lib/semmle/python/frameworks/Stdlib.model.yml Co-authored-by: Rasmus Wriedt Larsen --- python/ql/lib/semmle/python/frameworks/Stdlib.model.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/ql/lib/semmle/python/frameworks/Stdlib.model.yml b/python/ql/lib/semmle/python/frameworks/Stdlib.model.yml index 946c4d5ed4f6..107fffdbfb84 100644 --- a/python/ql/lib/semmle/python/frameworks/Stdlib.model.yml +++ b/python/ql/lib/semmle/python/frameworks/Stdlib.model.yml @@ -33,8 +33,8 @@ extensions: extensible: summaryModel data: # See https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser + # note: taint flow for attribute lookups on `argparse.ArgumentParser` is handled in QL - ["argparse.ArgumentParser", "Member[_parse_known_args,_read_args_from_files]", "Argument[0,arg_strings:]", "ReturnValue", "taint"] - # note: taint of attribute lookups is handled in QL - ["argparse.ArgumentParser", "Member[parse_args,parse_known_args]", "Argument[0,args:]", "ReturnValue", "taint"] # See https://docs.python.org/3/library/cgi.html#higher-level-interface - ["cgi.FieldStorage", "Member[getfirst,getlist,getvalue]", "Argument[self]", "ReturnValue", "taint"] From 5c68bad2f158d3a0f37d931fdf485d990e28097b Mon Sep 17 00:00:00 2001 From: Rasmus Lerchedahl Petersen Date: Thu, 3 Oct 2024 12:17:59 +0200 Subject: [PATCH 60/79] Python: add comments --- python/ql/lib/semmle/python/frameworks/Stdlib.qll | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/python/ql/lib/semmle/python/frameworks/Stdlib.qll b/python/ql/lib/semmle/python/frameworks/Stdlib.qll index 37cb23a472db..038b3f851932 100644 --- a/python/ql/lib/semmle/python/frameworks/Stdlib.qll +++ b/python/ql/lib/semmle/python/frameworks/Stdlib.qll @@ -4207,7 +4207,11 @@ module StdlibPrivate { // --------------------------------------------------------------------------- // Flow summaries for functions contructing containers // --------------------------------------------------------------------------- - /** A flow summary for `dict`. */ + /** + * A flow summary for `dict`. + * + * see https://docs.python.org/3/library/stdtypes.html#dict + */ class DictSummary extends SummarizedCallable { DictSummary() { this = "builtins.dict" } @@ -4218,18 +4222,23 @@ module StdlibPrivate { } override predicate propagatesFlow(string input, string output, boolean preservesValue) { + // The positional argument contains a mapping. + // TODO: Add the list-of-pairs version + // TODO: these values can be overwritten by keyword arguments exists(DataFlow::DictionaryElementContent dc, string key | key = dc.getKey() | input = "Argument[0].DictionaryElement[" + key + "]" and output = "ReturnValue.DictionaryElement[" + key + "]" and preservesValue = true ) or + // The keyword arguments are added to the dictionary. exists(DataFlow::DictionaryElementContent dc, string key | key = dc.getKey() | input = "Argument[" + key + ":]" and output = "ReturnValue.DictionaryElement[" + key + "]" and preservesValue = true ) or + // Imprecise content in any argument ends up on the container itself. input = "Argument[0..]" and output = "ReturnValue" and preservesValue = false From 0462809edcf42f6da8ea8b6dfa81505bb8a7e147 Mon Sep 17 00:00:00 2001 From: Rasmus Lerchedahl Petersen Date: Tue, 24 Sep 2024 20:49:05 +0200 Subject: [PATCH 61/79] Python: add taint test for urllib --- .../frameworks/urllib/InlineTaintTest.expected | 4 ++++ .../library-tests/frameworks/urllib/InlineTaintTest.ql | 2 ++ .../test/library-tests/frameworks/urllib/taint_test.py | 10 ++++++++++ 3 files changed, 16 insertions(+) create mode 100644 python/ql/test/library-tests/frameworks/urllib/InlineTaintTest.expected create mode 100644 python/ql/test/library-tests/frameworks/urllib/InlineTaintTest.ql create mode 100644 python/ql/test/library-tests/frameworks/urllib/taint_test.py diff --git a/python/ql/test/library-tests/frameworks/urllib/InlineTaintTest.expected b/python/ql/test/library-tests/frameworks/urllib/InlineTaintTest.expected new file mode 100644 index 000000000000..366de37b8677 --- /dev/null +++ b/python/ql/test/library-tests/frameworks/urllib/InlineTaintTest.expected @@ -0,0 +1,4 @@ +argumentToEnsureNotTaintedNotMarkedAsSpurious +untaintedArgumentToEnsureTaintedNotMarkedAsMissing +testFailures +failures diff --git a/python/ql/test/library-tests/frameworks/urllib/InlineTaintTest.ql b/python/ql/test/library-tests/frameworks/urllib/InlineTaintTest.ql new file mode 100644 index 000000000000..8524da5fe7db --- /dev/null +++ b/python/ql/test/library-tests/frameworks/urllib/InlineTaintTest.ql @@ -0,0 +1,2 @@ +import experimental.meta.InlineTaintTest +import MakeInlineTaintTest diff --git a/python/ql/test/library-tests/frameworks/urllib/taint_test.py b/python/ql/test/library-tests/frameworks/urllib/taint_test.py new file mode 100644 index 000000000000..ad64ce37f24c --- /dev/null +++ b/python/ql/test/library-tests/frameworks/urllib/taint_test.py @@ -0,0 +1,10 @@ +import urllib.parse + +def test(): + ts = TAINTED_STRING + + params = urllib.parse.parse_qs(ts) + + ensure_tainted( + params, # $ MISSING: tainted + ) From 768d866e72da521f942c449c45aa0ec298fbe22e Mon Sep 17 00:00:00 2001 From: Rasmus Lerchedahl Petersen Date: Tue, 24 Sep 2024 20:52:00 +0200 Subject: [PATCH 62/79] python: model `urllib.parse.parse_qs` --- python/ql/lib/semmle/python/frameworks/Stdlib.model.yml | 2 ++ python/ql/test/library-tests/frameworks/urllib/taint_test.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/python/ql/lib/semmle/python/frameworks/Stdlib.model.yml b/python/ql/lib/semmle/python/frameworks/Stdlib.model.yml index 107fffdbfb84..683b0aa9b3df 100644 --- a/python/ql/lib/semmle/python/frameworks/Stdlib.model.yml +++ b/python/ql/lib/semmle/python/frameworks/Stdlib.model.yml @@ -134,6 +134,8 @@ extensions: - ["traceback.StackSummary", "Member[from_list]", "Argument[0,a_list:]", "ReturnValue", "taint"] # See https://docs.python.org/3/library/typing.html#typing.cast - ["typing", "Member[cast]", "Argument[1,val:]", "ReturnValue", "value"] + # See https://docs.python.org/3/library/urllib.parse.html#urllib.parse.parse_qs + - ["urllib", "Member[parse].Member[parse_qs]", "Argument[0,qs:]", "ReturnValue", "taint"] # See https://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote - ["urllib", "Member[parse].Member[quote]", "Argument[0,string:]", "ReturnValue", "taint"] # See https://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote_plus diff --git a/python/ql/test/library-tests/frameworks/urllib/taint_test.py b/python/ql/test/library-tests/frameworks/urllib/taint_test.py index ad64ce37f24c..b24c31be14c0 100644 --- a/python/ql/test/library-tests/frameworks/urllib/taint_test.py +++ b/python/ql/test/library-tests/frameworks/urllib/taint_test.py @@ -6,5 +6,5 @@ def test(): params = urllib.parse.parse_qs(ts) ensure_tainted( - params, # $ MISSING: tainted + params, # $ tainted ) From 821398715c5eb6361e42bd9b5e528254fce403a2 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 3 Oct 2024 11:55:11 +0100 Subject: [PATCH 63/79] Rust: Test spacing. --- .../query-tests/unusedentities/UnusedVariable.expected | 8 ++++---- rust/ql/test/query-tests/unusedentities/main.rs | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/rust/ql/test/query-tests/unusedentities/UnusedVariable.expected b/rust/ql/test/query-tests/unusedentities/UnusedVariable.expected index f3aadfdff0d8..b99d7892f8e8 100644 --- a/rust/ql/test/query-tests/unusedentities/UnusedVariable.expected +++ b/rust/ql/test/query-tests/unusedentities/UnusedVariable.expected @@ -1,4 +1,4 @@ -| main.rs:23:9:23:9 | a | Variable is not used. | -| main.rs:88:13:88:13 | d | Variable is not used. | -| main.rs:112:9:112:9 | k | Variable is not used. | -| main.rs:139:5:139:5 | y | Variable is not used. | +| main.rs:25:9:25:9 | a | Variable is not used. | +| main.rs:90:13:90:13 | d | Variable is not used. | +| main.rs:114:9:114:9 | k | Variable is not used. | +| main.rs:141:5:141:5 | y | Variable is not used. | diff --git a/rust/ql/test/query-tests/unusedentities/main.rs b/rust/ql/test/query-tests/unusedentities/main.rs index 7280f6c2502b..3d79206e903e 100644 --- a/rust/ql/test/query-tests/unusedentities/main.rs +++ b/rust/ql/test/query-tests/unusedentities/main.rs @@ -8,6 +8,7 @@ fn locals_1() { let c = 1; let d = String::from("a"); // BAD: unused value [NOT DETECTED] let e = String::from("b"); + let _ = 1; // (deliberately unused) println!("use {}", b); @@ -17,6 +18,7 @@ fn locals_1() { } println!("use {}", e); + } fn locals_2() { From 777279dc29cf812a6d3e50e06b692c0c0b3effcb Mon Sep 17 00:00:00 2001 From: Rasmus Lerchedahl Petersen Date: Thu, 3 Oct 2024 13:29:56 +0200 Subject: [PATCH 64/79] Python: MaD test expectations --- .../Security/CWE-409/DecompressionBombs.expected | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python/ql/test/experimental/query-tests/Security/CWE-409/DecompressionBombs.expected b/python/ql/test/experimental/query-tests/Security/CWE-409/DecompressionBombs.expected index 2b16f9ef178f..7763cf2ad151 100644 --- a/python/ql/test/experimental/query-tests/Security/CWE-409/DecompressionBombs.expected +++ b/python/ql/test/experimental/query-tests/Security/CWE-409/DecompressionBombs.expected @@ -1,23 +1,23 @@ edges | test.py:10:16:10:24 | ControlFlowNode for file_path | test.py:11:21:11:29 | ControlFlowNode for file_path | provenance | | | test.py:11:5:11:35 | ControlFlowNode for Attribute() | test.py:11:5:11:52 | ControlFlowNode for Attribute() | provenance | Config | -| test.py:11:21:11:29 | ControlFlowNode for file_path | test.py:11:5:11:35 | ControlFlowNode for Attribute() | provenance | MaD:82 | +| test.py:11:21:11:29 | ControlFlowNode for file_path | test.py:11:5:11:35 | ControlFlowNode for Attribute() | provenance | MaD:83 | | test.py:11:21:11:29 | ControlFlowNode for file_path | test.py:11:5:11:52 | ControlFlowNode for Attribute() | provenance | Config | | test.py:11:21:11:29 | ControlFlowNode for file_path | test.py:12:21:12:29 | ControlFlowNode for file_path | provenance | | | test.py:12:5:12:35 | ControlFlowNode for Attribute() | test.py:12:5:12:48 | ControlFlowNode for Attribute() | provenance | Config | -| test.py:12:21:12:29 | ControlFlowNode for file_path | test.py:12:5:12:35 | ControlFlowNode for Attribute() | provenance | MaD:82 | +| test.py:12:21:12:29 | ControlFlowNode for file_path | test.py:12:5:12:35 | ControlFlowNode for Attribute() | provenance | MaD:83 | | test.py:12:21:12:29 | ControlFlowNode for file_path | test.py:12:5:12:48 | ControlFlowNode for Attribute() | provenance | Config | | test.py:12:21:12:29 | ControlFlowNode for file_path | test.py:14:26:14:34 | ControlFlowNode for file_path | provenance | | | test.py:14:10:14:35 | ControlFlowNode for Attribute() | test.py:15:14:15:29 | ControlFlowNode for Attribute() | provenance | Config | -| test.py:14:26:14:34 | ControlFlowNode for file_path | test.py:14:10:14:35 | ControlFlowNode for Attribute() | provenance | MaD:82 | +| test.py:14:26:14:34 | ControlFlowNode for file_path | test.py:14:10:14:35 | ControlFlowNode for Attribute() | provenance | MaD:83 | | test.py:14:26:14:34 | ControlFlowNode for file_path | test.py:15:14:15:29 | ControlFlowNode for Attribute() | provenance | Config | | test.py:14:26:14:34 | ControlFlowNode for file_path | test.py:18:26:18:34 | ControlFlowNode for file_path | provenance | | | test.py:18:10:18:35 | ControlFlowNode for Attribute() | test.py:19:14:19:39 | ControlFlowNode for Attribute() | provenance | Config | -| test.py:18:26:18:34 | ControlFlowNode for file_path | test.py:18:10:18:35 | ControlFlowNode for Attribute() | provenance | MaD:82 | +| test.py:18:26:18:34 | ControlFlowNode for file_path | test.py:18:10:18:35 | ControlFlowNode for Attribute() | provenance | MaD:83 | | test.py:18:26:18:34 | ControlFlowNode for file_path | test.py:19:14:19:39 | ControlFlowNode for Attribute() | provenance | Config | | test.py:18:26:18:34 | ControlFlowNode for file_path | test.py:22:21:22:29 | ControlFlowNode for file_path | provenance | | | test.py:22:5:22:30 | ControlFlowNode for Attribute() | test.py:22:5:22:60 | ControlFlowNode for Attribute() | provenance | Config | -| test.py:22:21:22:29 | ControlFlowNode for file_path | test.py:22:5:22:30 | ControlFlowNode for Attribute() | provenance | MaD:82 | +| test.py:22:21:22:29 | ControlFlowNode for file_path | test.py:22:5:22:30 | ControlFlowNode for Attribute() | provenance | MaD:83 | | test.py:22:21:22:29 | ControlFlowNode for file_path | test.py:22:5:22:60 | ControlFlowNode for Attribute() | provenance | Config | | test.py:22:21:22:29 | ControlFlowNode for file_path | test.py:24:18:24:26 | ControlFlowNode for file_path | provenance | | | test.py:24:18:24:26 | ControlFlowNode for file_path | test.py:24:5:24:52 | ControlFlowNode for Attribute() | provenance | Config | From 0304aa846caddb81cf318164b08230bcb469114d Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 3 Oct 2024 11:57:56 +0100 Subject: [PATCH 65/79] Rust: Add more tests for uused variables. --- .../unusedentities/UnusedVariable.expected | 10 ++ .../test/query-tests/unusedentities/main.rs | 106 +++++++++++++++++- 2 files changed, 114 insertions(+), 2 deletions(-) diff --git a/rust/ql/test/query-tests/unusedentities/UnusedVariable.expected b/rust/ql/test/query-tests/unusedentities/UnusedVariable.expected index b99d7892f8e8..4a35ca8a41d4 100644 --- a/rust/ql/test/query-tests/unusedentities/UnusedVariable.expected +++ b/rust/ql/test/query-tests/unusedentities/UnusedVariable.expected @@ -2,3 +2,13 @@ | main.rs:90:13:90:13 | d | Variable is not used. | | main.rs:114:9:114:9 | k | Variable is not used. | | main.rs:141:5:141:5 | y | Variable is not used. | +| main.rs:164:9:164:9 | x | Variable is not used. | +| main.rs:170:9:170:9 | x | Variable is not used. | +| main.rs:174:9:174:9 | x | Variable is not used. | +| main.rs:194:17:194:17 | a | Variable is not used. | +| main.rs:202:20:202:22 | val | Variable is not used. | +| main.rs:207:20:207:22 | val | Variable is not used. | +| main.rs:214:14:214:16 | val | Variable is not used. | +| main.rs:216:9:216:12 | None | Variable is not used. | +| main.rs:225:9:225:12 | None | Variable is not used. | +| main.rs:231:24:231:26 | val | Variable is not used. | diff --git a/rust/ql/test/query-tests/unusedentities/main.rs b/rust/ql/test/query-tests/unusedentities/main.rs index 3d79206e903e..46d1458b972e 100644 --- a/rust/ql/test/query-tests/unusedentities/main.rs +++ b/rust/ql/test/query-tests/unusedentities/main.rs @@ -8,7 +8,7 @@ fn locals_1() { let c = 1; let d = String::from("a"); // BAD: unused value [NOT DETECTED] let e = String::from("b"); - + let f = 1; let _ = 1; // (deliberately unused) println!("use {}", b); @@ -18,7 +18,7 @@ fn locals_1() { } println!("use {}", e); - + assert!(f == 1); } fn locals_2() { @@ -144,11 +144,113 @@ fn parameters( return x; } +// --- loops --- + +fn loops() { + let mut a: i64 = 10; + let b: i64 = 20; + let c: i64 = 30; + let d: i64 = 40; + let mut e: i64 = 50; + + while a < b { + a += 1; + } + + for x in c..d { + e += x; + } + + for x in 1..10 { // BAD: unused variable + } + + for _ in 1..10 { + } + + for x in 1..10 { // SPURIOUS: unused variable [macros not yet supported] + println!("x is {}", x); + } + + for x in 1..10 { // SPURIOUS: unused variable [macros not yet supported] + assert!(x != 11); + } +} + +// --- lets --- + +enum MyOption { + None, + Some(T), +} + +enum YesOrNo { + Yes, + No, +} + +fn if_lets() { + let mut total: i64 = 0; + + if let Some(a) = Some(10) { // BAD: unused variable + } + + if let Some(b) = Some(20) { + total += b; + } + + let mut next = Some(30); + while let Some(val) = next { // BAD: unused variable + next = None; + } + + let mut next2 = Some(40); + while let Some(val) = next2 { // SPURIOUS: unused variable 'val' + total += val; + next2 = None; + } + + let c = Some(60); + match c { + Some(val) => { // BAD: unused variable + }, + None => { // SPURIOUS: unused variable 'None' + } + } + + let d = Some(70); + match d { + Some(val) => { + total += val; + }, + None => { // SPURIOUS: unused variable 'None' + } + } + + let e = MyOption::Some(80); + match e { + MyOption::Some(val) => { // BAD: unused variable + }, + MyOption::None => { + } + } + + let f = YesOrNo::Yes; + match f { + YesOrNo::Yes => { + }, + YesOrNo::No => { + }, + } +} + fn main() { locals_1(); locals_2(); structs(); arrays(); statics(); + loops(); + if_lets(); + println!("lets use result {}", parameters(1, 2, 3)); } From cd04500dd9393e613cd06b5747902c8f95ae4150 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Thu, 3 Oct 2024 14:05:24 +0200 Subject: [PATCH 66/79] Rust: Account for variables bound in `while let` expressions --- .../rust/elements/internal/VariableImpl.qll | 7 + .../test/library-tests/variables/Cfg.expected | 885 +++++++++--------- .../variables/variables.expected | 369 ++++---- .../test/library-tests/variables/variables.rs | 9 + .../unusedentities/UnusedVariable.expected | 15 +- .../test/query-tests/unusedentities/main.rs | 27 +- 6 files changed, 676 insertions(+), 636 deletions(-) diff --git a/rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll index 3f0cabc97b85..7a77c45fe2ae 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll @@ -218,6 +218,13 @@ module Impl { scope = ce.getBody() and scope.getLocation().hasLocationInfo(_, line, column, _, _) ) + or + exists(WhileExpr we, LetExpr let | + let.getPat() = pat and + we.getCondition() = let and + scope = we.getLoopBody() and + scope.getLocation().hasLocationInfo(_, line, column, _, _) + ) ) } diff --git a/rust/ql/test/library-tests/variables/Cfg.expected b/rust/ql/test/library-tests/variables/Cfg.expected index 0a075ff054e3..1ae43dac402e 100644 --- a/rust/ql/test/library-tests/variables/Cfg.expected +++ b/rust/ql/test/library-tests/variables/Cfg.expected @@ -159,439 +159,458 @@ edges | variables.rs:85:5:85:17 | CallExpr | variables.rs:80:19:86:1 | BlockExpr | | | variables.rs:85:5:85:18 | ExprStmt | variables.rs:85:5:85:13 | PathExpr | | | variables.rs:85:15:85:16 | x5 | variables.rs:85:5:85:17 | CallExpr | | -| variables.rs:88:1:103:1 | enter match_pattern1 | variables.rs:89:5:89:21 | LetStmt | | -| variables.rs:88:1:103:1 | exit match_pattern1 (normal) | variables.rs:88:1:103:1 | exit match_pattern1 | | -| variables.rs:88:21:103:1 | BlockExpr | variables.rs:88:1:103:1 | exit match_pattern1 (normal) | | -| variables.rs:89:5:89:21 | LetStmt | variables.rs:89:14:89:17 | PathExpr | | -| variables.rs:89:9:89:10 | x6 | variables.rs:90:5:90:16 | LetStmt | match, no-match | -| variables.rs:89:14:89:17 | PathExpr | variables.rs:89:19:89:19 | 5 | | -| variables.rs:89:14:89:20 | CallExpr | variables.rs:89:9:89:10 | x6 | | -| variables.rs:89:19:89:19 | 5 | variables.rs:89:14:89:20 | CallExpr | | -| variables.rs:90:5:90:16 | LetStmt | variables.rs:90:14:90:15 | 10 | | -| variables.rs:90:9:90:10 | y1 | variables.rs:92:5:100:5 | ExprStmt | match, no-match | -| variables.rs:90:14:90:15 | 10 | variables.rs:90:9:90:10 | y1 | | -| variables.rs:92:5:100:5 | ExprStmt | variables.rs:92:11:92:12 | x6 | | -| variables.rs:92:5:100:5 | MatchExpr | variables.rs:102:5:102:18 | ExprStmt | | -| variables.rs:92:11:92:12 | x6 | variables.rs:93:9:93:16 | TupleStructPat | | -| variables.rs:93:9:93:16 | TupleStructPat | variables.rs:93:21:93:29 | PathExpr | match | -| variables.rs:93:9:93:16 | TupleStructPat | variables.rs:94:9:94:16 | TupleStructPat | no-match | -| variables.rs:93:21:93:29 | PathExpr | variables.rs:93:31:93:38 | "Got 50" | | -| variables.rs:93:21:93:39 | CallExpr | variables.rs:92:5:100:5 | MatchExpr | | -| variables.rs:93:31:93:38 | "Got 50" | variables.rs:93:21:93:39 | CallExpr | | -| variables.rs:94:9:94:16 | TupleStructPat | variables.rs:97:13:97:21 | PathExpr | match | -| variables.rs:94:9:94:16 | TupleStructPat | variables.rs:99:9:99:12 | None | no-match | -| variables.rs:96:9:98:9 | BlockExpr | variables.rs:92:5:100:5 | MatchExpr | | -| variables.rs:97:13:97:21 | PathExpr | variables.rs:97:23:97:24 | y1 | | -| variables.rs:97:13:97:25 | CallExpr | variables.rs:96:9:98:9 | BlockExpr | | -| variables.rs:97:23:97:24 | y1 | variables.rs:97:13:97:25 | CallExpr | | -| variables.rs:99:9:99:12 | None | variables.rs:99:17:99:25 | PathExpr | match | -| variables.rs:99:17:99:25 | PathExpr | variables.rs:99:27:99:32 | "NONE" | | -| variables.rs:99:17:99:33 | CallExpr | variables.rs:92:5:100:5 | MatchExpr | | -| variables.rs:99:27:99:32 | "NONE" | variables.rs:99:17:99:33 | CallExpr | | -| variables.rs:102:5:102:13 | PathExpr | variables.rs:102:15:102:16 | y1 | | -| variables.rs:102:5:102:17 | CallExpr | variables.rs:88:21:103:1 | BlockExpr | | -| variables.rs:102:5:102:18 | ExprStmt | variables.rs:102:5:102:13 | PathExpr | | -| variables.rs:102:15:102:16 | y1 | variables.rs:102:5:102:17 | CallExpr | | -| variables.rs:105:1:130:1 | enter match_pattern2 | variables.rs:106:5:106:36 | LetStmt | | -| variables.rs:105:1:130:1 | exit match_pattern2 (normal) | variables.rs:105:1:130:1 | exit match_pattern2 | | -| variables.rs:105:21:130:1 | BlockExpr | variables.rs:105:1:130:1 | exit match_pattern2 (normal) | | -| variables.rs:106:5:106:36 | LetStmt | variables.rs:106:20:106:20 | 2 | | -| variables.rs:106:9:106:15 | numbers | variables.rs:108:5:118:5 | ExprStmt | match, no-match | -| variables.rs:106:19:106:35 | TupleExpr | variables.rs:106:9:106:15 | numbers | | -| variables.rs:106:20:106:20 | 2 | variables.rs:106:23:106:23 | 4 | | -| variables.rs:106:23:106:23 | 4 | variables.rs:106:26:106:26 | 8 | | -| variables.rs:106:26:106:26 | 8 | variables.rs:106:29:106:30 | 16 | | -| variables.rs:106:29:106:30 | 16 | variables.rs:106:33:106:34 | 32 | | -| variables.rs:106:33:106:34 | 32 | variables.rs:106:19:106:35 | TupleExpr | | -| variables.rs:108:5:118:5 | ExprStmt | variables.rs:108:11:108:17 | numbers | | -| variables.rs:108:5:118:5 | MatchExpr | variables.rs:120:11:120:17 | numbers | | -| variables.rs:108:11:108:17 | numbers | variables.rs:109:9:113:9 | TuplePat | | -| variables.rs:109:9:113:9 | TuplePat | variables.rs:114:13:114:29 | ExprStmt | match | -| variables.rs:113:14:117:9 | BlockExpr | variables.rs:108:5:118:5 | MatchExpr | | -| variables.rs:114:13:114:21 | PathExpr | variables.rs:114:23:114:27 | first | | -| variables.rs:114:13:114:28 | CallExpr | variables.rs:115:13:115:29 | ExprStmt | | -| variables.rs:114:13:114:29 | ExprStmt | variables.rs:114:13:114:21 | PathExpr | | -| variables.rs:114:23:114:27 | first | variables.rs:114:13:114:28 | CallExpr | | -| variables.rs:115:13:115:21 | PathExpr | variables.rs:115:23:115:27 | third | | -| variables.rs:115:13:115:28 | CallExpr | variables.rs:116:13:116:29 | ExprStmt | | -| variables.rs:115:13:115:29 | ExprStmt | variables.rs:115:13:115:21 | PathExpr | | -| variables.rs:115:23:115:27 | third | variables.rs:115:13:115:28 | CallExpr | | -| variables.rs:116:13:116:21 | PathExpr | variables.rs:116:23:116:27 | fifth | | -| variables.rs:116:13:116:28 | CallExpr | variables.rs:113:14:117:9 | BlockExpr | | -| variables.rs:116:13:116:29 | ExprStmt | variables.rs:116:13:116:21 | PathExpr | | -| variables.rs:116:23:116:27 | fifth | variables.rs:116:13:116:28 | CallExpr | | -| variables.rs:120:5:129:5 | MatchExpr | variables.rs:105:21:130:1 | BlockExpr | | -| variables.rs:120:11:120:17 | numbers | variables.rs:121:9:125:9 | TuplePat | | -| variables.rs:121:9:125:9 | TuplePat | variables.rs:126:13:126:29 | ExprStmt | match | -| variables.rs:125:14:128:9 | BlockExpr | variables.rs:120:5:129:5 | MatchExpr | | -| variables.rs:126:13:126:21 | PathExpr | variables.rs:126:23:126:27 | first | | -| variables.rs:126:13:126:28 | CallExpr | variables.rs:127:13:127:28 | ExprStmt | | -| variables.rs:126:13:126:29 | ExprStmt | variables.rs:126:13:126:21 | PathExpr | | -| variables.rs:126:23:126:27 | first | variables.rs:126:13:126:28 | CallExpr | | -| variables.rs:127:13:127:21 | PathExpr | variables.rs:127:23:127:26 | last | | -| variables.rs:127:13:127:27 | CallExpr | variables.rs:125:14:128:9 | BlockExpr | | -| variables.rs:127:13:127:28 | ExprStmt | variables.rs:127:13:127:21 | PathExpr | | -| variables.rs:127:23:127:26 | last | variables.rs:127:13:127:27 | CallExpr | | -| variables.rs:132:1:140:1 | enter match_pattern3 | variables.rs:133:5:133:38 | LetStmt | | -| variables.rs:132:1:140:1 | exit match_pattern3 (normal) | variables.rs:132:1:140:1 | exit match_pattern3 | | -| variables.rs:132:21:140:1 | BlockExpr | variables.rs:132:1:140:1 | exit match_pattern3 (normal) | | -| variables.rs:133:5:133:38 | LetStmt | variables.rs:133:25:133:27 | "x" | | -| variables.rs:133:9:133:10 | p2 | variables.rs:135:11:135:12 | p2 | match, no-match | -| variables.rs:133:14:133:37 | RecordExpr | variables.rs:133:9:133:10 | p2 | | -| variables.rs:133:25:133:27 | "x" | variables.rs:133:33:133:35 | "y" | | -| variables.rs:133:33:133:35 | "y" | variables.rs:133:14:133:37 | RecordExpr | | -| variables.rs:135:5:139:5 | MatchExpr | variables.rs:132:21:140:1 | BlockExpr | | -| variables.rs:135:11:135:12 | p2 | variables.rs:136:9:138:9 | RecordPat | | -| variables.rs:136:9:138:9 | RecordPat | variables.rs:138:14:138:22 | PathExpr | match | -| variables.rs:138:14:138:22 | PathExpr | variables.rs:138:24:138:25 | x7 | | -| variables.rs:138:14:138:26 | CallExpr | variables.rs:135:5:139:5 | MatchExpr | | -| variables.rs:138:24:138:25 | x7 | variables.rs:138:14:138:26 | CallExpr | | -| variables.rs:146:1:159:1 | enter match_pattern4 | variables.rs:147:5:147:39 | LetStmt | | -| variables.rs:146:1:159:1 | exit match_pattern4 (normal) | variables.rs:146:1:159:1 | exit match_pattern4 | | -| variables.rs:146:21:159:1 | BlockExpr | variables.rs:146:1:159:1 | exit match_pattern4 (normal) | | -| variables.rs:147:5:147:39 | LetStmt | variables.rs:147:36:147:36 | 0 | | -| variables.rs:147:9:147:11 | msg | variables.rs:149:11:149:13 | msg | match, no-match | -| variables.rs:147:15:147:38 | RecordExpr | variables.rs:147:9:147:11 | msg | | -| variables.rs:147:36:147:36 | 0 | variables.rs:147:15:147:38 | RecordExpr | | -| variables.rs:149:5:158:5 | MatchExpr | variables.rs:146:21:159:1 | BlockExpr | | -| variables.rs:149:11:149:13 | msg | variables.rs:150:9:152:9 | RecordPat | | -| variables.rs:150:9:152:9 | RecordPat | variables.rs:152:14:152:22 | PathExpr | match | -| variables.rs:150:9:152:9 | RecordPat | variables.rs:153:9:153:38 | RecordPat | no-match | -| variables.rs:152:14:152:22 | PathExpr | variables.rs:152:24:152:34 | id_variable | | -| variables.rs:152:14:152:35 | CallExpr | variables.rs:149:5:158:5 | MatchExpr | | -| variables.rs:152:24:152:34 | id_variable | variables.rs:152:14:152:35 | CallExpr | | -| variables.rs:153:9:153:38 | RecordPat | variables.rs:154:13:154:52 | MacroExpr | match | -| variables.rs:153:9:153:38 | RecordPat | variables.rs:156:9:156:29 | RecordPat | no-match | -| variables.rs:153:43:155:9 | BlockExpr | variables.rs:149:5:158:5 | MatchExpr | | -| variables.rs:154:13:154:52 | MacroExpr | variables.rs:153:43:155:9 | BlockExpr | | -| variables.rs:156:9:156:29 | RecordPat | variables.rs:157:13:157:21 | PathExpr | match | -| variables.rs:157:13:157:21 | PathExpr | variables.rs:157:23:157:24 | id | | -| variables.rs:157:13:157:25 | CallExpr | variables.rs:149:5:158:5 | MatchExpr | | -| variables.rs:157:23:157:24 | id | variables.rs:157:13:157:25 | CallExpr | | -| variables.rs:166:1:172:1 | enter match_pattern5 | variables.rs:167:5:167:34 | LetStmt | | -| variables.rs:166:1:172:1 | exit match_pattern5 (normal) | variables.rs:166:1:172:1 | exit match_pattern5 | | -| variables.rs:166:21:172:1 | BlockExpr | variables.rs:166:1:172:1 | exit match_pattern5 (normal) | | -| variables.rs:167:5:167:34 | LetStmt | variables.rs:167:18:167:29 | PathExpr | | -| variables.rs:167:9:167:14 | either | variables.rs:168:11:168:16 | either | match, no-match | -| variables.rs:167:18:167:29 | PathExpr | variables.rs:167:31:167:32 | 32 | | -| variables.rs:167:18:167:33 | CallExpr | variables.rs:167:9:167:14 | either | | -| variables.rs:167:31:167:32 | 32 | variables.rs:167:18:167:33 | CallExpr | | -| variables.rs:168:5:171:5 | MatchExpr | variables.rs:166:21:172:1 | BlockExpr | | -| variables.rs:168:11:168:16 | either | variables.rs:169:9:169:44 | OrPat | | -| variables.rs:169:9:169:44 | OrPat | variables.rs:170:16:170:24 | PathExpr | match | -| variables.rs:170:16:170:24 | PathExpr | variables.rs:170:26:170:27 | a3 | | -| variables.rs:170:16:170:28 | CallExpr | variables.rs:168:5:171:5 | MatchExpr | | -| variables.rs:170:26:170:27 | a3 | variables.rs:170:16:170:28 | CallExpr | | -| variables.rs:180:1:194:1 | enter match_pattern6 | variables.rs:181:5:181:37 | LetStmt | | -| variables.rs:180:1:194:1 | exit match_pattern6 (normal) | variables.rs:180:1:194:1 | exit match_pattern6 | | -| variables.rs:180:21:194:1 | BlockExpr | variables.rs:180:1:194:1 | exit match_pattern6 (normal) | | -| variables.rs:181:5:181:37 | LetStmt | variables.rs:181:14:181:32 | PathExpr | | -| variables.rs:181:9:181:10 | tv | variables.rs:182:5:185:5 | ExprStmt | match, no-match | -| variables.rs:181:14:181:32 | PathExpr | variables.rs:181:34:181:35 | 62 | | -| variables.rs:181:14:181:36 | CallExpr | variables.rs:181:9:181:10 | tv | | -| variables.rs:181:34:181:35 | 62 | variables.rs:181:14:181:36 | CallExpr | | -| variables.rs:182:5:185:5 | ExprStmt | variables.rs:182:11:182:12 | tv | | -| variables.rs:182:5:185:5 | MatchExpr | variables.rs:186:5:189:5 | ExprStmt | | -| variables.rs:182:11:182:12 | tv | variables.rs:183:9:183:81 | OrPat | | -| variables.rs:183:9:183:81 | OrPat | variables.rs:184:16:184:24 | PathExpr | match | -| variables.rs:184:16:184:24 | PathExpr | variables.rs:184:26:184:27 | a4 | | -| variables.rs:184:16:184:28 | CallExpr | variables.rs:182:5:185:5 | MatchExpr | | -| variables.rs:184:26:184:27 | a4 | variables.rs:184:16:184:28 | CallExpr | | -| variables.rs:186:5:189:5 | ExprStmt | variables.rs:186:11:186:12 | tv | | -| variables.rs:186:5:189:5 | MatchExpr | variables.rs:190:11:190:12 | tv | | -| variables.rs:186:11:186:12 | tv | variables.rs:187:9:187:83 | OrPat | | -| variables.rs:187:9:187:83 | OrPat | variables.rs:188:16:188:24 | PathExpr | match | -| variables.rs:188:16:188:24 | PathExpr | variables.rs:188:26:188:27 | a5 | | -| variables.rs:188:16:188:28 | CallExpr | variables.rs:186:5:189:5 | MatchExpr | | -| variables.rs:188:26:188:27 | a5 | variables.rs:188:16:188:28 | CallExpr | | -| variables.rs:190:5:193:5 | MatchExpr | variables.rs:180:21:194:1 | BlockExpr | | -| variables.rs:190:11:190:12 | tv | variables.rs:191:9:191:83 | OrPat | | -| variables.rs:191:9:191:83 | OrPat | variables.rs:192:16:192:24 | PathExpr | match | -| variables.rs:192:16:192:24 | PathExpr | variables.rs:192:26:192:27 | a6 | | -| variables.rs:192:16:192:28 | CallExpr | variables.rs:190:5:193:5 | MatchExpr | | -| variables.rs:192:26:192:27 | a6 | variables.rs:192:16:192:28 | CallExpr | | -| variables.rs:196:1:204:1 | enter match_pattern7 | variables.rs:197:5:197:34 | LetStmt | | -| variables.rs:196:1:204:1 | exit match_pattern7 (normal) | variables.rs:196:1:204:1 | exit match_pattern7 | | -| variables.rs:196:21:204:1 | BlockExpr | variables.rs:196:1:204:1 | exit match_pattern7 (normal) | | -| variables.rs:197:5:197:34 | LetStmt | variables.rs:197:18:197:29 | PathExpr | | -| variables.rs:197:9:197:14 | either | variables.rs:198:11:198:16 | either | match, no-match | -| variables.rs:197:18:197:29 | PathExpr | variables.rs:197:31:197:32 | 32 | | -| variables.rs:197:18:197:33 | CallExpr | variables.rs:197:9:197:14 | either | | -| variables.rs:197:31:197:32 | 32 | variables.rs:197:18:197:33 | CallExpr | | -| variables.rs:198:5:203:5 | MatchExpr | variables.rs:196:21:204:1 | BlockExpr | | -| variables.rs:198:11:198:16 | either | variables.rs:199:9:199:44 | OrPat | | -| variables.rs:199:9:199:44 | OrPat | variables.rs:200:16:200:17 | a7 | match | -| variables.rs:199:9:199:44 | OrPat | variables.rs:202:9:202:9 | WildcardPat | no-match | -| variables.rs:200:16:200:17 | a7 | variables.rs:200:21:200:21 | 0 | | -| variables.rs:200:16:200:21 | ... > ... | variables.rs:201:16:201:24 | PathExpr | true | -| variables.rs:200:16:200:21 | ... > ... | variables.rs:202:9:202:9 | WildcardPat | false | -| variables.rs:200:21:200:21 | 0 | variables.rs:200:16:200:21 | ... > ... | | -| variables.rs:201:16:201:24 | PathExpr | variables.rs:201:26:201:27 | a7 | | -| variables.rs:201:16:201:28 | CallExpr | variables.rs:198:5:203:5 | MatchExpr | | -| variables.rs:201:26:201:27 | a7 | variables.rs:201:16:201:28 | CallExpr | | -| variables.rs:202:9:202:9 | WildcardPat | variables.rs:202:14:202:15 | TupleExpr | match | -| variables.rs:202:14:202:15 | TupleExpr | variables.rs:198:5:203:5 | MatchExpr | | -| variables.rs:206:1:221:1 | enter match_pattern8 | variables.rs:207:5:207:34 | LetStmt | | -| variables.rs:206:1:221:1 | exit match_pattern8 (normal) | variables.rs:206:1:221:1 | exit match_pattern8 | | -| variables.rs:206:21:221:1 | BlockExpr | variables.rs:206:1:221:1 | exit match_pattern8 (normal) | | -| variables.rs:207:5:207:34 | LetStmt | variables.rs:207:18:207:29 | PathExpr | | -| variables.rs:207:9:207:14 | either | variables.rs:209:11:209:16 | either | match, no-match | -| variables.rs:207:18:207:29 | PathExpr | variables.rs:207:31:207:32 | 32 | | -| variables.rs:207:18:207:33 | CallExpr | variables.rs:207:9:207:14 | either | | -| variables.rs:207:31:207:32 | 32 | variables.rs:207:18:207:33 | CallExpr | | -| variables.rs:209:5:220:5 | MatchExpr | variables.rs:206:21:221:1 | BlockExpr | | -| variables.rs:209:11:209:16 | either | variables.rs:210:9:211:52 | e | | -| variables.rs:210:9:211:52 | e | variables.rs:213:13:213:27 | ExprStmt | match | -| variables.rs:210:9:211:52 | e | variables.rs:219:9:219:9 | WildcardPat | no-match | -| variables.rs:212:12:218:9 | BlockExpr | variables.rs:209:5:220:5 | MatchExpr | | -| variables.rs:213:13:213:21 | PathExpr | variables.rs:213:23:213:25 | a11 | | -| variables.rs:213:13:213:26 | CallExpr | variables.rs:214:16:215:15 | LetExpr | | -| variables.rs:213:13:213:27 | ExprStmt | variables.rs:213:13:213:21 | PathExpr | | -| variables.rs:213:23:213:25 | a11 | variables.rs:213:13:213:26 | CallExpr | | -| variables.rs:214:13:217:13 | IfExpr | variables.rs:212:12:218:9 | BlockExpr | | -| variables.rs:214:16:215:15 | LetExpr | variables.rs:214:20:214:36 | TupleStructPat | | -| variables.rs:214:20:214:36 | TupleStructPat | variables.rs:214:13:217:13 | IfExpr | no-match | -| variables.rs:214:20:214:36 | TupleStructPat | variables.rs:216:17:216:32 | ExprStmt | match | -| variables.rs:215:17:217:13 | BlockExpr | variables.rs:214:13:217:13 | IfExpr | | -| variables.rs:216:17:216:25 | PathExpr | variables.rs:216:28:216:30 | a12 | | -| variables.rs:216:17:216:31 | CallExpr | variables.rs:215:17:217:13 | BlockExpr | | -| variables.rs:216:17:216:32 | ExprStmt | variables.rs:216:17:216:25 | PathExpr | | -| variables.rs:216:27:216:30 | * ... | variables.rs:216:17:216:31 | CallExpr | | -| variables.rs:216:28:216:30 | a12 | variables.rs:216:27:216:30 | * ... | | -| variables.rs:219:9:219:9 | WildcardPat | variables.rs:219:14:219:15 | TupleExpr | match | -| variables.rs:219:14:219:15 | TupleExpr | variables.rs:209:5:220:5 | MatchExpr | | -| variables.rs:230:1:236:1 | enter match_pattern9 | variables.rs:231:5:231:36 | LetStmt | | -| variables.rs:230:1:236:1 | exit match_pattern9 (normal) | variables.rs:230:1:236:1 | exit match_pattern9 | | -| variables.rs:230:21:236:1 | BlockExpr | variables.rs:230:1:236:1 | exit match_pattern9 (normal) | | -| variables.rs:231:5:231:36 | LetStmt | variables.rs:231:14:231:31 | PathExpr | | -| variables.rs:231:9:231:10 | fv | variables.rs:232:11:232:12 | fv | match, no-match | -| variables.rs:231:14:231:31 | PathExpr | variables.rs:231:33:231:34 | 62 | | -| variables.rs:231:14:231:35 | CallExpr | variables.rs:231:9:231:10 | fv | | -| variables.rs:231:33:231:34 | 62 | variables.rs:231:14:231:35 | CallExpr | | -| variables.rs:232:5:235:5 | MatchExpr | variables.rs:230:21:236:1 | BlockExpr | | -| variables.rs:232:11:232:12 | fv | variables.rs:233:9:233:109 | OrPat | | -| variables.rs:233:9:233:109 | OrPat | variables.rs:234:16:234:24 | PathExpr | match | -| variables.rs:234:16:234:24 | PathExpr | variables.rs:234:26:234:28 | a13 | | -| variables.rs:234:16:234:29 | CallExpr | variables.rs:232:5:235:5 | MatchExpr | | -| variables.rs:234:26:234:28 | a13 | variables.rs:234:16:234:29 | CallExpr | | -| variables.rs:238:1:247:1 | enter param_pattern1 | variables.rs:244:5:244:18 | ExprStmt | | -| variables.rs:238:1:247:1 | exit param_pattern1 (normal) | variables.rs:238:1:247:1 | exit param_pattern1 | | -| variables.rs:243:28:247:1 | BlockExpr | variables.rs:238:1:247:1 | exit param_pattern1 (normal) | | -| variables.rs:244:5:244:13 | PathExpr | variables.rs:244:15:244:16 | a8 | | -| variables.rs:244:5:244:17 | CallExpr | variables.rs:245:5:245:18 | ExprStmt | | -| variables.rs:244:5:244:18 | ExprStmt | variables.rs:244:5:244:13 | PathExpr | | -| variables.rs:244:15:244:16 | a8 | variables.rs:244:5:244:17 | CallExpr | | -| variables.rs:245:5:245:13 | PathExpr | variables.rs:245:15:245:16 | b3 | | -| variables.rs:245:5:245:17 | CallExpr | variables.rs:246:5:246:18 | ExprStmt | | -| variables.rs:245:5:245:18 | ExprStmt | variables.rs:245:5:245:13 | PathExpr | | -| variables.rs:245:15:245:16 | b3 | variables.rs:245:5:245:17 | CallExpr | | -| variables.rs:246:5:246:13 | PathExpr | variables.rs:246:15:246:16 | c1 | | -| variables.rs:246:5:246:17 | CallExpr | variables.rs:243:28:247:1 | BlockExpr | | -| variables.rs:246:5:246:18 | ExprStmt | variables.rs:246:5:246:13 | PathExpr | | -| variables.rs:246:15:246:16 | c1 | variables.rs:246:5:246:17 | CallExpr | | -| variables.rs:249:1:253:1 | enter param_pattern2 | variables.rs:252:5:252:18 | ExprStmt | | -| variables.rs:249:1:253:1 | exit param_pattern2 (normal) | variables.rs:249:1:253:1 | exit param_pattern2 | | -| variables.rs:251:9:253:1 | BlockExpr | variables.rs:249:1:253:1 | exit param_pattern2 (normal) | | -| variables.rs:252:5:252:13 | PathExpr | variables.rs:252:15:252:16 | a9 | | -| variables.rs:252:5:252:17 | CallExpr | variables.rs:251:9:253:1 | BlockExpr | | -| variables.rs:252:5:252:18 | ExprStmt | variables.rs:252:5:252:13 | PathExpr | | -| variables.rs:252:15:252:16 | a9 | variables.rs:252:5:252:17 | CallExpr | | -| variables.rs:255:1:290:1 | enter destruct_assignment | variables.rs:256:5:260:18 | LetStmt | | -| variables.rs:255:1:290:1 | exit destruct_assignment (normal) | variables.rs:255:1:290:1 | exit destruct_assignment | | -| variables.rs:255:26:290:1 | BlockExpr | variables.rs:255:1:290:1 | exit destruct_assignment (normal) | | -| variables.rs:256:5:260:18 | LetStmt | variables.rs:260:10:260:10 | 1 | | -| variables.rs:256:9:260:5 | TuplePat | variables.rs:261:5:261:19 | ExprStmt | match | -| variables.rs:260:9:260:17 | TupleExpr | variables.rs:256:9:260:5 | TuplePat | | -| variables.rs:260:10:260:10 | 1 | variables.rs:260:13:260:13 | 2 | | -| variables.rs:260:13:260:13 | 2 | variables.rs:260:16:260:16 | 3 | | -| variables.rs:260:16:260:16 | 3 | variables.rs:260:9:260:17 | TupleExpr | | -| variables.rs:261:5:261:13 | PathExpr | variables.rs:261:15:261:17 | a10 | | -| variables.rs:261:5:261:18 | CallExpr | variables.rs:262:5:262:18 | ExprStmt | | -| variables.rs:261:5:261:19 | ExprStmt | variables.rs:261:5:261:13 | PathExpr | | -| variables.rs:261:15:261:17 | a10 | variables.rs:261:5:261:18 | CallExpr | | -| variables.rs:262:5:262:13 | PathExpr | variables.rs:262:15:262:16 | b4 | | -| variables.rs:262:5:262:17 | CallExpr | variables.rs:263:5:263:18 | ExprStmt | | -| variables.rs:262:5:262:18 | ExprStmt | variables.rs:262:5:262:13 | PathExpr | | -| variables.rs:262:15:262:16 | b4 | variables.rs:262:5:262:17 | CallExpr | | -| variables.rs:263:5:263:13 | PathExpr | variables.rs:263:15:263:16 | c2 | | -| variables.rs:263:5:263:17 | CallExpr | variables.rs:265:5:273:6 | ExprStmt | | -| variables.rs:263:5:263:18 | ExprStmt | variables.rs:263:5:263:13 | PathExpr | | -| variables.rs:263:15:263:16 | c2 | variables.rs:263:5:263:17 | CallExpr | | -| variables.rs:265:5:269:5 | TupleExpr | variables.rs:270:9:270:11 | a10 | | -| variables.rs:265:5:273:5 | ... = ... | variables.rs:274:5:274:19 | ExprStmt | | -| variables.rs:265:5:273:6 | ExprStmt | variables.rs:266:9:266:10 | c2 | | -| variables.rs:266:9:266:10 | c2 | variables.rs:267:9:267:10 | b4 | | -| variables.rs:267:9:267:10 | b4 | variables.rs:268:9:268:11 | a10 | | -| variables.rs:268:9:268:11 | a10 | variables.rs:265:5:269:5 | TupleExpr | | -| variables.rs:269:9:273:5 | TupleExpr | variables.rs:265:5:273:5 | ... = ... | | -| variables.rs:270:9:270:11 | a10 | variables.rs:271:9:271:10 | b4 | | -| variables.rs:271:9:271:10 | b4 | variables.rs:272:9:272:10 | c2 | | -| variables.rs:272:9:272:10 | c2 | variables.rs:269:9:273:5 | TupleExpr | | -| variables.rs:274:5:274:13 | PathExpr | variables.rs:274:15:274:17 | a10 | | -| variables.rs:274:5:274:18 | CallExpr | variables.rs:275:5:275:18 | ExprStmt | | -| variables.rs:274:5:274:19 | ExprStmt | variables.rs:274:5:274:13 | PathExpr | | -| variables.rs:274:15:274:17 | a10 | variables.rs:274:5:274:18 | CallExpr | | -| variables.rs:275:5:275:13 | PathExpr | variables.rs:275:15:275:16 | b4 | | -| variables.rs:275:5:275:17 | CallExpr | variables.rs:276:5:276:18 | ExprStmt | | -| variables.rs:275:5:275:18 | ExprStmt | variables.rs:275:5:275:13 | PathExpr | | -| variables.rs:275:15:275:16 | b4 | variables.rs:275:5:275:17 | CallExpr | | -| variables.rs:276:5:276:13 | PathExpr | variables.rs:276:15:276:16 | c2 | | -| variables.rs:276:5:276:17 | CallExpr | variables.rs:278:5:286:5 | ExprStmt | | -| variables.rs:276:5:276:18 | ExprStmt | variables.rs:276:5:276:13 | PathExpr | | -| variables.rs:276:15:276:16 | c2 | variables.rs:276:5:276:17 | CallExpr | | -| variables.rs:278:5:286:5 | ExprStmt | variables.rs:278:12:278:12 | 4 | | -| variables.rs:278:5:286:5 | MatchExpr | variables.rs:288:5:288:19 | ExprStmt | | -| variables.rs:278:11:278:16 | TupleExpr | variables.rs:279:9:282:9 | TuplePat | | -| variables.rs:278:12:278:12 | 4 | variables.rs:278:15:278:15 | 5 | | -| variables.rs:278:15:278:15 | 5 | variables.rs:278:11:278:16 | TupleExpr | | -| variables.rs:279:9:282:9 | TuplePat | variables.rs:283:13:283:27 | ExprStmt | match | -| variables.rs:282:14:285:9 | BlockExpr | variables.rs:278:5:286:5 | MatchExpr | | -| variables.rs:283:13:283:21 | PathExpr | variables.rs:283:23:283:25 | a10 | | -| variables.rs:283:13:283:26 | CallExpr | variables.rs:284:13:284:26 | ExprStmt | | -| variables.rs:283:13:283:27 | ExprStmt | variables.rs:283:13:283:21 | PathExpr | | -| variables.rs:283:23:283:25 | a10 | variables.rs:283:13:283:26 | CallExpr | | -| variables.rs:284:13:284:21 | PathExpr | variables.rs:284:23:284:24 | b4 | | -| variables.rs:284:13:284:25 | CallExpr | variables.rs:282:14:285:9 | BlockExpr | | -| variables.rs:284:13:284:26 | ExprStmt | variables.rs:284:13:284:21 | PathExpr | | -| variables.rs:284:23:284:24 | b4 | variables.rs:284:13:284:25 | CallExpr | | -| variables.rs:288:5:288:13 | PathExpr | variables.rs:288:15:288:17 | a10 | | -| variables.rs:288:5:288:18 | CallExpr | variables.rs:289:5:289:18 | ExprStmt | | -| variables.rs:288:5:288:19 | ExprStmt | variables.rs:288:5:288:13 | PathExpr | | -| variables.rs:288:15:288:17 | a10 | variables.rs:288:5:288:18 | CallExpr | | -| variables.rs:289:5:289:13 | PathExpr | variables.rs:289:15:289:16 | b4 | | -| variables.rs:289:5:289:17 | CallExpr | variables.rs:255:26:290:1 | BlockExpr | | -| variables.rs:289:5:289:18 | ExprStmt | variables.rs:289:5:289:13 | PathExpr | | -| variables.rs:289:15:289:16 | b4 | variables.rs:289:5:289:17 | CallExpr | | -| variables.rs:292:1:307:1 | enter closure_variable | variables.rs:293:5:295:10 | LetStmt | | -| variables.rs:292:1:307:1 | exit closure_variable (normal) | variables.rs:292:1:307:1 | exit closure_variable | | -| variables.rs:292:23:307:1 | BlockExpr | variables.rs:292:1:307:1 | exit closure_variable (normal) | | -| variables.rs:293:5:295:10 | LetStmt | variables.rs:294:9:295:9 | ClosureExpr | | -| variables.rs:293:9:293:23 | example_closure | variables.rs:296:5:297:27 | LetStmt | match, no-match | -| variables.rs:294:9:295:9 | ClosureExpr | variables.rs:293:9:293:23 | example_closure | | -| variables.rs:294:9:295:9 | enter ClosureExpr | variables.rs:295:9:295:9 | x | | -| variables.rs:294:9:295:9 | exit ClosureExpr (normal) | variables.rs:294:9:295:9 | exit ClosureExpr | | -| variables.rs:295:9:295:9 | x | variables.rs:294:9:295:9 | exit ClosureExpr (normal) | | -| variables.rs:296:5:297:27 | LetStmt | variables.rs:297:9:297:23 | example_closure | | -| variables.rs:296:9:296:10 | n1 | variables.rs:298:5:298:18 | ExprStmt | match, no-match | -| variables.rs:297:9:297:23 | example_closure | variables.rs:297:25:297:25 | 5 | | -| variables.rs:297:9:297:26 | CallExpr | variables.rs:296:9:296:10 | n1 | | -| variables.rs:297:25:297:25 | 5 | variables.rs:297:9:297:26 | CallExpr | | -| variables.rs:298:5:298:13 | PathExpr | variables.rs:298:15:298:16 | n1 | | -| variables.rs:298:5:298:17 | CallExpr | variables.rs:300:5:300:25 | ExprStmt | | +| variables.rs:88:1:95:1 | enter let_pattern5 | variables.rs:89:5:89:42 | LetStmt | | +| variables.rs:88:1:95:1 | exit let_pattern5 (normal) | variables.rs:88:1:95:1 | exit let_pattern5 | | +| variables.rs:88:19:95:1 | BlockExpr | variables.rs:88:1:95:1 | exit let_pattern5 (normal) | | +| variables.rs:89:5:89:42 | LetStmt | variables.rs:89:14:89:17 | PathExpr | | +| variables.rs:89:9:89:10 | s1 | variables.rs:91:11:92:12 | LetExpr | match, no-match | +| variables.rs:89:14:89:17 | PathExpr | variables.rs:89:19:89:30 | PathExpr | | +| variables.rs:89:14:89:41 | CallExpr | variables.rs:89:9:89:10 | s1 | | +| variables.rs:89:19:89:30 | PathExpr | variables.rs:89:32:89:39 | "Hello!" | | +| variables.rs:89:19:89:40 | CallExpr | variables.rs:89:14:89:41 | CallExpr | | +| variables.rs:89:32:89:39 | "Hello!" | variables.rs:89:19:89:40 | CallExpr | | +| variables.rs:91:5:94:5 | WhileExpr | variables.rs:88:19:95:1 | BlockExpr | | +| variables.rs:91:11:92:12 | LetExpr | variables.rs:91:15:91:26 | TupleStructPat | | +| variables.rs:91:15:91:26 | TupleStructPat | variables.rs:91:5:94:5 | WhileExpr | no-match | +| variables.rs:91:15:91:26 | TupleStructPat | variables.rs:93:9:93:22 | ExprStmt | match | +| variables.rs:92:14:94:5 | BlockExpr | variables.rs:91:11:92:12 | LetExpr | | +| variables.rs:93:9:93:17 | PathExpr | variables.rs:93:19:93:20 | s2 | | +| variables.rs:93:9:93:21 | CallExpr | variables.rs:92:14:94:5 | BlockExpr | | +| variables.rs:93:9:93:22 | ExprStmt | variables.rs:93:9:93:17 | PathExpr | | +| variables.rs:93:19:93:20 | s2 | variables.rs:93:9:93:21 | CallExpr | | +| variables.rs:97:1:112:1 | enter match_pattern1 | variables.rs:98:5:98:21 | LetStmt | | +| variables.rs:97:1:112:1 | exit match_pattern1 (normal) | variables.rs:97:1:112:1 | exit match_pattern1 | | +| variables.rs:97:21:112:1 | BlockExpr | variables.rs:97:1:112:1 | exit match_pattern1 (normal) | | +| variables.rs:98:5:98:21 | LetStmt | variables.rs:98:14:98:17 | PathExpr | | +| variables.rs:98:9:98:10 | x6 | variables.rs:99:5:99:16 | LetStmt | match, no-match | +| variables.rs:98:14:98:17 | PathExpr | variables.rs:98:19:98:19 | 5 | | +| variables.rs:98:14:98:20 | CallExpr | variables.rs:98:9:98:10 | x6 | | +| variables.rs:98:19:98:19 | 5 | variables.rs:98:14:98:20 | CallExpr | | +| variables.rs:99:5:99:16 | LetStmt | variables.rs:99:14:99:15 | 10 | | +| variables.rs:99:9:99:10 | y1 | variables.rs:101:5:109:5 | ExprStmt | match, no-match | +| variables.rs:99:14:99:15 | 10 | variables.rs:99:9:99:10 | y1 | | +| variables.rs:101:5:109:5 | ExprStmt | variables.rs:101:11:101:12 | x6 | | +| variables.rs:101:5:109:5 | MatchExpr | variables.rs:111:5:111:18 | ExprStmt | | +| variables.rs:101:11:101:12 | x6 | variables.rs:102:9:102:16 | TupleStructPat | | +| variables.rs:102:9:102:16 | TupleStructPat | variables.rs:102:21:102:29 | PathExpr | match | +| variables.rs:102:9:102:16 | TupleStructPat | variables.rs:103:9:103:16 | TupleStructPat | no-match | +| variables.rs:102:21:102:29 | PathExpr | variables.rs:102:31:102:38 | "Got 50" | | +| variables.rs:102:21:102:39 | CallExpr | variables.rs:101:5:109:5 | MatchExpr | | +| variables.rs:102:31:102:38 | "Got 50" | variables.rs:102:21:102:39 | CallExpr | | +| variables.rs:103:9:103:16 | TupleStructPat | variables.rs:106:13:106:21 | PathExpr | match | +| variables.rs:103:9:103:16 | TupleStructPat | variables.rs:108:9:108:12 | None | no-match | +| variables.rs:105:9:107:9 | BlockExpr | variables.rs:101:5:109:5 | MatchExpr | | +| variables.rs:106:13:106:21 | PathExpr | variables.rs:106:23:106:24 | y1 | | +| variables.rs:106:13:106:25 | CallExpr | variables.rs:105:9:107:9 | BlockExpr | | +| variables.rs:106:23:106:24 | y1 | variables.rs:106:13:106:25 | CallExpr | | +| variables.rs:108:9:108:12 | None | variables.rs:108:17:108:25 | PathExpr | match | +| variables.rs:108:17:108:25 | PathExpr | variables.rs:108:27:108:32 | "NONE" | | +| variables.rs:108:17:108:33 | CallExpr | variables.rs:101:5:109:5 | MatchExpr | | +| variables.rs:108:27:108:32 | "NONE" | variables.rs:108:17:108:33 | CallExpr | | +| variables.rs:111:5:111:13 | PathExpr | variables.rs:111:15:111:16 | y1 | | +| variables.rs:111:5:111:17 | CallExpr | variables.rs:97:21:112:1 | BlockExpr | | +| variables.rs:111:5:111:18 | ExprStmt | variables.rs:111:5:111:13 | PathExpr | | +| variables.rs:111:15:111:16 | y1 | variables.rs:111:5:111:17 | CallExpr | | +| variables.rs:114:1:139:1 | enter match_pattern2 | variables.rs:115:5:115:36 | LetStmt | | +| variables.rs:114:1:139:1 | exit match_pattern2 (normal) | variables.rs:114:1:139:1 | exit match_pattern2 | | +| variables.rs:114:21:139:1 | BlockExpr | variables.rs:114:1:139:1 | exit match_pattern2 (normal) | | +| variables.rs:115:5:115:36 | LetStmt | variables.rs:115:20:115:20 | 2 | | +| variables.rs:115:9:115:15 | numbers | variables.rs:117:5:127:5 | ExprStmt | match, no-match | +| variables.rs:115:19:115:35 | TupleExpr | variables.rs:115:9:115:15 | numbers | | +| variables.rs:115:20:115:20 | 2 | variables.rs:115:23:115:23 | 4 | | +| variables.rs:115:23:115:23 | 4 | variables.rs:115:26:115:26 | 8 | | +| variables.rs:115:26:115:26 | 8 | variables.rs:115:29:115:30 | 16 | | +| variables.rs:115:29:115:30 | 16 | variables.rs:115:33:115:34 | 32 | | +| variables.rs:115:33:115:34 | 32 | variables.rs:115:19:115:35 | TupleExpr | | +| variables.rs:117:5:127:5 | ExprStmt | variables.rs:117:11:117:17 | numbers | | +| variables.rs:117:5:127:5 | MatchExpr | variables.rs:129:11:129:17 | numbers | | +| variables.rs:117:11:117:17 | numbers | variables.rs:118:9:122:9 | TuplePat | | +| variables.rs:118:9:122:9 | TuplePat | variables.rs:123:13:123:29 | ExprStmt | match | +| variables.rs:122:14:126:9 | BlockExpr | variables.rs:117:5:127:5 | MatchExpr | | +| variables.rs:123:13:123:21 | PathExpr | variables.rs:123:23:123:27 | first | | +| variables.rs:123:13:123:28 | CallExpr | variables.rs:124:13:124:29 | ExprStmt | | +| variables.rs:123:13:123:29 | ExprStmt | variables.rs:123:13:123:21 | PathExpr | | +| variables.rs:123:23:123:27 | first | variables.rs:123:13:123:28 | CallExpr | | +| variables.rs:124:13:124:21 | PathExpr | variables.rs:124:23:124:27 | third | | +| variables.rs:124:13:124:28 | CallExpr | variables.rs:125:13:125:29 | ExprStmt | | +| variables.rs:124:13:124:29 | ExprStmt | variables.rs:124:13:124:21 | PathExpr | | +| variables.rs:124:23:124:27 | third | variables.rs:124:13:124:28 | CallExpr | | +| variables.rs:125:13:125:21 | PathExpr | variables.rs:125:23:125:27 | fifth | | +| variables.rs:125:13:125:28 | CallExpr | variables.rs:122:14:126:9 | BlockExpr | | +| variables.rs:125:13:125:29 | ExprStmt | variables.rs:125:13:125:21 | PathExpr | | +| variables.rs:125:23:125:27 | fifth | variables.rs:125:13:125:28 | CallExpr | | +| variables.rs:129:5:138:5 | MatchExpr | variables.rs:114:21:139:1 | BlockExpr | | +| variables.rs:129:11:129:17 | numbers | variables.rs:130:9:134:9 | TuplePat | | +| variables.rs:130:9:134:9 | TuplePat | variables.rs:135:13:135:29 | ExprStmt | match | +| variables.rs:134:14:137:9 | BlockExpr | variables.rs:129:5:138:5 | MatchExpr | | +| variables.rs:135:13:135:21 | PathExpr | variables.rs:135:23:135:27 | first | | +| variables.rs:135:13:135:28 | CallExpr | variables.rs:136:13:136:28 | ExprStmt | | +| variables.rs:135:13:135:29 | ExprStmt | variables.rs:135:13:135:21 | PathExpr | | +| variables.rs:135:23:135:27 | first | variables.rs:135:13:135:28 | CallExpr | | +| variables.rs:136:13:136:21 | PathExpr | variables.rs:136:23:136:26 | last | | +| variables.rs:136:13:136:27 | CallExpr | variables.rs:134:14:137:9 | BlockExpr | | +| variables.rs:136:13:136:28 | ExprStmt | variables.rs:136:13:136:21 | PathExpr | | +| variables.rs:136:23:136:26 | last | variables.rs:136:13:136:27 | CallExpr | | +| variables.rs:141:1:149:1 | enter match_pattern3 | variables.rs:142:5:142:38 | LetStmt | | +| variables.rs:141:1:149:1 | exit match_pattern3 (normal) | variables.rs:141:1:149:1 | exit match_pattern3 | | +| variables.rs:141:21:149:1 | BlockExpr | variables.rs:141:1:149:1 | exit match_pattern3 (normal) | | +| variables.rs:142:5:142:38 | LetStmt | variables.rs:142:25:142:27 | "x" | | +| variables.rs:142:9:142:10 | p2 | variables.rs:144:11:144:12 | p2 | match, no-match | +| variables.rs:142:14:142:37 | RecordExpr | variables.rs:142:9:142:10 | p2 | | +| variables.rs:142:25:142:27 | "x" | variables.rs:142:33:142:35 | "y" | | +| variables.rs:142:33:142:35 | "y" | variables.rs:142:14:142:37 | RecordExpr | | +| variables.rs:144:5:148:5 | MatchExpr | variables.rs:141:21:149:1 | BlockExpr | | +| variables.rs:144:11:144:12 | p2 | variables.rs:145:9:147:9 | RecordPat | | +| variables.rs:145:9:147:9 | RecordPat | variables.rs:147:14:147:22 | PathExpr | match | +| variables.rs:147:14:147:22 | PathExpr | variables.rs:147:24:147:25 | x7 | | +| variables.rs:147:14:147:26 | CallExpr | variables.rs:144:5:148:5 | MatchExpr | | +| variables.rs:147:24:147:25 | x7 | variables.rs:147:14:147:26 | CallExpr | | +| variables.rs:155:1:168:1 | enter match_pattern4 | variables.rs:156:5:156:39 | LetStmt | | +| variables.rs:155:1:168:1 | exit match_pattern4 (normal) | variables.rs:155:1:168:1 | exit match_pattern4 | | +| variables.rs:155:21:168:1 | BlockExpr | variables.rs:155:1:168:1 | exit match_pattern4 (normal) | | +| variables.rs:156:5:156:39 | LetStmt | variables.rs:156:36:156:36 | 0 | | +| variables.rs:156:9:156:11 | msg | variables.rs:158:11:158:13 | msg | match, no-match | +| variables.rs:156:15:156:38 | RecordExpr | variables.rs:156:9:156:11 | msg | | +| variables.rs:156:36:156:36 | 0 | variables.rs:156:15:156:38 | RecordExpr | | +| variables.rs:158:5:167:5 | MatchExpr | variables.rs:155:21:168:1 | BlockExpr | | +| variables.rs:158:11:158:13 | msg | variables.rs:159:9:161:9 | RecordPat | | +| variables.rs:159:9:161:9 | RecordPat | variables.rs:161:14:161:22 | PathExpr | match | +| variables.rs:159:9:161:9 | RecordPat | variables.rs:162:9:162:38 | RecordPat | no-match | +| variables.rs:161:14:161:22 | PathExpr | variables.rs:161:24:161:34 | id_variable | | +| variables.rs:161:14:161:35 | CallExpr | variables.rs:158:5:167:5 | MatchExpr | | +| variables.rs:161:24:161:34 | id_variable | variables.rs:161:14:161:35 | CallExpr | | +| variables.rs:162:9:162:38 | RecordPat | variables.rs:163:13:163:52 | MacroExpr | match | +| variables.rs:162:9:162:38 | RecordPat | variables.rs:165:9:165:29 | RecordPat | no-match | +| variables.rs:162:43:164:9 | BlockExpr | variables.rs:158:5:167:5 | MatchExpr | | +| variables.rs:163:13:163:52 | MacroExpr | variables.rs:162:43:164:9 | BlockExpr | | +| variables.rs:165:9:165:29 | RecordPat | variables.rs:166:13:166:21 | PathExpr | match | +| variables.rs:166:13:166:21 | PathExpr | variables.rs:166:23:166:24 | id | | +| variables.rs:166:13:166:25 | CallExpr | variables.rs:158:5:167:5 | MatchExpr | | +| variables.rs:166:23:166:24 | id | variables.rs:166:13:166:25 | CallExpr | | +| variables.rs:175:1:181:1 | enter match_pattern5 | variables.rs:176:5:176:34 | LetStmt | | +| variables.rs:175:1:181:1 | exit match_pattern5 (normal) | variables.rs:175:1:181:1 | exit match_pattern5 | | +| variables.rs:175:21:181:1 | BlockExpr | variables.rs:175:1:181:1 | exit match_pattern5 (normal) | | +| variables.rs:176:5:176:34 | LetStmt | variables.rs:176:18:176:29 | PathExpr | | +| variables.rs:176:9:176:14 | either | variables.rs:177:11:177:16 | either | match, no-match | +| variables.rs:176:18:176:29 | PathExpr | variables.rs:176:31:176:32 | 32 | | +| variables.rs:176:18:176:33 | CallExpr | variables.rs:176:9:176:14 | either | | +| variables.rs:176:31:176:32 | 32 | variables.rs:176:18:176:33 | CallExpr | | +| variables.rs:177:5:180:5 | MatchExpr | variables.rs:175:21:181:1 | BlockExpr | | +| variables.rs:177:11:177:16 | either | variables.rs:178:9:178:44 | OrPat | | +| variables.rs:178:9:178:44 | OrPat | variables.rs:179:16:179:24 | PathExpr | match | +| variables.rs:179:16:179:24 | PathExpr | variables.rs:179:26:179:27 | a3 | | +| variables.rs:179:16:179:28 | CallExpr | variables.rs:177:5:180:5 | MatchExpr | | +| variables.rs:179:26:179:27 | a3 | variables.rs:179:16:179:28 | CallExpr | | +| variables.rs:189:1:203:1 | enter match_pattern6 | variables.rs:190:5:190:37 | LetStmt | | +| variables.rs:189:1:203:1 | exit match_pattern6 (normal) | variables.rs:189:1:203:1 | exit match_pattern6 | | +| variables.rs:189:21:203:1 | BlockExpr | variables.rs:189:1:203:1 | exit match_pattern6 (normal) | | +| variables.rs:190:5:190:37 | LetStmt | variables.rs:190:14:190:32 | PathExpr | | +| variables.rs:190:9:190:10 | tv | variables.rs:191:5:194:5 | ExprStmt | match, no-match | +| variables.rs:190:14:190:32 | PathExpr | variables.rs:190:34:190:35 | 62 | | +| variables.rs:190:14:190:36 | CallExpr | variables.rs:190:9:190:10 | tv | | +| variables.rs:190:34:190:35 | 62 | variables.rs:190:14:190:36 | CallExpr | | +| variables.rs:191:5:194:5 | ExprStmt | variables.rs:191:11:191:12 | tv | | +| variables.rs:191:5:194:5 | MatchExpr | variables.rs:195:5:198:5 | ExprStmt | | +| variables.rs:191:11:191:12 | tv | variables.rs:192:9:192:81 | OrPat | | +| variables.rs:192:9:192:81 | OrPat | variables.rs:193:16:193:24 | PathExpr | match | +| variables.rs:193:16:193:24 | PathExpr | variables.rs:193:26:193:27 | a4 | | +| variables.rs:193:16:193:28 | CallExpr | variables.rs:191:5:194:5 | MatchExpr | | +| variables.rs:193:26:193:27 | a4 | variables.rs:193:16:193:28 | CallExpr | | +| variables.rs:195:5:198:5 | ExprStmt | variables.rs:195:11:195:12 | tv | | +| variables.rs:195:5:198:5 | MatchExpr | variables.rs:199:11:199:12 | tv | | +| variables.rs:195:11:195:12 | tv | variables.rs:196:9:196:83 | OrPat | | +| variables.rs:196:9:196:83 | OrPat | variables.rs:197:16:197:24 | PathExpr | match | +| variables.rs:197:16:197:24 | PathExpr | variables.rs:197:26:197:27 | a5 | | +| variables.rs:197:16:197:28 | CallExpr | variables.rs:195:5:198:5 | MatchExpr | | +| variables.rs:197:26:197:27 | a5 | variables.rs:197:16:197:28 | CallExpr | | +| variables.rs:199:5:202:5 | MatchExpr | variables.rs:189:21:203:1 | BlockExpr | | +| variables.rs:199:11:199:12 | tv | variables.rs:200:9:200:83 | OrPat | | +| variables.rs:200:9:200:83 | OrPat | variables.rs:201:16:201:24 | PathExpr | match | +| variables.rs:201:16:201:24 | PathExpr | variables.rs:201:26:201:27 | a6 | | +| variables.rs:201:16:201:28 | CallExpr | variables.rs:199:5:202:5 | MatchExpr | | +| variables.rs:201:26:201:27 | a6 | variables.rs:201:16:201:28 | CallExpr | | +| variables.rs:205:1:213:1 | enter match_pattern7 | variables.rs:206:5:206:34 | LetStmt | | +| variables.rs:205:1:213:1 | exit match_pattern7 (normal) | variables.rs:205:1:213:1 | exit match_pattern7 | | +| variables.rs:205:21:213:1 | BlockExpr | variables.rs:205:1:213:1 | exit match_pattern7 (normal) | | +| variables.rs:206:5:206:34 | LetStmt | variables.rs:206:18:206:29 | PathExpr | | +| variables.rs:206:9:206:14 | either | variables.rs:207:11:207:16 | either | match, no-match | +| variables.rs:206:18:206:29 | PathExpr | variables.rs:206:31:206:32 | 32 | | +| variables.rs:206:18:206:33 | CallExpr | variables.rs:206:9:206:14 | either | | +| variables.rs:206:31:206:32 | 32 | variables.rs:206:18:206:33 | CallExpr | | +| variables.rs:207:5:212:5 | MatchExpr | variables.rs:205:21:213:1 | BlockExpr | | +| variables.rs:207:11:207:16 | either | variables.rs:208:9:208:44 | OrPat | | +| variables.rs:208:9:208:44 | OrPat | variables.rs:209:16:209:17 | a7 | match | +| variables.rs:208:9:208:44 | OrPat | variables.rs:211:9:211:9 | WildcardPat | no-match | +| variables.rs:209:16:209:17 | a7 | variables.rs:209:21:209:21 | 0 | | +| variables.rs:209:16:209:21 | ... > ... | variables.rs:210:16:210:24 | PathExpr | true | +| variables.rs:209:16:209:21 | ... > ... | variables.rs:211:9:211:9 | WildcardPat | false | +| variables.rs:209:21:209:21 | 0 | variables.rs:209:16:209:21 | ... > ... | | +| variables.rs:210:16:210:24 | PathExpr | variables.rs:210:26:210:27 | a7 | | +| variables.rs:210:16:210:28 | CallExpr | variables.rs:207:5:212:5 | MatchExpr | | +| variables.rs:210:26:210:27 | a7 | variables.rs:210:16:210:28 | CallExpr | | +| variables.rs:211:9:211:9 | WildcardPat | variables.rs:211:14:211:15 | TupleExpr | match | +| variables.rs:211:14:211:15 | TupleExpr | variables.rs:207:5:212:5 | MatchExpr | | +| variables.rs:215:1:230:1 | enter match_pattern8 | variables.rs:216:5:216:34 | LetStmt | | +| variables.rs:215:1:230:1 | exit match_pattern8 (normal) | variables.rs:215:1:230:1 | exit match_pattern8 | | +| variables.rs:215:21:230:1 | BlockExpr | variables.rs:215:1:230:1 | exit match_pattern8 (normal) | | +| variables.rs:216:5:216:34 | LetStmt | variables.rs:216:18:216:29 | PathExpr | | +| variables.rs:216:9:216:14 | either | variables.rs:218:11:218:16 | either | match, no-match | +| variables.rs:216:18:216:29 | PathExpr | variables.rs:216:31:216:32 | 32 | | +| variables.rs:216:18:216:33 | CallExpr | variables.rs:216:9:216:14 | either | | +| variables.rs:216:31:216:32 | 32 | variables.rs:216:18:216:33 | CallExpr | | +| variables.rs:218:5:229:5 | MatchExpr | variables.rs:215:21:230:1 | BlockExpr | | +| variables.rs:218:11:218:16 | either | variables.rs:219:9:220:52 | e | | +| variables.rs:219:9:220:52 | e | variables.rs:222:13:222:27 | ExprStmt | match | +| variables.rs:219:9:220:52 | e | variables.rs:228:9:228:9 | WildcardPat | no-match | +| variables.rs:221:12:227:9 | BlockExpr | variables.rs:218:5:229:5 | MatchExpr | | +| variables.rs:222:13:222:21 | PathExpr | variables.rs:222:23:222:25 | a11 | | +| variables.rs:222:13:222:26 | CallExpr | variables.rs:223:16:224:15 | LetExpr | | +| variables.rs:222:13:222:27 | ExprStmt | variables.rs:222:13:222:21 | PathExpr | | +| variables.rs:222:23:222:25 | a11 | variables.rs:222:13:222:26 | CallExpr | | +| variables.rs:223:13:226:13 | IfExpr | variables.rs:221:12:227:9 | BlockExpr | | +| variables.rs:223:16:224:15 | LetExpr | variables.rs:223:20:223:36 | TupleStructPat | | +| variables.rs:223:20:223:36 | TupleStructPat | variables.rs:223:13:226:13 | IfExpr | no-match | +| variables.rs:223:20:223:36 | TupleStructPat | variables.rs:225:17:225:32 | ExprStmt | match | +| variables.rs:224:17:226:13 | BlockExpr | variables.rs:223:13:226:13 | IfExpr | | +| variables.rs:225:17:225:25 | PathExpr | variables.rs:225:28:225:30 | a12 | | +| variables.rs:225:17:225:31 | CallExpr | variables.rs:224:17:226:13 | BlockExpr | | +| variables.rs:225:17:225:32 | ExprStmt | variables.rs:225:17:225:25 | PathExpr | | +| variables.rs:225:27:225:30 | * ... | variables.rs:225:17:225:31 | CallExpr | | +| variables.rs:225:28:225:30 | a12 | variables.rs:225:27:225:30 | * ... | | +| variables.rs:228:9:228:9 | WildcardPat | variables.rs:228:14:228:15 | TupleExpr | match | +| variables.rs:228:14:228:15 | TupleExpr | variables.rs:218:5:229:5 | MatchExpr | | +| variables.rs:239:1:245:1 | enter match_pattern9 | variables.rs:240:5:240:36 | LetStmt | | +| variables.rs:239:1:245:1 | exit match_pattern9 (normal) | variables.rs:239:1:245:1 | exit match_pattern9 | | +| variables.rs:239:21:245:1 | BlockExpr | variables.rs:239:1:245:1 | exit match_pattern9 (normal) | | +| variables.rs:240:5:240:36 | LetStmt | variables.rs:240:14:240:31 | PathExpr | | +| variables.rs:240:9:240:10 | fv | variables.rs:241:11:241:12 | fv | match, no-match | +| variables.rs:240:14:240:31 | PathExpr | variables.rs:240:33:240:34 | 62 | | +| variables.rs:240:14:240:35 | CallExpr | variables.rs:240:9:240:10 | fv | | +| variables.rs:240:33:240:34 | 62 | variables.rs:240:14:240:35 | CallExpr | | +| variables.rs:241:5:244:5 | MatchExpr | variables.rs:239:21:245:1 | BlockExpr | | +| variables.rs:241:11:241:12 | fv | variables.rs:242:9:242:109 | OrPat | | +| variables.rs:242:9:242:109 | OrPat | variables.rs:243:16:243:24 | PathExpr | match | +| variables.rs:243:16:243:24 | PathExpr | variables.rs:243:26:243:28 | a13 | | +| variables.rs:243:16:243:29 | CallExpr | variables.rs:241:5:244:5 | MatchExpr | | +| variables.rs:243:26:243:28 | a13 | variables.rs:243:16:243:29 | CallExpr | | +| variables.rs:247:1:256:1 | enter param_pattern1 | variables.rs:253:5:253:18 | ExprStmt | | +| variables.rs:247:1:256:1 | exit param_pattern1 (normal) | variables.rs:247:1:256:1 | exit param_pattern1 | | +| variables.rs:252:28:256:1 | BlockExpr | variables.rs:247:1:256:1 | exit param_pattern1 (normal) | | +| variables.rs:253:5:253:13 | PathExpr | variables.rs:253:15:253:16 | a8 | | +| variables.rs:253:5:253:17 | CallExpr | variables.rs:254:5:254:18 | ExprStmt | | +| variables.rs:253:5:253:18 | ExprStmt | variables.rs:253:5:253:13 | PathExpr | | +| variables.rs:253:15:253:16 | a8 | variables.rs:253:5:253:17 | CallExpr | | +| variables.rs:254:5:254:13 | PathExpr | variables.rs:254:15:254:16 | b3 | | +| variables.rs:254:5:254:17 | CallExpr | variables.rs:255:5:255:18 | ExprStmt | | +| variables.rs:254:5:254:18 | ExprStmt | variables.rs:254:5:254:13 | PathExpr | | +| variables.rs:254:15:254:16 | b3 | variables.rs:254:5:254:17 | CallExpr | | +| variables.rs:255:5:255:13 | PathExpr | variables.rs:255:15:255:16 | c1 | | +| variables.rs:255:5:255:17 | CallExpr | variables.rs:252:28:256:1 | BlockExpr | | +| variables.rs:255:5:255:18 | ExprStmt | variables.rs:255:5:255:13 | PathExpr | | +| variables.rs:255:15:255:16 | c1 | variables.rs:255:5:255:17 | CallExpr | | +| variables.rs:258:1:262:1 | enter param_pattern2 | variables.rs:261:5:261:18 | ExprStmt | | +| variables.rs:258:1:262:1 | exit param_pattern2 (normal) | variables.rs:258:1:262:1 | exit param_pattern2 | | +| variables.rs:260:9:262:1 | BlockExpr | variables.rs:258:1:262:1 | exit param_pattern2 (normal) | | +| variables.rs:261:5:261:13 | PathExpr | variables.rs:261:15:261:16 | a9 | | +| variables.rs:261:5:261:17 | CallExpr | variables.rs:260:9:262:1 | BlockExpr | | +| variables.rs:261:5:261:18 | ExprStmt | variables.rs:261:5:261:13 | PathExpr | | +| variables.rs:261:15:261:16 | a9 | variables.rs:261:5:261:17 | CallExpr | | +| variables.rs:264:1:299:1 | enter destruct_assignment | variables.rs:265:5:269:18 | LetStmt | | +| variables.rs:264:1:299:1 | exit destruct_assignment (normal) | variables.rs:264:1:299:1 | exit destruct_assignment | | +| variables.rs:264:26:299:1 | BlockExpr | variables.rs:264:1:299:1 | exit destruct_assignment (normal) | | +| variables.rs:265:5:269:18 | LetStmt | variables.rs:269:10:269:10 | 1 | | +| variables.rs:265:9:269:5 | TuplePat | variables.rs:270:5:270:19 | ExprStmt | match | +| variables.rs:269:9:269:17 | TupleExpr | variables.rs:265:9:269:5 | TuplePat | | +| variables.rs:269:10:269:10 | 1 | variables.rs:269:13:269:13 | 2 | | +| variables.rs:269:13:269:13 | 2 | variables.rs:269:16:269:16 | 3 | | +| variables.rs:269:16:269:16 | 3 | variables.rs:269:9:269:17 | TupleExpr | | +| variables.rs:270:5:270:13 | PathExpr | variables.rs:270:15:270:17 | a10 | | +| variables.rs:270:5:270:18 | CallExpr | variables.rs:271:5:271:18 | ExprStmt | | +| variables.rs:270:5:270:19 | ExprStmt | variables.rs:270:5:270:13 | PathExpr | | +| variables.rs:270:15:270:17 | a10 | variables.rs:270:5:270:18 | CallExpr | | +| variables.rs:271:5:271:13 | PathExpr | variables.rs:271:15:271:16 | b4 | | +| variables.rs:271:5:271:17 | CallExpr | variables.rs:272:5:272:18 | ExprStmt | | +| variables.rs:271:5:271:18 | ExprStmt | variables.rs:271:5:271:13 | PathExpr | | +| variables.rs:271:15:271:16 | b4 | variables.rs:271:5:271:17 | CallExpr | | +| variables.rs:272:5:272:13 | PathExpr | variables.rs:272:15:272:16 | c2 | | +| variables.rs:272:5:272:17 | CallExpr | variables.rs:274:5:282:6 | ExprStmt | | +| variables.rs:272:5:272:18 | ExprStmt | variables.rs:272:5:272:13 | PathExpr | | +| variables.rs:272:15:272:16 | c2 | variables.rs:272:5:272:17 | CallExpr | | +| variables.rs:274:5:278:5 | TupleExpr | variables.rs:279:9:279:11 | a10 | | +| variables.rs:274:5:282:5 | ... = ... | variables.rs:283:5:283:19 | ExprStmt | | +| variables.rs:274:5:282:6 | ExprStmt | variables.rs:275:9:275:10 | c2 | | +| variables.rs:275:9:275:10 | c2 | variables.rs:276:9:276:10 | b4 | | +| variables.rs:276:9:276:10 | b4 | variables.rs:277:9:277:11 | a10 | | +| variables.rs:277:9:277:11 | a10 | variables.rs:274:5:278:5 | TupleExpr | | +| variables.rs:278:9:282:5 | TupleExpr | variables.rs:274:5:282:5 | ... = ... | | +| variables.rs:279:9:279:11 | a10 | variables.rs:280:9:280:10 | b4 | | +| variables.rs:280:9:280:10 | b4 | variables.rs:281:9:281:10 | c2 | | +| variables.rs:281:9:281:10 | c2 | variables.rs:278:9:282:5 | TupleExpr | | +| variables.rs:283:5:283:13 | PathExpr | variables.rs:283:15:283:17 | a10 | | +| variables.rs:283:5:283:18 | CallExpr | variables.rs:284:5:284:18 | ExprStmt | | +| variables.rs:283:5:283:19 | ExprStmt | variables.rs:283:5:283:13 | PathExpr | | +| variables.rs:283:15:283:17 | a10 | variables.rs:283:5:283:18 | CallExpr | | +| variables.rs:284:5:284:13 | PathExpr | variables.rs:284:15:284:16 | b4 | | +| variables.rs:284:5:284:17 | CallExpr | variables.rs:285:5:285:18 | ExprStmt | | +| variables.rs:284:5:284:18 | ExprStmt | variables.rs:284:5:284:13 | PathExpr | | +| variables.rs:284:15:284:16 | b4 | variables.rs:284:5:284:17 | CallExpr | | +| variables.rs:285:5:285:13 | PathExpr | variables.rs:285:15:285:16 | c2 | | +| variables.rs:285:5:285:17 | CallExpr | variables.rs:287:5:295:5 | ExprStmt | | +| variables.rs:285:5:285:18 | ExprStmt | variables.rs:285:5:285:13 | PathExpr | | +| variables.rs:285:15:285:16 | c2 | variables.rs:285:5:285:17 | CallExpr | | +| variables.rs:287:5:295:5 | ExprStmt | variables.rs:287:12:287:12 | 4 | | +| variables.rs:287:5:295:5 | MatchExpr | variables.rs:297:5:297:19 | ExprStmt | | +| variables.rs:287:11:287:16 | TupleExpr | variables.rs:288:9:291:9 | TuplePat | | +| variables.rs:287:12:287:12 | 4 | variables.rs:287:15:287:15 | 5 | | +| variables.rs:287:15:287:15 | 5 | variables.rs:287:11:287:16 | TupleExpr | | +| variables.rs:288:9:291:9 | TuplePat | variables.rs:292:13:292:27 | ExprStmt | match | +| variables.rs:291:14:294:9 | BlockExpr | variables.rs:287:5:295:5 | MatchExpr | | +| variables.rs:292:13:292:21 | PathExpr | variables.rs:292:23:292:25 | a10 | | +| variables.rs:292:13:292:26 | CallExpr | variables.rs:293:13:293:26 | ExprStmt | | +| variables.rs:292:13:292:27 | ExprStmt | variables.rs:292:13:292:21 | PathExpr | | +| variables.rs:292:23:292:25 | a10 | variables.rs:292:13:292:26 | CallExpr | | +| variables.rs:293:13:293:21 | PathExpr | variables.rs:293:23:293:24 | b4 | | +| variables.rs:293:13:293:25 | CallExpr | variables.rs:291:14:294:9 | BlockExpr | | +| variables.rs:293:13:293:26 | ExprStmt | variables.rs:293:13:293:21 | PathExpr | | +| variables.rs:293:23:293:24 | b4 | variables.rs:293:13:293:25 | CallExpr | | +| variables.rs:297:5:297:13 | PathExpr | variables.rs:297:15:297:17 | a10 | | +| variables.rs:297:5:297:18 | CallExpr | variables.rs:298:5:298:18 | ExprStmt | | +| variables.rs:297:5:297:19 | ExprStmt | variables.rs:297:5:297:13 | PathExpr | | +| variables.rs:297:15:297:17 | a10 | variables.rs:297:5:297:18 | CallExpr | | +| variables.rs:298:5:298:13 | PathExpr | variables.rs:298:15:298:16 | b4 | | +| variables.rs:298:5:298:17 | CallExpr | variables.rs:264:26:299:1 | BlockExpr | | | variables.rs:298:5:298:18 | ExprStmt | variables.rs:298:5:298:13 | PathExpr | | -| variables.rs:298:15:298:16 | n1 | variables.rs:298:5:298:17 | CallExpr | | -| variables.rs:300:5:300:22 | PathExpr | variables.rs:300:5:300:24 | CallExpr | | -| variables.rs:300:5:300:24 | CallExpr | variables.rs:301:5:303:10 | LetStmt | | -| variables.rs:300:5:300:25 | ExprStmt | variables.rs:300:5:300:22 | PathExpr | | -| variables.rs:301:5:303:10 | LetStmt | variables.rs:302:9:303:9 | ClosureExpr | | -| variables.rs:301:9:301:26 | immutable_variable | variables.rs:304:5:305:30 | LetStmt | match, no-match | -| variables.rs:302:9:303:9 | ClosureExpr | variables.rs:301:9:301:26 | immutable_variable | | -| variables.rs:302:9:303:9 | enter ClosureExpr | variables.rs:303:9:303:9 | x | | -| variables.rs:302:9:303:9 | exit ClosureExpr (normal) | variables.rs:302:9:303:9 | exit ClosureExpr | | -| variables.rs:303:9:303:9 | x | variables.rs:302:9:303:9 | exit ClosureExpr (normal) | | -| variables.rs:304:5:305:30 | LetStmt | variables.rs:305:9:305:26 | immutable_variable | | -| variables.rs:304:9:304:10 | n2 | variables.rs:306:5:306:18 | ExprStmt | match, no-match | -| variables.rs:305:9:305:26 | immutable_variable | variables.rs:305:28:305:28 | 6 | | -| variables.rs:305:9:305:29 | CallExpr | variables.rs:304:9:304:10 | n2 | | -| variables.rs:305:28:305:28 | 6 | variables.rs:305:9:305:29 | CallExpr | | -| variables.rs:306:5:306:13 | PathExpr | variables.rs:306:15:306:16 | n2 | | -| variables.rs:306:5:306:17 | CallExpr | variables.rs:292:23:307:1 | BlockExpr | | -| variables.rs:306:5:306:18 | ExprStmt | variables.rs:306:5:306:13 | PathExpr | | -| variables.rs:306:15:306:16 | n2 | variables.rs:306:5:306:17 | CallExpr | | -| variables.rs:309:1:316:1 | enter for_variable | variables.rs:310:5:310:42 | LetStmt | | -| variables.rs:309:1:316:1 | exit for_variable (normal) | variables.rs:309:1:316:1 | exit for_variable | | -| variables.rs:309:19:316:1 | BlockExpr | variables.rs:309:1:316:1 | exit for_variable (normal) | | -| variables.rs:310:5:310:42 | LetStmt | variables.rs:310:15:310:22 | "apples" | | -| variables.rs:310:9:310:9 | v | variables.rs:313:12:313:12 | v | match, no-match | -| variables.rs:310:13:310:41 | RefExpr | variables.rs:310:9:310:9 | v | | -| variables.rs:310:14:310:41 | ArrayExpr | variables.rs:310:13:310:41 | RefExpr | | -| variables.rs:310:15:310:22 | "apples" | variables.rs:310:25:310:30 | "cake" | | -| variables.rs:310:25:310:30 | "cake" | variables.rs:310:33:310:40 | "coffee" | | -| variables.rs:310:33:310:40 | "coffee" | variables.rs:310:14:310:41 | ArrayExpr | | -| variables.rs:312:5:315:5 | ForExpr | variables.rs:309:19:316:1 | BlockExpr | | -| variables.rs:312:9:312:12 | text | variables.rs:312:5:315:5 | ForExpr | no-match | -| variables.rs:312:9:312:12 | text | variables.rs:314:9:314:24 | ExprStmt | match | -| variables.rs:313:12:313:12 | v | variables.rs:312:9:312:12 | text | | -| variables.rs:313:14:315:5 | BlockExpr | variables.rs:312:9:312:12 | text | | -| variables.rs:314:9:314:17 | PathExpr | variables.rs:314:19:314:22 | text | | -| variables.rs:314:9:314:23 | CallExpr | variables.rs:313:14:315:5 | BlockExpr | | -| variables.rs:314:9:314:24 | ExprStmt | variables.rs:314:9:314:17 | PathExpr | | -| variables.rs:314:19:314:22 | text | variables.rs:314:9:314:23 | CallExpr | | -| variables.rs:318:1:341:1 | enter main | variables.rs:319:5:319:25 | ExprStmt | | -| variables.rs:318:1:341:1 | exit main (normal) | variables.rs:318:1:341:1 | exit main | | -| variables.rs:318:11:341:1 | BlockExpr | variables.rs:318:1:341:1 | exit main (normal) | | -| variables.rs:319:5:319:22 | PathExpr | variables.rs:319:5:319:24 | CallExpr | | -| variables.rs:319:5:319:24 | CallExpr | variables.rs:320:5:320:23 | ExprStmt | | -| variables.rs:319:5:319:25 | ExprStmt | variables.rs:319:5:319:22 | PathExpr | | -| variables.rs:320:5:320:20 | PathExpr | variables.rs:320:5:320:22 | CallExpr | | -| variables.rs:320:5:320:22 | CallExpr | variables.rs:321:5:321:23 | ExprStmt | | -| variables.rs:320:5:320:23 | ExprStmt | variables.rs:320:5:320:20 | PathExpr | | -| variables.rs:321:5:321:20 | PathExpr | variables.rs:321:5:321:22 | CallExpr | | -| variables.rs:321:5:321:22 | CallExpr | variables.rs:322:5:322:23 | ExprStmt | | -| variables.rs:321:5:321:23 | ExprStmt | variables.rs:321:5:321:20 | PathExpr | | -| variables.rs:322:5:322:20 | PathExpr | variables.rs:322:5:322:22 | CallExpr | | -| variables.rs:322:5:322:22 | CallExpr | variables.rs:323:5:323:19 | ExprStmt | | -| variables.rs:322:5:322:23 | ExprStmt | variables.rs:322:5:322:20 | PathExpr | | -| variables.rs:323:5:323:16 | PathExpr | variables.rs:323:5:323:18 | CallExpr | | -| variables.rs:323:5:323:18 | CallExpr | variables.rs:324:5:324:19 | ExprStmt | | -| variables.rs:323:5:323:19 | ExprStmt | variables.rs:323:5:323:16 | PathExpr | | -| variables.rs:324:5:324:16 | PathExpr | variables.rs:324:5:324:18 | CallExpr | | -| variables.rs:324:5:324:18 | CallExpr | variables.rs:325:5:325:19 | ExprStmt | | -| variables.rs:324:5:324:19 | ExprStmt | variables.rs:324:5:324:16 | PathExpr | | -| variables.rs:325:5:325:16 | PathExpr | variables.rs:325:5:325:18 | CallExpr | | -| variables.rs:325:5:325:18 | CallExpr | variables.rs:326:5:326:19 | ExprStmt | | -| variables.rs:325:5:325:19 | ExprStmt | variables.rs:325:5:325:16 | PathExpr | | -| variables.rs:326:5:326:16 | PathExpr | variables.rs:326:5:326:18 | CallExpr | | -| variables.rs:326:5:326:18 | CallExpr | variables.rs:327:5:327:21 | ExprStmt | | -| variables.rs:326:5:326:19 | ExprStmt | variables.rs:326:5:326:16 | PathExpr | | -| variables.rs:327:5:327:18 | PathExpr | variables.rs:327:5:327:20 | CallExpr | | -| variables.rs:327:5:327:20 | CallExpr | variables.rs:328:5:328:21 | ExprStmt | | -| variables.rs:327:5:327:21 | ExprStmt | variables.rs:327:5:327:18 | PathExpr | | -| variables.rs:328:5:328:18 | PathExpr | variables.rs:328:5:328:20 | CallExpr | | -| variables.rs:328:5:328:20 | CallExpr | variables.rs:329:5:329:21 | ExprStmt | | -| variables.rs:328:5:328:21 | ExprStmt | variables.rs:328:5:328:18 | PathExpr | | -| variables.rs:329:5:329:18 | PathExpr | variables.rs:329:5:329:20 | CallExpr | | -| variables.rs:329:5:329:20 | CallExpr | variables.rs:330:5:330:21 | ExprStmt | | -| variables.rs:329:5:329:21 | ExprStmt | variables.rs:329:5:329:18 | PathExpr | | -| variables.rs:330:5:330:18 | PathExpr | variables.rs:330:5:330:20 | CallExpr | | -| variables.rs:330:5:330:20 | CallExpr | variables.rs:331:5:331:21 | ExprStmt | | -| variables.rs:330:5:330:21 | ExprStmt | variables.rs:330:5:330:18 | PathExpr | | -| variables.rs:331:5:331:18 | PathExpr | variables.rs:331:5:331:20 | CallExpr | | -| variables.rs:331:5:331:20 | CallExpr | variables.rs:332:5:332:21 | ExprStmt | | -| variables.rs:331:5:331:21 | ExprStmt | variables.rs:331:5:331:18 | PathExpr | | -| variables.rs:332:5:332:18 | PathExpr | variables.rs:332:5:332:20 | CallExpr | | -| variables.rs:332:5:332:20 | CallExpr | variables.rs:333:5:333:21 | ExprStmt | | -| variables.rs:332:5:332:21 | ExprStmt | variables.rs:332:5:332:18 | PathExpr | | -| variables.rs:333:5:333:18 | PathExpr | variables.rs:333:5:333:20 | CallExpr | | -| variables.rs:333:5:333:20 | CallExpr | variables.rs:334:5:334:21 | ExprStmt | | -| variables.rs:333:5:333:21 | ExprStmt | variables.rs:333:5:333:18 | PathExpr | | -| variables.rs:334:5:334:18 | PathExpr | variables.rs:334:5:334:20 | CallExpr | | -| variables.rs:334:5:334:20 | CallExpr | variables.rs:335:5:335:21 | ExprStmt | | -| variables.rs:334:5:334:21 | ExprStmt | variables.rs:334:5:334:18 | PathExpr | | -| variables.rs:335:5:335:18 | PathExpr | variables.rs:335:5:335:20 | CallExpr | | -| variables.rs:335:5:335:20 | CallExpr | variables.rs:336:5:336:36 | ExprStmt | | -| variables.rs:335:5:335:21 | ExprStmt | variables.rs:335:5:335:18 | PathExpr | | -| variables.rs:336:5:336:18 | PathExpr | variables.rs:336:20:336:22 | "a" | | -| variables.rs:336:5:336:35 | CallExpr | variables.rs:337:5:337:37 | ExprStmt | | -| variables.rs:336:5:336:36 | ExprStmt | variables.rs:336:5:336:18 | PathExpr | | -| variables.rs:336:20:336:22 | "a" | variables.rs:336:26:336:28 | "b" | | -| variables.rs:336:25:336:34 | TupleExpr | variables.rs:336:5:336:35 | CallExpr | | -| variables.rs:336:26:336:28 | "b" | variables.rs:336:31:336:33 | "c" | | -| variables.rs:336:31:336:33 | "c" | variables.rs:336:25:336:34 | TupleExpr | | -| variables.rs:337:5:337:18 | PathExpr | variables.rs:337:20:337:31 | PathExpr | | -| variables.rs:337:5:337:36 | CallExpr | variables.rs:338:5:338:26 | ExprStmt | | -| variables.rs:337:5:337:37 | ExprStmt | variables.rs:337:5:337:18 | PathExpr | | -| variables.rs:337:20:337:31 | PathExpr | variables.rs:337:33:337:34 | 45 | | -| variables.rs:337:20:337:35 | CallExpr | variables.rs:337:5:337:36 | CallExpr | | -| variables.rs:337:33:337:34 | 45 | variables.rs:337:20:337:35 | CallExpr | | -| variables.rs:338:5:338:23 | PathExpr | variables.rs:338:5:338:25 | CallExpr | | -| variables.rs:338:5:338:25 | CallExpr | variables.rs:339:5:339:23 | ExprStmt | | -| variables.rs:338:5:338:26 | ExprStmt | variables.rs:338:5:338:23 | PathExpr | | -| variables.rs:339:5:339:20 | PathExpr | variables.rs:339:5:339:22 | CallExpr | | -| variables.rs:339:5:339:22 | CallExpr | variables.rs:340:5:340:19 | ExprStmt | | -| variables.rs:339:5:339:23 | ExprStmt | variables.rs:339:5:339:20 | PathExpr | | -| variables.rs:340:5:340:16 | PathExpr | variables.rs:340:5:340:18 | CallExpr | | -| variables.rs:340:5:340:18 | CallExpr | variables.rs:318:11:341:1 | BlockExpr | | -| variables.rs:340:5:340:19 | ExprStmt | variables.rs:340:5:340:16 | PathExpr | | +| variables.rs:298:15:298:16 | b4 | variables.rs:298:5:298:17 | CallExpr | | +| variables.rs:301:1:316:1 | enter closure_variable | variables.rs:302:5:304:10 | LetStmt | | +| variables.rs:301:1:316:1 | exit closure_variable (normal) | variables.rs:301:1:316:1 | exit closure_variable | | +| variables.rs:301:23:316:1 | BlockExpr | variables.rs:301:1:316:1 | exit closure_variable (normal) | | +| variables.rs:302:5:304:10 | LetStmt | variables.rs:303:9:304:9 | ClosureExpr | | +| variables.rs:302:9:302:23 | example_closure | variables.rs:305:5:306:27 | LetStmt | match, no-match | +| variables.rs:303:9:304:9 | ClosureExpr | variables.rs:302:9:302:23 | example_closure | | +| variables.rs:303:9:304:9 | enter ClosureExpr | variables.rs:304:9:304:9 | x | | +| variables.rs:303:9:304:9 | exit ClosureExpr (normal) | variables.rs:303:9:304:9 | exit ClosureExpr | | +| variables.rs:304:9:304:9 | x | variables.rs:303:9:304:9 | exit ClosureExpr (normal) | | +| variables.rs:305:5:306:27 | LetStmt | variables.rs:306:9:306:23 | example_closure | | +| variables.rs:305:9:305:10 | n1 | variables.rs:307:5:307:18 | ExprStmt | match, no-match | +| variables.rs:306:9:306:23 | example_closure | variables.rs:306:25:306:25 | 5 | | +| variables.rs:306:9:306:26 | CallExpr | variables.rs:305:9:305:10 | n1 | | +| variables.rs:306:25:306:25 | 5 | variables.rs:306:9:306:26 | CallExpr | | +| variables.rs:307:5:307:13 | PathExpr | variables.rs:307:15:307:16 | n1 | | +| variables.rs:307:5:307:17 | CallExpr | variables.rs:309:5:309:25 | ExprStmt | | +| variables.rs:307:5:307:18 | ExprStmt | variables.rs:307:5:307:13 | PathExpr | | +| variables.rs:307:15:307:16 | n1 | variables.rs:307:5:307:17 | CallExpr | | +| variables.rs:309:5:309:22 | PathExpr | variables.rs:309:5:309:24 | CallExpr | | +| variables.rs:309:5:309:24 | CallExpr | variables.rs:310:5:312:10 | LetStmt | | +| variables.rs:309:5:309:25 | ExprStmt | variables.rs:309:5:309:22 | PathExpr | | +| variables.rs:310:5:312:10 | LetStmt | variables.rs:311:9:312:9 | ClosureExpr | | +| variables.rs:310:9:310:26 | immutable_variable | variables.rs:313:5:314:30 | LetStmt | match, no-match | +| variables.rs:311:9:312:9 | ClosureExpr | variables.rs:310:9:310:26 | immutable_variable | | +| variables.rs:311:9:312:9 | enter ClosureExpr | variables.rs:312:9:312:9 | x | | +| variables.rs:311:9:312:9 | exit ClosureExpr (normal) | variables.rs:311:9:312:9 | exit ClosureExpr | | +| variables.rs:312:9:312:9 | x | variables.rs:311:9:312:9 | exit ClosureExpr (normal) | | +| variables.rs:313:5:314:30 | LetStmt | variables.rs:314:9:314:26 | immutable_variable | | +| variables.rs:313:9:313:10 | n2 | variables.rs:315:5:315:18 | ExprStmt | match, no-match | +| variables.rs:314:9:314:26 | immutable_variable | variables.rs:314:28:314:28 | 6 | | +| variables.rs:314:9:314:29 | CallExpr | variables.rs:313:9:313:10 | n2 | | +| variables.rs:314:28:314:28 | 6 | variables.rs:314:9:314:29 | CallExpr | | +| variables.rs:315:5:315:13 | PathExpr | variables.rs:315:15:315:16 | n2 | | +| variables.rs:315:5:315:17 | CallExpr | variables.rs:301:23:316:1 | BlockExpr | | +| variables.rs:315:5:315:18 | ExprStmt | variables.rs:315:5:315:13 | PathExpr | | +| variables.rs:315:15:315:16 | n2 | variables.rs:315:5:315:17 | CallExpr | | +| variables.rs:318:1:325:1 | enter for_variable | variables.rs:319:5:319:42 | LetStmt | | +| variables.rs:318:1:325:1 | exit for_variable (normal) | variables.rs:318:1:325:1 | exit for_variable | | +| variables.rs:318:19:325:1 | BlockExpr | variables.rs:318:1:325:1 | exit for_variable (normal) | | +| variables.rs:319:5:319:42 | LetStmt | variables.rs:319:15:319:22 | "apples" | | +| variables.rs:319:9:319:9 | v | variables.rs:322:12:322:12 | v | match, no-match | +| variables.rs:319:13:319:41 | RefExpr | variables.rs:319:9:319:9 | v | | +| variables.rs:319:14:319:41 | ArrayExpr | variables.rs:319:13:319:41 | RefExpr | | +| variables.rs:319:15:319:22 | "apples" | variables.rs:319:25:319:30 | "cake" | | +| variables.rs:319:25:319:30 | "cake" | variables.rs:319:33:319:40 | "coffee" | | +| variables.rs:319:33:319:40 | "coffee" | variables.rs:319:14:319:41 | ArrayExpr | | +| variables.rs:321:5:324:5 | ForExpr | variables.rs:318:19:325:1 | BlockExpr | | +| variables.rs:321:9:321:12 | text | variables.rs:321:5:324:5 | ForExpr | no-match | +| variables.rs:321:9:321:12 | text | variables.rs:323:9:323:24 | ExprStmt | match | +| variables.rs:322:12:322:12 | v | variables.rs:321:9:321:12 | text | | +| variables.rs:322:14:324:5 | BlockExpr | variables.rs:321:9:321:12 | text | | +| variables.rs:323:9:323:17 | PathExpr | variables.rs:323:19:323:22 | text | | +| variables.rs:323:9:323:23 | CallExpr | variables.rs:322:14:324:5 | BlockExpr | | +| variables.rs:323:9:323:24 | ExprStmt | variables.rs:323:9:323:17 | PathExpr | | +| variables.rs:323:19:323:22 | text | variables.rs:323:9:323:23 | CallExpr | | +| variables.rs:327:1:350:1 | enter main | variables.rs:328:5:328:25 | ExprStmt | | +| variables.rs:327:1:350:1 | exit main (normal) | variables.rs:327:1:350:1 | exit main | | +| variables.rs:327:11:350:1 | BlockExpr | variables.rs:327:1:350:1 | exit main (normal) | | +| variables.rs:328:5:328:22 | PathExpr | variables.rs:328:5:328:24 | CallExpr | | +| variables.rs:328:5:328:24 | CallExpr | variables.rs:329:5:329:23 | ExprStmt | | +| variables.rs:328:5:328:25 | ExprStmt | variables.rs:328:5:328:22 | PathExpr | | +| variables.rs:329:5:329:20 | PathExpr | variables.rs:329:5:329:22 | CallExpr | | +| variables.rs:329:5:329:22 | CallExpr | variables.rs:330:5:330:23 | ExprStmt | | +| variables.rs:329:5:329:23 | ExprStmt | variables.rs:329:5:329:20 | PathExpr | | +| variables.rs:330:5:330:20 | PathExpr | variables.rs:330:5:330:22 | CallExpr | | +| variables.rs:330:5:330:22 | CallExpr | variables.rs:331:5:331:23 | ExprStmt | | +| variables.rs:330:5:330:23 | ExprStmt | variables.rs:330:5:330:20 | PathExpr | | +| variables.rs:331:5:331:20 | PathExpr | variables.rs:331:5:331:22 | CallExpr | | +| variables.rs:331:5:331:22 | CallExpr | variables.rs:332:5:332:19 | ExprStmt | | +| variables.rs:331:5:331:23 | ExprStmt | variables.rs:331:5:331:20 | PathExpr | | +| variables.rs:332:5:332:16 | PathExpr | variables.rs:332:5:332:18 | CallExpr | | +| variables.rs:332:5:332:18 | CallExpr | variables.rs:333:5:333:19 | ExprStmt | | +| variables.rs:332:5:332:19 | ExprStmt | variables.rs:332:5:332:16 | PathExpr | | +| variables.rs:333:5:333:16 | PathExpr | variables.rs:333:5:333:18 | CallExpr | | +| variables.rs:333:5:333:18 | CallExpr | variables.rs:334:5:334:19 | ExprStmt | | +| variables.rs:333:5:333:19 | ExprStmt | variables.rs:333:5:333:16 | PathExpr | | +| variables.rs:334:5:334:16 | PathExpr | variables.rs:334:5:334:18 | CallExpr | | +| variables.rs:334:5:334:18 | CallExpr | variables.rs:335:5:335:19 | ExprStmt | | +| variables.rs:334:5:334:19 | ExprStmt | variables.rs:334:5:334:16 | PathExpr | | +| variables.rs:335:5:335:16 | PathExpr | variables.rs:335:5:335:18 | CallExpr | | +| variables.rs:335:5:335:18 | CallExpr | variables.rs:336:5:336:21 | ExprStmt | | +| variables.rs:335:5:335:19 | ExprStmt | variables.rs:335:5:335:16 | PathExpr | | +| variables.rs:336:5:336:18 | PathExpr | variables.rs:336:5:336:20 | CallExpr | | +| variables.rs:336:5:336:20 | CallExpr | variables.rs:337:5:337:21 | ExprStmt | | +| variables.rs:336:5:336:21 | ExprStmt | variables.rs:336:5:336:18 | PathExpr | | +| variables.rs:337:5:337:18 | PathExpr | variables.rs:337:5:337:20 | CallExpr | | +| variables.rs:337:5:337:20 | CallExpr | variables.rs:338:5:338:21 | ExprStmt | | +| variables.rs:337:5:337:21 | ExprStmt | variables.rs:337:5:337:18 | PathExpr | | +| variables.rs:338:5:338:18 | PathExpr | variables.rs:338:5:338:20 | CallExpr | | +| variables.rs:338:5:338:20 | CallExpr | variables.rs:339:5:339:21 | ExprStmt | | +| variables.rs:338:5:338:21 | ExprStmt | variables.rs:338:5:338:18 | PathExpr | | +| variables.rs:339:5:339:18 | PathExpr | variables.rs:339:5:339:20 | CallExpr | | +| variables.rs:339:5:339:20 | CallExpr | variables.rs:340:5:340:21 | ExprStmt | | +| variables.rs:339:5:339:21 | ExprStmt | variables.rs:339:5:339:18 | PathExpr | | +| variables.rs:340:5:340:18 | PathExpr | variables.rs:340:5:340:20 | CallExpr | | +| variables.rs:340:5:340:20 | CallExpr | variables.rs:341:5:341:21 | ExprStmt | | +| variables.rs:340:5:340:21 | ExprStmt | variables.rs:340:5:340:18 | PathExpr | | +| variables.rs:341:5:341:18 | PathExpr | variables.rs:341:5:341:20 | CallExpr | | +| variables.rs:341:5:341:20 | CallExpr | variables.rs:342:5:342:21 | ExprStmt | | +| variables.rs:341:5:341:21 | ExprStmt | variables.rs:341:5:341:18 | PathExpr | | +| variables.rs:342:5:342:18 | PathExpr | variables.rs:342:5:342:20 | CallExpr | | +| variables.rs:342:5:342:20 | CallExpr | variables.rs:343:5:343:21 | ExprStmt | | +| variables.rs:342:5:342:21 | ExprStmt | variables.rs:342:5:342:18 | PathExpr | | +| variables.rs:343:5:343:18 | PathExpr | variables.rs:343:5:343:20 | CallExpr | | +| variables.rs:343:5:343:20 | CallExpr | variables.rs:344:5:344:21 | ExprStmt | | +| variables.rs:343:5:343:21 | ExprStmt | variables.rs:343:5:343:18 | PathExpr | | +| variables.rs:344:5:344:18 | PathExpr | variables.rs:344:5:344:20 | CallExpr | | +| variables.rs:344:5:344:20 | CallExpr | variables.rs:345:5:345:36 | ExprStmt | | +| variables.rs:344:5:344:21 | ExprStmt | variables.rs:344:5:344:18 | PathExpr | | +| variables.rs:345:5:345:18 | PathExpr | variables.rs:345:20:345:22 | "a" | | +| variables.rs:345:5:345:35 | CallExpr | variables.rs:346:5:346:37 | ExprStmt | | +| variables.rs:345:5:345:36 | ExprStmt | variables.rs:345:5:345:18 | PathExpr | | +| variables.rs:345:20:345:22 | "a" | variables.rs:345:26:345:28 | "b" | | +| variables.rs:345:25:345:34 | TupleExpr | variables.rs:345:5:345:35 | CallExpr | | +| variables.rs:345:26:345:28 | "b" | variables.rs:345:31:345:33 | "c" | | +| variables.rs:345:31:345:33 | "c" | variables.rs:345:25:345:34 | TupleExpr | | +| variables.rs:346:5:346:18 | PathExpr | variables.rs:346:20:346:31 | PathExpr | | +| variables.rs:346:5:346:36 | CallExpr | variables.rs:347:5:347:26 | ExprStmt | | +| variables.rs:346:5:346:37 | ExprStmt | variables.rs:346:5:346:18 | PathExpr | | +| variables.rs:346:20:346:31 | PathExpr | variables.rs:346:33:346:34 | 45 | | +| variables.rs:346:20:346:35 | CallExpr | variables.rs:346:5:346:36 | CallExpr | | +| variables.rs:346:33:346:34 | 45 | variables.rs:346:20:346:35 | CallExpr | | +| variables.rs:347:5:347:23 | PathExpr | variables.rs:347:5:347:25 | CallExpr | | +| variables.rs:347:5:347:25 | CallExpr | variables.rs:348:5:348:23 | ExprStmt | | +| variables.rs:347:5:347:26 | ExprStmt | variables.rs:347:5:347:23 | PathExpr | | +| variables.rs:348:5:348:20 | PathExpr | variables.rs:348:5:348:22 | CallExpr | | +| variables.rs:348:5:348:22 | CallExpr | variables.rs:349:5:349:19 | ExprStmt | | +| variables.rs:348:5:348:23 | ExprStmt | variables.rs:348:5:348:20 | PathExpr | | +| variables.rs:349:5:349:16 | PathExpr | variables.rs:349:5:349:18 | CallExpr | | +| variables.rs:349:5:349:18 | CallExpr | variables.rs:327:11:350:1 | BlockExpr | | +| variables.rs:349:5:349:19 | ExprStmt | variables.rs:349:5:349:16 | PathExpr | | breakTarget continueTarget diff --git a/rust/ql/test/library-tests/variables/variables.expected b/rust/ql/test/library-tests/variables/variables.expected index c86e30d4bb57..ad85ccfbfcc8 100644 --- a/rust/ql/test/library-tests/variables/variables.expected +++ b/rust/ql/test/library-tests/variables/variables.expected @@ -19,52 +19,54 @@ variable | variables.rs:72:9:72:10 | s1 | | variables.rs:74:21:74:22 | s2 | | variables.rs:81:14:81:15 | x5 | -| variables.rs:89:9:89:10 | x6 | -| variables.rs:90:9:90:10 | y1 | -| variables.rs:94:14:94:15 | y1 | -| variables.rs:99:9:99:12 | None | -| variables.rs:106:9:106:15 | numbers | -| variables.rs:110:13:110:17 | first | -| variables.rs:111:13:111:17 | third | -| variables.rs:112:13:112:17 | fifth | -| variables.rs:122:13:122:17 | first | -| variables.rs:124:13:124:16 | last | -| variables.rs:133:9:133:10 | p2 | -| variables.rs:137:16:137:17 | x7 | -| variables.rs:147:9:147:11 | msg | -| variables.rs:151:17:151:27 | id_variable | -| variables.rs:156:26:156:27 | id | -| variables.rs:167:9:167:14 | either | -| variables.rs:169:9:169:44 | a3 | -| variables.rs:181:9:181:10 | tv | -| variables.rs:183:9:183:81 | a4 | -| variables.rs:187:9:187:83 | a5 | -| variables.rs:191:9:191:83 | a6 | -| variables.rs:197:9:197:14 | either | -| variables.rs:199:9:199:44 | a7 | -| variables.rs:207:9:207:14 | either | -| variables.rs:210:13:210:13 | e | -| variables.rs:211:14:211:51 | a11 | -| variables.rs:214:33:214:35 | a12 | -| variables.rs:231:9:231:10 | fv | -| variables.rs:233:9:233:109 | a13 | -| variables.rs:239:5:239:6 | a8 | -| variables.rs:241:9:241:10 | b3 | -| variables.rs:242:9:242:10 | c1 | -| variables.rs:250:6:250:41 | a9 | -| variables.rs:257:13:257:15 | a10 | -| variables.rs:258:13:258:14 | b4 | -| variables.rs:259:13:259:14 | c2 | -| variables.rs:280:13:280:15 | a10 | -| variables.rs:281:13:281:14 | b4 | -| variables.rs:293:9:293:23 | example_closure | -| variables.rs:294:10:294:10 | x | -| variables.rs:296:9:296:10 | n1 | -| variables.rs:301:9:301:26 | immutable_variable | -| variables.rs:302:10:302:10 | x | -| variables.rs:304:9:304:10 | n2 | -| variables.rs:310:9:310:9 | v | -| variables.rs:312:9:312:12 | text | +| variables.rs:89:9:89:10 | s1 | +| variables.rs:91:24:91:25 | s2 | +| variables.rs:98:9:98:10 | x6 | +| variables.rs:99:9:99:10 | y1 | +| variables.rs:103:14:103:15 | y1 | +| variables.rs:108:9:108:12 | None | +| variables.rs:115:9:115:15 | numbers | +| variables.rs:119:13:119:17 | first | +| variables.rs:120:13:120:17 | third | +| variables.rs:121:13:121:17 | fifth | +| variables.rs:131:13:131:17 | first | +| variables.rs:133:13:133:16 | last | +| variables.rs:142:9:142:10 | p2 | +| variables.rs:146:16:146:17 | x7 | +| variables.rs:156:9:156:11 | msg | +| variables.rs:160:17:160:27 | id_variable | +| variables.rs:165:26:165:27 | id | +| variables.rs:176:9:176:14 | either | +| variables.rs:178:9:178:44 | a3 | +| variables.rs:190:9:190:10 | tv | +| variables.rs:192:9:192:81 | a4 | +| variables.rs:196:9:196:83 | a5 | +| variables.rs:200:9:200:83 | a6 | +| variables.rs:206:9:206:14 | either | +| variables.rs:208:9:208:44 | a7 | +| variables.rs:216:9:216:14 | either | +| variables.rs:219:13:219:13 | e | +| variables.rs:220:14:220:51 | a11 | +| variables.rs:223:33:223:35 | a12 | +| variables.rs:240:9:240:10 | fv | +| variables.rs:242:9:242:109 | a13 | +| variables.rs:248:5:248:6 | a8 | +| variables.rs:250:9:250:10 | b3 | +| variables.rs:251:9:251:10 | c1 | +| variables.rs:259:6:259:41 | a9 | +| variables.rs:266:13:266:15 | a10 | +| variables.rs:267:13:267:14 | b4 | +| variables.rs:268:13:268:14 | c2 | +| variables.rs:289:13:289:15 | a10 | +| variables.rs:290:13:290:14 | b4 | +| variables.rs:302:9:302:23 | example_closure | +| variables.rs:303:10:303:10 | x | +| variables.rs:305:9:305:10 | n1 | +| variables.rs:310:9:310:26 | immutable_variable | +| variables.rs:311:10:311:10 | x | +| variables.rs:313:9:313:10 | n2 | +| variables.rs:319:9:319:9 | v | +| variables.rs:321:9:321:12 | text | variableAccess | variables.rs:11:15:11:16 | x1 | variables.rs:10:9:10:10 | x1 | | variables.rs:16:15:16:16 | x2 | variables.rs:15:13:15:14 | x2 | @@ -86,71 +88,73 @@ variableAccess | variables.rs:75:11:75:12 | s1 | variables.rs:72:9:72:10 | s1 | | variables.rs:76:19:76:20 | s2 | variables.rs:74:21:74:22 | s2 | | variables.rs:85:15:85:16 | x5 | variables.rs:81:14:81:15 | x5 | -| variables.rs:92:11:92:12 | x6 | variables.rs:89:9:89:10 | x6 | -| variables.rs:97:23:97:24 | y1 | variables.rs:94:14:94:15 | y1 | -| variables.rs:102:15:102:16 | y1 | variables.rs:90:9:90:10 | y1 | -| variables.rs:108:11:108:17 | numbers | variables.rs:106:9:106:15 | numbers | -| variables.rs:114:23:114:27 | first | variables.rs:110:13:110:17 | first | -| variables.rs:115:23:115:27 | third | variables.rs:111:13:111:17 | third | -| variables.rs:116:23:116:27 | fifth | variables.rs:112:13:112:17 | fifth | -| variables.rs:120:11:120:17 | numbers | variables.rs:106:9:106:15 | numbers | -| variables.rs:126:23:126:27 | first | variables.rs:122:13:122:17 | first | -| variables.rs:127:23:127:26 | last | variables.rs:124:13:124:16 | last | -| variables.rs:135:11:135:12 | p2 | variables.rs:133:9:133:10 | p2 | -| variables.rs:138:24:138:25 | x7 | variables.rs:137:16:137:17 | x7 | -| variables.rs:149:11:149:13 | msg | variables.rs:147:9:147:11 | msg | -| variables.rs:152:24:152:34 | id_variable | variables.rs:151:17:151:27 | id_variable | -| variables.rs:157:23:157:24 | id | variables.rs:156:26:156:27 | id | -| variables.rs:168:11:168:16 | either | variables.rs:167:9:167:14 | either | -| variables.rs:170:26:170:27 | a3 | variables.rs:169:9:169:44 | a3 | -| variables.rs:182:11:182:12 | tv | variables.rs:181:9:181:10 | tv | -| variables.rs:184:26:184:27 | a4 | variables.rs:183:9:183:81 | a4 | -| variables.rs:186:11:186:12 | tv | variables.rs:181:9:181:10 | tv | -| variables.rs:188:26:188:27 | a5 | variables.rs:187:9:187:83 | a5 | -| variables.rs:190:11:190:12 | tv | variables.rs:181:9:181:10 | tv | -| variables.rs:192:26:192:27 | a6 | variables.rs:191:9:191:83 | a6 | -| variables.rs:198:11:198:16 | either | variables.rs:197:9:197:14 | either | -| variables.rs:200:16:200:17 | a7 | variables.rs:199:9:199:44 | a7 | -| variables.rs:201:26:201:27 | a7 | variables.rs:199:9:199:44 | a7 | -| variables.rs:209:11:209:16 | either | variables.rs:207:9:207:14 | either | -| variables.rs:213:23:213:25 | a11 | variables.rs:211:14:211:51 | a11 | -| variables.rs:215:15:215:15 | e | variables.rs:210:13:210:13 | e | -| variables.rs:216:28:216:30 | a12 | variables.rs:214:33:214:35 | a12 | -| variables.rs:232:11:232:12 | fv | variables.rs:231:9:231:10 | fv | -| variables.rs:234:26:234:28 | a13 | variables.rs:233:9:233:109 | a13 | -| variables.rs:244:15:244:16 | a8 | variables.rs:239:5:239:6 | a8 | -| variables.rs:245:15:245:16 | b3 | variables.rs:241:9:241:10 | b3 | -| variables.rs:246:15:246:16 | c1 | variables.rs:242:9:242:10 | c1 | -| variables.rs:252:15:252:16 | a9 | variables.rs:250:6:250:41 | a9 | -| variables.rs:261:15:261:17 | a10 | variables.rs:257:13:257:15 | a10 | -| variables.rs:262:15:262:16 | b4 | variables.rs:258:13:258:14 | b4 | -| variables.rs:263:15:263:16 | c2 | variables.rs:259:13:259:14 | c2 | -| variables.rs:266:9:266:10 | c2 | variables.rs:259:13:259:14 | c2 | -| variables.rs:267:9:267:10 | b4 | variables.rs:258:13:258:14 | b4 | -| variables.rs:268:9:268:11 | a10 | variables.rs:257:13:257:15 | a10 | -| variables.rs:270:9:270:11 | a10 | variables.rs:257:13:257:15 | a10 | -| variables.rs:271:9:271:10 | b4 | variables.rs:258:13:258:14 | b4 | -| variables.rs:272:9:272:10 | c2 | variables.rs:259:13:259:14 | c2 | -| variables.rs:274:15:274:17 | a10 | variables.rs:257:13:257:15 | a10 | -| variables.rs:275:15:275:16 | b4 | variables.rs:258:13:258:14 | b4 | -| variables.rs:276:15:276:16 | c2 | variables.rs:259:13:259:14 | c2 | -| variables.rs:283:23:283:25 | a10 | variables.rs:280:13:280:15 | a10 | -| variables.rs:284:23:284:24 | b4 | variables.rs:281:13:281:14 | b4 | -| variables.rs:288:15:288:17 | a10 | variables.rs:257:13:257:15 | a10 | -| variables.rs:289:15:289:16 | b4 | variables.rs:258:13:258:14 | b4 | -| variables.rs:295:9:295:9 | x | variables.rs:294:10:294:10 | x | -| variables.rs:297:9:297:23 | example_closure | variables.rs:293:9:293:23 | example_closure | -| variables.rs:298:15:298:16 | n1 | variables.rs:296:9:296:10 | n1 | -| variables.rs:303:9:303:9 | x | variables.rs:302:10:302:10 | x | -| variables.rs:305:9:305:26 | immutable_variable | variables.rs:301:9:301:26 | immutable_variable | -| variables.rs:306:15:306:16 | n2 | variables.rs:304:9:304:10 | n2 | -| variables.rs:313:12:313:12 | v | variables.rs:310:9:310:9 | v | -| variables.rs:314:19:314:22 | text | variables.rs:312:9:312:12 | text | +| variables.rs:92:11:92:12 | s1 | variables.rs:89:9:89:10 | s1 | +| variables.rs:93:19:93:20 | s2 | variables.rs:91:24:91:25 | s2 | +| variables.rs:101:11:101:12 | x6 | variables.rs:98:9:98:10 | x6 | +| variables.rs:106:23:106:24 | y1 | variables.rs:103:14:103:15 | y1 | +| variables.rs:111:15:111:16 | y1 | variables.rs:99:9:99:10 | y1 | +| variables.rs:117:11:117:17 | numbers | variables.rs:115:9:115:15 | numbers | +| variables.rs:123:23:123:27 | first | variables.rs:119:13:119:17 | first | +| variables.rs:124:23:124:27 | third | variables.rs:120:13:120:17 | third | +| variables.rs:125:23:125:27 | fifth | variables.rs:121:13:121:17 | fifth | +| variables.rs:129:11:129:17 | numbers | variables.rs:115:9:115:15 | numbers | +| variables.rs:135:23:135:27 | first | variables.rs:131:13:131:17 | first | +| variables.rs:136:23:136:26 | last | variables.rs:133:13:133:16 | last | +| variables.rs:144:11:144:12 | p2 | variables.rs:142:9:142:10 | p2 | +| variables.rs:147:24:147:25 | x7 | variables.rs:146:16:146:17 | x7 | +| variables.rs:158:11:158:13 | msg | variables.rs:156:9:156:11 | msg | +| variables.rs:161:24:161:34 | id_variable | variables.rs:160:17:160:27 | id_variable | +| variables.rs:166:23:166:24 | id | variables.rs:165:26:165:27 | id | +| variables.rs:177:11:177:16 | either | variables.rs:176:9:176:14 | either | +| variables.rs:179:26:179:27 | a3 | variables.rs:178:9:178:44 | a3 | +| variables.rs:191:11:191:12 | tv | variables.rs:190:9:190:10 | tv | +| variables.rs:193:26:193:27 | a4 | variables.rs:192:9:192:81 | a4 | +| variables.rs:195:11:195:12 | tv | variables.rs:190:9:190:10 | tv | +| variables.rs:197:26:197:27 | a5 | variables.rs:196:9:196:83 | a5 | +| variables.rs:199:11:199:12 | tv | variables.rs:190:9:190:10 | tv | +| variables.rs:201:26:201:27 | a6 | variables.rs:200:9:200:83 | a6 | +| variables.rs:207:11:207:16 | either | variables.rs:206:9:206:14 | either | +| variables.rs:209:16:209:17 | a7 | variables.rs:208:9:208:44 | a7 | +| variables.rs:210:26:210:27 | a7 | variables.rs:208:9:208:44 | a7 | +| variables.rs:218:11:218:16 | either | variables.rs:216:9:216:14 | either | +| variables.rs:222:23:222:25 | a11 | variables.rs:220:14:220:51 | a11 | +| variables.rs:224:15:224:15 | e | variables.rs:219:13:219:13 | e | +| variables.rs:225:28:225:30 | a12 | variables.rs:223:33:223:35 | a12 | +| variables.rs:241:11:241:12 | fv | variables.rs:240:9:240:10 | fv | +| variables.rs:243:26:243:28 | a13 | variables.rs:242:9:242:109 | a13 | +| variables.rs:253:15:253:16 | a8 | variables.rs:248:5:248:6 | a8 | +| variables.rs:254:15:254:16 | b3 | variables.rs:250:9:250:10 | b3 | +| variables.rs:255:15:255:16 | c1 | variables.rs:251:9:251:10 | c1 | +| variables.rs:261:15:261:16 | a9 | variables.rs:259:6:259:41 | a9 | +| variables.rs:270:15:270:17 | a10 | variables.rs:266:13:266:15 | a10 | +| variables.rs:271:15:271:16 | b4 | variables.rs:267:13:267:14 | b4 | +| variables.rs:272:15:272:16 | c2 | variables.rs:268:13:268:14 | c2 | +| variables.rs:275:9:275:10 | c2 | variables.rs:268:13:268:14 | c2 | +| variables.rs:276:9:276:10 | b4 | variables.rs:267:13:267:14 | b4 | +| variables.rs:277:9:277:11 | a10 | variables.rs:266:13:266:15 | a10 | +| variables.rs:279:9:279:11 | a10 | variables.rs:266:13:266:15 | a10 | +| variables.rs:280:9:280:10 | b4 | variables.rs:267:13:267:14 | b4 | +| variables.rs:281:9:281:10 | c2 | variables.rs:268:13:268:14 | c2 | +| variables.rs:283:15:283:17 | a10 | variables.rs:266:13:266:15 | a10 | +| variables.rs:284:15:284:16 | b4 | variables.rs:267:13:267:14 | b4 | +| variables.rs:285:15:285:16 | c2 | variables.rs:268:13:268:14 | c2 | +| variables.rs:292:23:292:25 | a10 | variables.rs:289:13:289:15 | a10 | +| variables.rs:293:23:293:24 | b4 | variables.rs:290:13:290:14 | b4 | +| variables.rs:297:15:297:17 | a10 | variables.rs:266:13:266:15 | a10 | +| variables.rs:298:15:298:16 | b4 | variables.rs:267:13:267:14 | b4 | +| variables.rs:304:9:304:9 | x | variables.rs:303:10:303:10 | x | +| variables.rs:306:9:306:23 | example_closure | variables.rs:302:9:302:23 | example_closure | +| variables.rs:307:15:307:16 | n1 | variables.rs:305:9:305:10 | n1 | +| variables.rs:312:9:312:9 | x | variables.rs:311:10:311:10 | x | +| variables.rs:314:9:314:26 | immutable_variable | variables.rs:310:9:310:26 | immutable_variable | +| variables.rs:315:15:315:16 | n2 | variables.rs:313:9:313:10 | n2 | +| variables.rs:322:12:322:12 | v | variables.rs:319:9:319:9 | v | +| variables.rs:323:19:323:22 | text | variables.rs:321:9:321:12 | text | variableWriteAccess | variables.rs:17:5:17:6 | x2 | variables.rs:15:13:15:14 | x2 | -| variables.rs:266:9:266:10 | c2 | variables.rs:259:13:259:14 | c2 | -| variables.rs:267:9:267:10 | b4 | variables.rs:258:13:258:14 | b4 | -| variables.rs:268:9:268:11 | a10 | variables.rs:257:13:257:15 | a10 | +| variables.rs:275:9:275:10 | c2 | variables.rs:268:13:268:14 | c2 | +| variables.rs:276:9:276:10 | b4 | variables.rs:267:13:267:14 | b4 | +| variables.rs:277:9:277:11 | a10 | variables.rs:266:13:266:15 | a10 | variableReadAccess | variables.rs:11:15:11:16 | x1 | variables.rs:10:9:10:10 | x1 | | variables.rs:16:15:16:16 | x2 | variables.rs:15:13:15:14 | x2 | @@ -171,63 +175,65 @@ variableReadAccess | variables.rs:75:11:75:12 | s1 | variables.rs:72:9:72:10 | s1 | | variables.rs:76:19:76:20 | s2 | variables.rs:74:21:74:22 | s2 | | variables.rs:85:15:85:16 | x5 | variables.rs:81:14:81:15 | x5 | -| variables.rs:92:11:92:12 | x6 | variables.rs:89:9:89:10 | x6 | -| variables.rs:97:23:97:24 | y1 | variables.rs:94:14:94:15 | y1 | -| variables.rs:102:15:102:16 | y1 | variables.rs:90:9:90:10 | y1 | -| variables.rs:108:11:108:17 | numbers | variables.rs:106:9:106:15 | numbers | -| variables.rs:114:23:114:27 | first | variables.rs:110:13:110:17 | first | -| variables.rs:115:23:115:27 | third | variables.rs:111:13:111:17 | third | -| variables.rs:116:23:116:27 | fifth | variables.rs:112:13:112:17 | fifth | -| variables.rs:120:11:120:17 | numbers | variables.rs:106:9:106:15 | numbers | -| variables.rs:126:23:126:27 | first | variables.rs:122:13:122:17 | first | -| variables.rs:127:23:127:26 | last | variables.rs:124:13:124:16 | last | -| variables.rs:135:11:135:12 | p2 | variables.rs:133:9:133:10 | p2 | -| variables.rs:138:24:138:25 | x7 | variables.rs:137:16:137:17 | x7 | -| variables.rs:149:11:149:13 | msg | variables.rs:147:9:147:11 | msg | -| variables.rs:152:24:152:34 | id_variable | variables.rs:151:17:151:27 | id_variable | -| variables.rs:157:23:157:24 | id | variables.rs:156:26:156:27 | id | -| variables.rs:168:11:168:16 | either | variables.rs:167:9:167:14 | either | -| variables.rs:170:26:170:27 | a3 | variables.rs:169:9:169:44 | a3 | -| variables.rs:182:11:182:12 | tv | variables.rs:181:9:181:10 | tv | -| variables.rs:184:26:184:27 | a4 | variables.rs:183:9:183:81 | a4 | -| variables.rs:186:11:186:12 | tv | variables.rs:181:9:181:10 | tv | -| variables.rs:188:26:188:27 | a5 | variables.rs:187:9:187:83 | a5 | -| variables.rs:190:11:190:12 | tv | variables.rs:181:9:181:10 | tv | -| variables.rs:192:26:192:27 | a6 | variables.rs:191:9:191:83 | a6 | -| variables.rs:198:11:198:16 | either | variables.rs:197:9:197:14 | either | -| variables.rs:200:16:200:17 | a7 | variables.rs:199:9:199:44 | a7 | -| variables.rs:201:26:201:27 | a7 | variables.rs:199:9:199:44 | a7 | -| variables.rs:209:11:209:16 | either | variables.rs:207:9:207:14 | either | -| variables.rs:213:23:213:25 | a11 | variables.rs:211:14:211:51 | a11 | -| variables.rs:215:15:215:15 | e | variables.rs:210:13:210:13 | e | -| variables.rs:216:28:216:30 | a12 | variables.rs:214:33:214:35 | a12 | -| variables.rs:232:11:232:12 | fv | variables.rs:231:9:231:10 | fv | -| variables.rs:234:26:234:28 | a13 | variables.rs:233:9:233:109 | a13 | -| variables.rs:244:15:244:16 | a8 | variables.rs:239:5:239:6 | a8 | -| variables.rs:245:15:245:16 | b3 | variables.rs:241:9:241:10 | b3 | -| variables.rs:246:15:246:16 | c1 | variables.rs:242:9:242:10 | c1 | -| variables.rs:252:15:252:16 | a9 | variables.rs:250:6:250:41 | a9 | -| variables.rs:261:15:261:17 | a10 | variables.rs:257:13:257:15 | a10 | -| variables.rs:262:15:262:16 | b4 | variables.rs:258:13:258:14 | b4 | -| variables.rs:263:15:263:16 | c2 | variables.rs:259:13:259:14 | c2 | -| variables.rs:270:9:270:11 | a10 | variables.rs:257:13:257:15 | a10 | -| variables.rs:271:9:271:10 | b4 | variables.rs:258:13:258:14 | b4 | -| variables.rs:272:9:272:10 | c2 | variables.rs:259:13:259:14 | c2 | -| variables.rs:274:15:274:17 | a10 | variables.rs:257:13:257:15 | a10 | -| variables.rs:275:15:275:16 | b4 | variables.rs:258:13:258:14 | b4 | -| variables.rs:276:15:276:16 | c2 | variables.rs:259:13:259:14 | c2 | -| variables.rs:283:23:283:25 | a10 | variables.rs:280:13:280:15 | a10 | -| variables.rs:284:23:284:24 | b4 | variables.rs:281:13:281:14 | b4 | -| variables.rs:288:15:288:17 | a10 | variables.rs:257:13:257:15 | a10 | -| variables.rs:289:15:289:16 | b4 | variables.rs:258:13:258:14 | b4 | -| variables.rs:295:9:295:9 | x | variables.rs:294:10:294:10 | x | -| variables.rs:297:9:297:23 | example_closure | variables.rs:293:9:293:23 | example_closure | -| variables.rs:298:15:298:16 | n1 | variables.rs:296:9:296:10 | n1 | -| variables.rs:303:9:303:9 | x | variables.rs:302:10:302:10 | x | -| variables.rs:305:9:305:26 | immutable_variable | variables.rs:301:9:301:26 | immutable_variable | -| variables.rs:306:15:306:16 | n2 | variables.rs:304:9:304:10 | n2 | -| variables.rs:313:12:313:12 | v | variables.rs:310:9:310:9 | v | -| variables.rs:314:19:314:22 | text | variables.rs:312:9:312:12 | text | +| variables.rs:92:11:92:12 | s1 | variables.rs:89:9:89:10 | s1 | +| variables.rs:93:19:93:20 | s2 | variables.rs:91:24:91:25 | s2 | +| variables.rs:101:11:101:12 | x6 | variables.rs:98:9:98:10 | x6 | +| variables.rs:106:23:106:24 | y1 | variables.rs:103:14:103:15 | y1 | +| variables.rs:111:15:111:16 | y1 | variables.rs:99:9:99:10 | y1 | +| variables.rs:117:11:117:17 | numbers | variables.rs:115:9:115:15 | numbers | +| variables.rs:123:23:123:27 | first | variables.rs:119:13:119:17 | first | +| variables.rs:124:23:124:27 | third | variables.rs:120:13:120:17 | third | +| variables.rs:125:23:125:27 | fifth | variables.rs:121:13:121:17 | fifth | +| variables.rs:129:11:129:17 | numbers | variables.rs:115:9:115:15 | numbers | +| variables.rs:135:23:135:27 | first | variables.rs:131:13:131:17 | first | +| variables.rs:136:23:136:26 | last | variables.rs:133:13:133:16 | last | +| variables.rs:144:11:144:12 | p2 | variables.rs:142:9:142:10 | p2 | +| variables.rs:147:24:147:25 | x7 | variables.rs:146:16:146:17 | x7 | +| variables.rs:158:11:158:13 | msg | variables.rs:156:9:156:11 | msg | +| variables.rs:161:24:161:34 | id_variable | variables.rs:160:17:160:27 | id_variable | +| variables.rs:166:23:166:24 | id | variables.rs:165:26:165:27 | id | +| variables.rs:177:11:177:16 | either | variables.rs:176:9:176:14 | either | +| variables.rs:179:26:179:27 | a3 | variables.rs:178:9:178:44 | a3 | +| variables.rs:191:11:191:12 | tv | variables.rs:190:9:190:10 | tv | +| variables.rs:193:26:193:27 | a4 | variables.rs:192:9:192:81 | a4 | +| variables.rs:195:11:195:12 | tv | variables.rs:190:9:190:10 | tv | +| variables.rs:197:26:197:27 | a5 | variables.rs:196:9:196:83 | a5 | +| variables.rs:199:11:199:12 | tv | variables.rs:190:9:190:10 | tv | +| variables.rs:201:26:201:27 | a6 | variables.rs:200:9:200:83 | a6 | +| variables.rs:207:11:207:16 | either | variables.rs:206:9:206:14 | either | +| variables.rs:209:16:209:17 | a7 | variables.rs:208:9:208:44 | a7 | +| variables.rs:210:26:210:27 | a7 | variables.rs:208:9:208:44 | a7 | +| variables.rs:218:11:218:16 | either | variables.rs:216:9:216:14 | either | +| variables.rs:222:23:222:25 | a11 | variables.rs:220:14:220:51 | a11 | +| variables.rs:224:15:224:15 | e | variables.rs:219:13:219:13 | e | +| variables.rs:225:28:225:30 | a12 | variables.rs:223:33:223:35 | a12 | +| variables.rs:241:11:241:12 | fv | variables.rs:240:9:240:10 | fv | +| variables.rs:243:26:243:28 | a13 | variables.rs:242:9:242:109 | a13 | +| variables.rs:253:15:253:16 | a8 | variables.rs:248:5:248:6 | a8 | +| variables.rs:254:15:254:16 | b3 | variables.rs:250:9:250:10 | b3 | +| variables.rs:255:15:255:16 | c1 | variables.rs:251:9:251:10 | c1 | +| variables.rs:261:15:261:16 | a9 | variables.rs:259:6:259:41 | a9 | +| variables.rs:270:15:270:17 | a10 | variables.rs:266:13:266:15 | a10 | +| variables.rs:271:15:271:16 | b4 | variables.rs:267:13:267:14 | b4 | +| variables.rs:272:15:272:16 | c2 | variables.rs:268:13:268:14 | c2 | +| variables.rs:279:9:279:11 | a10 | variables.rs:266:13:266:15 | a10 | +| variables.rs:280:9:280:10 | b4 | variables.rs:267:13:267:14 | b4 | +| variables.rs:281:9:281:10 | c2 | variables.rs:268:13:268:14 | c2 | +| variables.rs:283:15:283:17 | a10 | variables.rs:266:13:266:15 | a10 | +| variables.rs:284:15:284:16 | b4 | variables.rs:267:13:267:14 | b4 | +| variables.rs:285:15:285:16 | c2 | variables.rs:268:13:268:14 | c2 | +| variables.rs:292:23:292:25 | a10 | variables.rs:289:13:289:15 | a10 | +| variables.rs:293:23:293:24 | b4 | variables.rs:290:13:290:14 | b4 | +| variables.rs:297:15:297:17 | a10 | variables.rs:266:13:266:15 | a10 | +| variables.rs:298:15:298:16 | b4 | variables.rs:267:13:267:14 | b4 | +| variables.rs:304:9:304:9 | x | variables.rs:303:10:303:10 | x | +| variables.rs:306:9:306:23 | example_closure | variables.rs:302:9:302:23 | example_closure | +| variables.rs:307:15:307:16 | n1 | variables.rs:305:9:305:10 | n1 | +| variables.rs:312:9:312:9 | x | variables.rs:311:10:311:10 | x | +| variables.rs:314:9:314:26 | immutable_variable | variables.rs:310:9:310:26 | immutable_variable | +| variables.rs:315:15:315:16 | n2 | variables.rs:313:9:313:10 | n2 | +| variables.rs:322:12:322:12 | v | variables.rs:319:9:319:9 | v | +| variables.rs:323:19:323:22 | text | variables.rs:321:9:321:12 | text | variableInitializer | variables.rs:10:9:10:10 | x1 | variables.rs:10:14:10:16 | "a" | | variables.rs:15:13:15:14 | x2 | variables.rs:15:18:15:18 | 4 | @@ -237,18 +243,19 @@ variableInitializer | variables.rs:33:13:33:14 | x4 | variables.rs:33:18:33:20 | "b" | | variables.rs:62:9:62:10 | p1 | variables.rs:62:14:62:37 | RecordExpr | | variables.rs:72:9:72:10 | s1 | variables.rs:72:14:72:41 | CallExpr | -| variables.rs:89:9:89:10 | x6 | variables.rs:89:14:89:20 | CallExpr | -| variables.rs:90:9:90:10 | y1 | variables.rs:90:14:90:15 | 10 | -| variables.rs:106:9:106:15 | numbers | variables.rs:106:19:106:35 | TupleExpr | -| variables.rs:133:9:133:10 | p2 | variables.rs:133:14:133:37 | RecordExpr | -| variables.rs:147:9:147:11 | msg | variables.rs:147:15:147:38 | RecordExpr | -| variables.rs:167:9:167:14 | either | variables.rs:167:18:167:33 | CallExpr | -| variables.rs:181:9:181:10 | tv | variables.rs:181:14:181:36 | CallExpr | -| variables.rs:197:9:197:14 | either | variables.rs:197:18:197:33 | CallExpr | -| variables.rs:207:9:207:14 | either | variables.rs:207:18:207:33 | CallExpr | -| variables.rs:231:9:231:10 | fv | variables.rs:231:14:231:35 | CallExpr | -| variables.rs:293:9:293:23 | example_closure | variables.rs:294:9:295:9 | ClosureExpr | -| variables.rs:296:9:296:10 | n1 | variables.rs:297:9:297:26 | CallExpr | -| variables.rs:301:9:301:26 | immutable_variable | variables.rs:302:9:303:9 | ClosureExpr | -| variables.rs:304:9:304:10 | n2 | variables.rs:305:9:305:29 | CallExpr | -| variables.rs:310:9:310:9 | v | variables.rs:310:13:310:41 | RefExpr | +| variables.rs:89:9:89:10 | s1 | variables.rs:89:14:89:41 | CallExpr | +| variables.rs:98:9:98:10 | x6 | variables.rs:98:14:98:20 | CallExpr | +| variables.rs:99:9:99:10 | y1 | variables.rs:99:14:99:15 | 10 | +| variables.rs:115:9:115:15 | numbers | variables.rs:115:19:115:35 | TupleExpr | +| variables.rs:142:9:142:10 | p2 | variables.rs:142:14:142:37 | RecordExpr | +| variables.rs:156:9:156:11 | msg | variables.rs:156:15:156:38 | RecordExpr | +| variables.rs:176:9:176:14 | either | variables.rs:176:18:176:33 | CallExpr | +| variables.rs:190:9:190:10 | tv | variables.rs:190:14:190:36 | CallExpr | +| variables.rs:206:9:206:14 | either | variables.rs:206:18:206:33 | CallExpr | +| variables.rs:216:9:216:14 | either | variables.rs:216:18:216:33 | CallExpr | +| variables.rs:240:9:240:10 | fv | variables.rs:240:14:240:35 | CallExpr | +| variables.rs:302:9:302:23 | example_closure | variables.rs:303:9:304:9 | ClosureExpr | +| variables.rs:305:9:305:10 | n1 | variables.rs:306:9:306:26 | CallExpr | +| variables.rs:310:9:310:26 | immutable_variable | variables.rs:311:9:312:9 | ClosureExpr | +| variables.rs:313:9:313:10 | n2 | variables.rs:314:9:314:29 | CallExpr | +| variables.rs:319:9:319:9 | v | variables.rs:319:13:319:41 | RefExpr | diff --git a/rust/ql/test/library-tests/variables/variables.rs b/rust/ql/test/library-tests/variables/variables.rs index 8a0e83c9eff7..85fa052a7aa2 100644 --- a/rust/ql/test/library-tests/variables/variables.rs +++ b/rust/ql/test/library-tests/variables/variables.rs @@ -85,6 +85,15 @@ fn let_pattern4() { print_str(x5); // $ access=x5 } +fn let_pattern5() { + let s1 = Some(String::from("Hello!")); // s1 + + while let Some(ref s2) // s2 + = s1 { // $ access=s1 + print_str(s2); // $ access=s2 + } +} + fn match_pattern1() { let x6 = Some(5); // x6 let y1 = 10; // y1_1 diff --git a/rust/ql/test/query-tests/unusedentities/UnusedVariable.expected b/rust/ql/test/query-tests/unusedentities/UnusedVariable.expected index 4a35ca8a41d4..fd4b8d3d2b46 100644 --- a/rust/ql/test/query-tests/unusedentities/UnusedVariable.expected +++ b/rust/ql/test/query-tests/unusedentities/UnusedVariable.expected @@ -3,12 +3,11 @@ | main.rs:114:9:114:9 | k | Variable is not used. | | main.rs:141:5:141:5 | y | Variable is not used. | | main.rs:164:9:164:9 | x | Variable is not used. | -| main.rs:170:9:170:9 | x | Variable is not used. | +| main.rs:169:9:169:9 | x | Variable is not used. | | main.rs:174:9:174:9 | x | Variable is not used. | -| main.rs:194:17:194:17 | a | Variable is not used. | -| main.rs:202:20:202:22 | val | Variable is not used. | -| main.rs:207:20:207:22 | val | Variable is not used. | -| main.rs:214:14:214:16 | val | Variable is not used. | -| main.rs:216:9:216:12 | None | Variable is not used. | -| main.rs:225:9:225:12 | None | Variable is not used. | -| main.rs:231:24:231:26 | val | Variable is not used. | +| main.rs:195:17:195:17 | a | Variable is not used. | +| main.rs:203:20:203:22 | val | Variable is not used. | +| main.rs:216:14:216:16 | val | Variable is not used. | +| main.rs:218:9:218:12 | None | Variable is not used. | +| main.rs:227:9:227:12 | None | Variable is not used. | +| main.rs:233:24:233:26 | val | Variable is not used. | diff --git a/rust/ql/test/query-tests/unusedentities/main.rs b/rust/ql/test/query-tests/unusedentities/main.rs index 46d1458b972e..a34219f8a7ab 100644 --- a/rust/ql/test/query-tests/unusedentities/main.rs +++ b/rust/ql/test/query-tests/unusedentities/main.rs @@ -164,14 +164,15 @@ fn loops() { for x in 1..10 { // BAD: unused variable } - for _ in 1..10 { - } + for _ in 1..10 {} - for x in 1..10 { // SPURIOUS: unused variable [macros not yet supported] + for x // SPURIOUS: unused variable [macros not yet supported] + in 1..10 { println!("x is {}", x); } - for x in 1..10 { // SPURIOUS: unused variable [macros not yet supported] + for x // SPURIOUS: unused variable [macros not yet supported] + in 1..10 { assert!(x != 11); } } @@ -199,12 +200,13 @@ fn if_lets() { } let mut next = Some(30); - while let Some(val) = next { // BAD: unused variable + while let Some(val) = next // BAD: unused variable + { next = None; } let mut next2 = Some(40); - while let Some(val) = next2 { // SPURIOUS: unused variable 'val' + while let Some(val) = next2 { total += val; next2 = None; } @@ -212,7 +214,7 @@ fn if_lets() { let c = Some(60); match c { Some(val) => { // BAD: unused variable - }, + } None => { // SPURIOUS: unused variable 'None' } } @@ -221,7 +223,7 @@ fn if_lets() { match d { Some(val) => { total += val; - }, + } None => { // SPURIOUS: unused variable 'None' } } @@ -229,17 +231,14 @@ fn if_lets() { let e = MyOption::Some(80); match e { MyOption::Some(val) => { // BAD: unused variable - }, - MyOption::None => { } + MyOption::None => {} } let f = YesOrNo::Yes; match f { - YesOrNo::Yes => { - }, - YesOrNo::No => { - }, + YesOrNo::Yes => {} + YesOrNo::No => {} } } From ccaf2dd9ea1e381d75b38f478ac9d183e8b871cb Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 3 Oct 2024 13:37:15 +0100 Subject: [PATCH 67/79] Rust: Temporarily limit results (hopefully enough for the DCA job to cope). --- rust/ql/src/queries/unusedentities/UnusedVariable.ql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rust/ql/src/queries/unusedentities/UnusedVariable.ql b/rust/ql/src/queries/unusedentities/UnusedVariable.ql index 5fb0cdfecdc1..f6be18b76e15 100644 --- a/rust/ql/src/queries/unusedentities/UnusedVariable.ql +++ b/rust/ql/src/queries/unusedentities/UnusedVariable.ql @@ -14,5 +14,6 @@ from Variable v where not exists(v.getAnAccess()) and not exists(v.getInitializer()) and - not v.getName().charAt(0) = "_" + not v.getName().charAt(0) = "_" and + exists(File f | f.getBaseName() = "main.rs" | v.getLocation().getFile() = f) // temporarily severely limit results select v, "Variable is not used." From 05f85497ed8fd150e639a66bc47e6af65252e006 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Thu, 3 Oct 2024 13:33:13 +0200 Subject: [PATCH 68/79] Rust: Add `&mut` variable tests --- .../test/library-tests/variables/Cfg.expected | 1291 +++++++++-------- .../variables/variables.expected | 553 +++---- .../test/library-tests/variables/variables.ql | 11 +- .../test/library-tests/variables/variables.rs | 205 +-- 4 files changed, 1111 insertions(+), 949 deletions(-) diff --git a/rust/ql/test/library-tests/variables/Cfg.expected b/rust/ql/test/library-tests/variables/Cfg.expected index 1ae43dac402e..55b09cf6ace7 100644 --- a/rust/ql/test/library-tests/variables/Cfg.expected +++ b/rust/ql/test/library-tests/variables/Cfg.expected @@ -1,616 +1,691 @@ edges -| variables.rs:1:1:3:1 | enter print_str | variables.rs:2:5:2:22 | ExprStmt | | -| variables.rs:1:1:3:1 | exit print_str (normal) | variables.rs:1:1:3:1 | exit print_str | | -| variables.rs:1:23:3:1 | BlockExpr | variables.rs:1:1:3:1 | exit print_str (normal) | | -| variables.rs:2:5:2:21 | MacroExpr | variables.rs:1:23:3:1 | BlockExpr | | -| variables.rs:2:5:2:22 | ExprStmt | variables.rs:2:5:2:21 | MacroExpr | | -| variables.rs:5:1:7:1 | enter print_i64 | variables.rs:6:5:6:22 | ExprStmt | | -| variables.rs:5:1:7:1 | exit print_i64 (normal) | variables.rs:5:1:7:1 | exit print_i64 | | -| variables.rs:5:22:7:1 | BlockExpr | variables.rs:5:1:7:1 | exit print_i64 (normal) | | -| variables.rs:6:5:6:21 | MacroExpr | variables.rs:5:22:7:1 | BlockExpr | | -| variables.rs:6:5:6:22 | ExprStmt | variables.rs:6:5:6:21 | MacroExpr | | -| variables.rs:9:1:12:1 | enter immutable_variable | variables.rs:10:5:10:17 | LetStmt | | -| variables.rs:9:1:12:1 | exit immutable_variable (normal) | variables.rs:9:1:12:1 | exit immutable_variable | | -| variables.rs:9:25:12:1 | BlockExpr | variables.rs:9:1:12:1 | exit immutable_variable (normal) | | -| variables.rs:10:5:10:17 | LetStmt | variables.rs:10:14:10:16 | "a" | | -| variables.rs:10:9:10:10 | x1 | variables.rs:11:5:11:18 | ExprStmt | match, no-match | -| variables.rs:10:14:10:16 | "a" | variables.rs:10:9:10:10 | x1 | | -| variables.rs:11:5:11:13 | PathExpr | variables.rs:11:15:11:16 | x1 | | -| variables.rs:11:5:11:17 | CallExpr | variables.rs:9:25:12:1 | BlockExpr | | -| variables.rs:11:5:11:18 | ExprStmt | variables.rs:11:5:11:13 | PathExpr | | -| variables.rs:11:15:11:16 | x1 | variables.rs:11:5:11:17 | CallExpr | | -| variables.rs:14:1:19:1 | enter mutable_variable | variables.rs:15:5:15:19 | LetStmt | | -| variables.rs:14:1:19:1 | exit mutable_variable (normal) | variables.rs:14:1:19:1 | exit mutable_variable | | -| variables.rs:14:23:19:1 | BlockExpr | variables.rs:14:1:19:1 | exit mutable_variable (normal) | | -| variables.rs:15:5:15:19 | LetStmt | variables.rs:15:18:15:18 | 4 | | -| variables.rs:15:9:15:14 | x2 | variables.rs:16:5:16:18 | ExprStmt | match, no-match | -| variables.rs:15:18:15:18 | 4 | variables.rs:15:9:15:14 | x2 | | -| variables.rs:16:5:16:13 | PathExpr | variables.rs:16:15:16:16 | x2 | | -| variables.rs:16:5:16:17 | CallExpr | variables.rs:17:5:17:11 | ExprStmt | | -| variables.rs:16:5:16:18 | ExprStmt | variables.rs:16:5:16:13 | PathExpr | | -| variables.rs:16:15:16:16 | x2 | variables.rs:16:5:16:17 | CallExpr | | -| variables.rs:17:5:17:6 | x2 | variables.rs:17:10:17:10 | 5 | | -| variables.rs:17:5:17:10 | ... = ... | variables.rs:18:5:18:18 | ExprStmt | | -| variables.rs:17:5:17:11 | ExprStmt | variables.rs:17:5:17:6 | x2 | | -| variables.rs:17:10:17:10 | 5 | variables.rs:17:5:17:10 | ... = ... | | +| variables.rs:3:1:5:1 | enter print_str | variables.rs:4:5:4:22 | ExprStmt | | +| variables.rs:3:1:5:1 | exit print_str (normal) | variables.rs:3:1:5:1 | exit print_str | | +| variables.rs:3:23:5:1 | BlockExpr | variables.rs:3:1:5:1 | exit print_str (normal) | | +| variables.rs:4:5:4:21 | MacroExpr | variables.rs:3:23:5:1 | BlockExpr | | +| variables.rs:4:5:4:22 | ExprStmt | variables.rs:4:5:4:21 | MacroExpr | | +| variables.rs:7:1:9:1 | enter print_i64 | variables.rs:8:5:8:22 | ExprStmt | | +| variables.rs:7:1:9:1 | exit print_i64 (normal) | variables.rs:7:1:9:1 | exit print_i64 | | +| variables.rs:7:22:9:1 | BlockExpr | variables.rs:7:1:9:1 | exit print_i64 (normal) | | +| variables.rs:8:5:8:21 | MacroExpr | variables.rs:7:22:9:1 | BlockExpr | | +| variables.rs:8:5:8:22 | ExprStmt | variables.rs:8:5:8:21 | MacroExpr | | +| variables.rs:11:1:14:1 | enter immutable_variable | variables.rs:12:5:12:17 | LetStmt | | +| variables.rs:11:1:14:1 | exit immutable_variable (normal) | variables.rs:11:1:14:1 | exit immutable_variable | | +| variables.rs:11:25:14:1 | BlockExpr | variables.rs:11:1:14:1 | exit immutable_variable (normal) | | +| variables.rs:12:5:12:17 | LetStmt | variables.rs:12:14:12:16 | "a" | | +| variables.rs:12:9:12:10 | x1 | variables.rs:13:5:13:18 | ExprStmt | match, no-match | +| variables.rs:12:14:12:16 | "a" | variables.rs:12:9:12:10 | x1 | | +| variables.rs:13:5:13:13 | PathExpr | variables.rs:13:15:13:16 | x1 | | +| variables.rs:13:5:13:17 | CallExpr | variables.rs:11:25:14:1 | BlockExpr | | +| variables.rs:13:5:13:18 | ExprStmt | variables.rs:13:5:13:13 | PathExpr | | +| variables.rs:13:15:13:16 | x1 | variables.rs:13:5:13:17 | CallExpr | | +| variables.rs:16:1:21:1 | enter mutable_variable | variables.rs:17:5:17:19 | LetStmt | | +| variables.rs:16:1:21:1 | exit mutable_variable (normal) | variables.rs:16:1:21:1 | exit mutable_variable | | +| variables.rs:16:23:21:1 | BlockExpr | variables.rs:16:1:21:1 | exit mutable_variable (normal) | | +| variables.rs:17:5:17:19 | LetStmt | variables.rs:17:18:17:18 | 4 | | +| variables.rs:17:9:17:14 | x2 | variables.rs:18:5:18:18 | ExprStmt | match, no-match | +| variables.rs:17:18:17:18 | 4 | variables.rs:17:9:17:14 | x2 | | | variables.rs:18:5:18:13 | PathExpr | variables.rs:18:15:18:16 | x2 | | -| variables.rs:18:5:18:17 | CallExpr | variables.rs:14:23:19:1 | BlockExpr | | +| variables.rs:18:5:18:17 | CallExpr | variables.rs:19:5:19:11 | ExprStmt | | | variables.rs:18:5:18:18 | ExprStmt | variables.rs:18:5:18:13 | PathExpr | | | variables.rs:18:15:18:16 | x2 | variables.rs:18:5:18:17 | CallExpr | | -| variables.rs:21:1:27:1 | enter variable_shadow1 | variables.rs:22:5:22:15 | LetStmt | | -| variables.rs:21:1:27:1 | exit variable_shadow1 (normal) | variables.rs:21:1:27:1 | exit variable_shadow1 | | -| variables.rs:21:23:27:1 | BlockExpr | variables.rs:21:1:27:1 | exit variable_shadow1 (normal) | | -| variables.rs:22:5:22:15 | LetStmt | variables.rs:22:14:22:14 | 1 | | -| variables.rs:22:9:22:10 | x3 | variables.rs:23:5:23:18 | ExprStmt | match, no-match | -| variables.rs:22:14:22:14 | 1 | variables.rs:22:9:22:10 | x3 | | -| variables.rs:23:5:23:13 | PathExpr | variables.rs:23:15:23:16 | x3 | | -| variables.rs:23:5:23:17 | CallExpr | variables.rs:24:5:25:15 | LetStmt | | -| variables.rs:23:5:23:18 | ExprStmt | variables.rs:23:5:23:13 | PathExpr | | -| variables.rs:23:15:23:16 | x3 | variables.rs:23:5:23:17 | CallExpr | | -| variables.rs:24:5:25:15 | LetStmt | variables.rs:25:9:25:10 | x3 | | -| variables.rs:24:9:24:10 | x3 | variables.rs:26:5:26:18 | ExprStmt | match, no-match | -| variables.rs:25:9:25:10 | x3 | variables.rs:25:14:25:14 | 1 | | -| variables.rs:25:9:25:14 | ... + ... | variables.rs:24:9:24:10 | x3 | | -| variables.rs:25:14:25:14 | 1 | variables.rs:25:9:25:14 | ... + ... | | -| variables.rs:26:5:26:13 | PathExpr | variables.rs:26:15:26:16 | x3 | | -| variables.rs:26:5:26:17 | CallExpr | variables.rs:21:23:27:1 | BlockExpr | | -| variables.rs:26:5:26:18 | ExprStmt | variables.rs:26:5:26:13 | PathExpr | | -| variables.rs:26:15:26:16 | x3 | variables.rs:26:5:26:17 | CallExpr | | -| variables.rs:29:1:37:1 | enter variable_shadow2 | variables.rs:30:5:30:17 | LetStmt | | -| variables.rs:29:1:37:1 | exit variable_shadow2 (normal) | variables.rs:29:1:37:1 | exit variable_shadow2 | | -| variables.rs:29:23:37:1 | BlockExpr | variables.rs:29:1:37:1 | exit variable_shadow2 (normal) | | -| variables.rs:30:5:30:17 | LetStmt | variables.rs:30:14:30:16 | "a" | | -| variables.rs:30:9:30:10 | x4 | variables.rs:31:5:31:18 | ExprStmt | match, no-match | -| variables.rs:30:14:30:16 | "a" | variables.rs:30:9:30:10 | x4 | | -| variables.rs:31:5:31:13 | PathExpr | variables.rs:31:15:31:16 | x4 | | -| variables.rs:31:5:31:17 | CallExpr | variables.rs:32:5:35:5 | ExprStmt | | -| variables.rs:31:5:31:18 | ExprStmt | variables.rs:31:5:31:13 | PathExpr | | -| variables.rs:31:15:31:16 | x4 | variables.rs:31:5:31:17 | CallExpr | | -| variables.rs:32:5:35:5 | BlockExpr | variables.rs:36:5:36:18 | ExprStmt | | -| variables.rs:32:5:35:5 | ExprStmt | variables.rs:33:9:33:21 | LetStmt | | -| variables.rs:33:9:33:21 | LetStmt | variables.rs:33:18:33:20 | "b" | | -| variables.rs:33:13:33:14 | x4 | variables.rs:34:9:34:22 | ExprStmt | match, no-match | -| variables.rs:33:18:33:20 | "b" | variables.rs:33:13:33:14 | x4 | | -| variables.rs:34:9:34:17 | PathExpr | variables.rs:34:19:34:20 | x4 | | -| variables.rs:34:9:34:21 | CallExpr | variables.rs:32:5:35:5 | BlockExpr | | -| variables.rs:34:9:34:22 | ExprStmt | variables.rs:34:9:34:17 | PathExpr | | -| variables.rs:34:19:34:20 | x4 | variables.rs:34:9:34:21 | CallExpr | | -| variables.rs:36:5:36:13 | PathExpr | variables.rs:36:15:36:16 | x4 | | -| variables.rs:36:5:36:17 | CallExpr | variables.rs:29:23:37:1 | BlockExpr | | -| variables.rs:36:5:36:18 | ExprStmt | variables.rs:36:5:36:13 | PathExpr | | -| variables.rs:36:15:36:16 | x4 | variables.rs:36:5:36:17 | CallExpr | | -| variables.rs:44:1:59:1 | enter let_pattern1 | variables.rs:45:5:54:47 | LetStmt | | -| variables.rs:44:1:59:1 | exit let_pattern1 (normal) | variables.rs:44:1:59:1 | exit let_pattern1 | | -| variables.rs:44:19:59:1 | BlockExpr | variables.rs:44:1:59:1 | exit let_pattern1 (normal) | | -| variables.rs:45:5:54:47 | LetStmt | variables.rs:54:11:54:13 | "a" | | -| variables.rs:45:9:54:5 | TuplePat | variables.rs:55:5:55:18 | ExprStmt | match | -| variables.rs:54:9:54:46 | TupleExpr | variables.rs:45:9:54:5 | TuplePat | | -| variables.rs:54:10:54:19 | TupleExpr | variables.rs:54:33:54:35 | "x" | | -| variables.rs:54:11:54:13 | "a" | variables.rs:54:16:54:18 | "b" | | -| variables.rs:54:16:54:18 | "b" | variables.rs:54:10:54:19 | TupleExpr | | -| variables.rs:54:22:54:45 | RecordExpr | variables.rs:54:9:54:46 | TupleExpr | | -| variables.rs:54:33:54:35 | "x" | variables.rs:54:41:54:43 | "y" | | -| variables.rs:54:41:54:43 | "y" | variables.rs:54:22:54:45 | RecordExpr | | -| variables.rs:55:5:55:13 | PathExpr | variables.rs:55:15:55:16 | a1 | | -| variables.rs:55:5:55:17 | CallExpr | variables.rs:56:5:56:18 | ExprStmt | | -| variables.rs:55:5:55:18 | ExprStmt | variables.rs:55:5:55:13 | PathExpr | | -| variables.rs:55:15:55:16 | a1 | variables.rs:55:5:55:17 | CallExpr | | -| variables.rs:56:5:56:13 | PathExpr | variables.rs:56:15:56:16 | b1 | | -| variables.rs:56:5:56:17 | CallExpr | variables.rs:57:5:57:17 | ExprStmt | | -| variables.rs:56:5:56:18 | ExprStmt | variables.rs:56:5:56:13 | PathExpr | | -| variables.rs:56:15:56:16 | b1 | variables.rs:56:5:56:17 | CallExpr | | -| variables.rs:57:5:57:13 | PathExpr | variables.rs:57:15:57:15 | x | | -| variables.rs:57:5:57:16 | CallExpr | variables.rs:58:5:58:17 | ExprStmt | | -| variables.rs:57:5:57:17 | ExprStmt | variables.rs:57:5:57:13 | PathExpr | | -| variables.rs:57:15:57:15 | x | variables.rs:57:5:57:16 | CallExpr | | -| variables.rs:58:5:58:13 | PathExpr | variables.rs:58:15:58:15 | y | | -| variables.rs:58:5:58:16 | CallExpr | variables.rs:44:19:59:1 | BlockExpr | | -| variables.rs:58:5:58:17 | ExprStmt | variables.rs:58:5:58:13 | PathExpr | | -| variables.rs:58:15:58:15 | y | variables.rs:58:5:58:16 | CallExpr | | -| variables.rs:61:1:69:1 | enter let_pattern2 | variables.rs:62:5:62:38 | LetStmt | | -| variables.rs:61:1:69:1 | exit let_pattern2 (normal) | variables.rs:61:1:69:1 | exit let_pattern2 | | -| variables.rs:61:19:69:1 | BlockExpr | variables.rs:61:1:69:1 | exit let_pattern2 (normal) | | -| variables.rs:62:5:62:38 | LetStmt | variables.rs:62:25:62:27 | "a" | | -| variables.rs:62:9:62:10 | p1 | variables.rs:63:5:66:11 | LetStmt | match, no-match | -| variables.rs:62:14:62:37 | RecordExpr | variables.rs:62:9:62:10 | p1 | | -| variables.rs:62:25:62:27 | "a" | variables.rs:62:33:62:35 | "b" | | -| variables.rs:62:33:62:35 | "b" | variables.rs:62:14:62:37 | RecordExpr | | -| variables.rs:63:5:66:11 | LetStmt | variables.rs:66:9:66:10 | p1 | | -| variables.rs:63:9:66:5 | RecordPat | variables.rs:67:5:67:18 | ExprStmt | match | -| variables.rs:66:9:66:10 | p1 | variables.rs:63:9:66:5 | RecordPat | | -| variables.rs:67:5:67:13 | PathExpr | variables.rs:67:15:67:16 | a2 | | -| variables.rs:67:5:67:17 | CallExpr | variables.rs:68:5:68:18 | ExprStmt | | -| variables.rs:67:5:67:18 | ExprStmt | variables.rs:67:5:67:13 | PathExpr | | -| variables.rs:67:15:67:16 | a2 | variables.rs:67:5:67:17 | CallExpr | | -| variables.rs:68:5:68:13 | PathExpr | variables.rs:68:15:68:16 | b2 | | -| variables.rs:68:5:68:17 | CallExpr | variables.rs:61:19:69:1 | BlockExpr | | -| variables.rs:68:5:68:18 | ExprStmt | variables.rs:68:5:68:13 | PathExpr | | -| variables.rs:68:15:68:16 | b2 | variables.rs:68:5:68:17 | CallExpr | | -| variables.rs:71:1:78:1 | enter let_pattern3 | variables.rs:72:5:72:42 | LetStmt | | -| variables.rs:71:1:78:1 | exit let_pattern3 (normal) | variables.rs:71:1:78:1 | exit let_pattern3 | | -| variables.rs:71:19:78:1 | BlockExpr | variables.rs:71:1:78:1 | exit let_pattern3 (normal) | | -| variables.rs:72:5:72:42 | LetStmt | variables.rs:72:14:72:17 | PathExpr | | -| variables.rs:72:9:72:10 | s1 | variables.rs:74:8:75:12 | LetExpr | match, no-match | -| variables.rs:72:14:72:17 | PathExpr | variables.rs:72:19:72:30 | PathExpr | | -| variables.rs:72:14:72:41 | CallExpr | variables.rs:72:9:72:10 | s1 | | -| variables.rs:72:19:72:30 | PathExpr | variables.rs:72:32:72:39 | "Hello!" | | -| variables.rs:72:19:72:40 | CallExpr | variables.rs:72:14:72:41 | CallExpr | | -| variables.rs:72:32:72:39 | "Hello!" | variables.rs:72:19:72:40 | CallExpr | | -| variables.rs:74:5:77:5 | IfExpr | variables.rs:71:19:78:1 | BlockExpr | | -| variables.rs:74:8:75:12 | LetExpr | variables.rs:74:12:74:23 | TupleStructPat | | -| variables.rs:74:12:74:23 | TupleStructPat | variables.rs:74:5:77:5 | IfExpr | no-match | -| variables.rs:74:12:74:23 | TupleStructPat | variables.rs:76:9:76:22 | ExprStmt | match | -| variables.rs:75:14:77:5 | BlockExpr | variables.rs:74:5:77:5 | IfExpr | | -| variables.rs:76:9:76:17 | PathExpr | variables.rs:76:19:76:20 | s2 | | -| variables.rs:76:9:76:21 | CallExpr | variables.rs:75:14:77:5 | BlockExpr | | -| variables.rs:76:9:76:22 | ExprStmt | variables.rs:76:9:76:17 | PathExpr | | -| variables.rs:76:19:76:20 | s2 | variables.rs:76:9:76:21 | CallExpr | | -| variables.rs:80:1:86:1 | enter let_pattern4 | variables.rs:81:5:84:6 | LetStmt | | -| variables.rs:80:1:86:1 | exit let_pattern4 (normal) | variables.rs:80:1:86:1 | exit let_pattern4 | | -| variables.rs:80:19:86:1 | BlockExpr | variables.rs:80:1:86:1 | exit let_pattern4 (normal) | | -| variables.rs:81:5:84:6 | LetStmt | variables.rs:81:34:81:37 | PathExpr | | -| variables.rs:81:9:81:16 | TupleStructPat | variables.rs:83:9:83:15 | MacroExpr | no-match | -| variables.rs:81:9:81:16 | TupleStructPat | variables.rs:85:5:85:18 | ExprStmt | match | -| variables.rs:81:34:81:37 | PathExpr | variables.rs:81:39:81:42 | "x5" | | -| variables.rs:81:34:81:43 | CallExpr | variables.rs:81:9:81:16 | TupleStructPat | | -| variables.rs:81:39:81:42 | "x5" | variables.rs:81:34:81:43 | CallExpr | | -| variables.rs:83:9:83:15 | MacroExpr | variables.rs:81:50:84:5 | BlockExpr | | -| variables.rs:85:5:85:13 | PathExpr | variables.rs:85:15:85:16 | x5 | | -| variables.rs:85:5:85:17 | CallExpr | variables.rs:80:19:86:1 | BlockExpr | | -| variables.rs:85:5:85:18 | ExprStmt | variables.rs:85:5:85:13 | PathExpr | | -| variables.rs:85:15:85:16 | x5 | variables.rs:85:5:85:17 | CallExpr | | -| variables.rs:88:1:95:1 | enter let_pattern5 | variables.rs:89:5:89:42 | LetStmt | | -| variables.rs:88:1:95:1 | exit let_pattern5 (normal) | variables.rs:88:1:95:1 | exit let_pattern5 | | -| variables.rs:88:19:95:1 | BlockExpr | variables.rs:88:1:95:1 | exit let_pattern5 (normal) | | -| variables.rs:89:5:89:42 | LetStmt | variables.rs:89:14:89:17 | PathExpr | | -| variables.rs:89:9:89:10 | s1 | variables.rs:91:11:92:12 | LetExpr | match, no-match | -| variables.rs:89:14:89:17 | PathExpr | variables.rs:89:19:89:30 | PathExpr | | -| variables.rs:89:14:89:41 | CallExpr | variables.rs:89:9:89:10 | s1 | | -| variables.rs:89:19:89:30 | PathExpr | variables.rs:89:32:89:39 | "Hello!" | | -| variables.rs:89:19:89:40 | CallExpr | variables.rs:89:14:89:41 | CallExpr | | -| variables.rs:89:32:89:39 | "Hello!" | variables.rs:89:19:89:40 | CallExpr | | -| variables.rs:91:5:94:5 | WhileExpr | variables.rs:88:19:95:1 | BlockExpr | | -| variables.rs:91:11:92:12 | LetExpr | variables.rs:91:15:91:26 | TupleStructPat | | -| variables.rs:91:15:91:26 | TupleStructPat | variables.rs:91:5:94:5 | WhileExpr | no-match | -| variables.rs:91:15:91:26 | TupleStructPat | variables.rs:93:9:93:22 | ExprStmt | match | -| variables.rs:92:14:94:5 | BlockExpr | variables.rs:91:11:92:12 | LetExpr | | -| variables.rs:93:9:93:17 | PathExpr | variables.rs:93:19:93:20 | s2 | | -| variables.rs:93:9:93:21 | CallExpr | variables.rs:92:14:94:5 | BlockExpr | | -| variables.rs:93:9:93:22 | ExprStmt | variables.rs:93:9:93:17 | PathExpr | | -| variables.rs:93:19:93:20 | s2 | variables.rs:93:9:93:21 | CallExpr | | -| variables.rs:97:1:112:1 | enter match_pattern1 | variables.rs:98:5:98:21 | LetStmt | | -| variables.rs:97:1:112:1 | exit match_pattern1 (normal) | variables.rs:97:1:112:1 | exit match_pattern1 | | -| variables.rs:97:21:112:1 | BlockExpr | variables.rs:97:1:112:1 | exit match_pattern1 (normal) | | -| variables.rs:98:5:98:21 | LetStmt | variables.rs:98:14:98:17 | PathExpr | | -| variables.rs:98:9:98:10 | x6 | variables.rs:99:5:99:16 | LetStmt | match, no-match | -| variables.rs:98:14:98:17 | PathExpr | variables.rs:98:19:98:19 | 5 | | -| variables.rs:98:14:98:20 | CallExpr | variables.rs:98:9:98:10 | x6 | | -| variables.rs:98:19:98:19 | 5 | variables.rs:98:14:98:20 | CallExpr | | -| variables.rs:99:5:99:16 | LetStmt | variables.rs:99:14:99:15 | 10 | | -| variables.rs:99:9:99:10 | y1 | variables.rs:101:5:109:5 | ExprStmt | match, no-match | -| variables.rs:99:14:99:15 | 10 | variables.rs:99:9:99:10 | y1 | | -| variables.rs:101:5:109:5 | ExprStmt | variables.rs:101:11:101:12 | x6 | | -| variables.rs:101:5:109:5 | MatchExpr | variables.rs:111:5:111:18 | ExprStmt | | -| variables.rs:101:11:101:12 | x6 | variables.rs:102:9:102:16 | TupleStructPat | | -| variables.rs:102:9:102:16 | TupleStructPat | variables.rs:102:21:102:29 | PathExpr | match | -| variables.rs:102:9:102:16 | TupleStructPat | variables.rs:103:9:103:16 | TupleStructPat | no-match | -| variables.rs:102:21:102:29 | PathExpr | variables.rs:102:31:102:38 | "Got 50" | | -| variables.rs:102:21:102:39 | CallExpr | variables.rs:101:5:109:5 | MatchExpr | | -| variables.rs:102:31:102:38 | "Got 50" | variables.rs:102:21:102:39 | CallExpr | | -| variables.rs:103:9:103:16 | TupleStructPat | variables.rs:106:13:106:21 | PathExpr | match | -| variables.rs:103:9:103:16 | TupleStructPat | variables.rs:108:9:108:12 | None | no-match | -| variables.rs:105:9:107:9 | BlockExpr | variables.rs:101:5:109:5 | MatchExpr | | -| variables.rs:106:13:106:21 | PathExpr | variables.rs:106:23:106:24 | y1 | | -| variables.rs:106:13:106:25 | CallExpr | variables.rs:105:9:107:9 | BlockExpr | | -| variables.rs:106:23:106:24 | y1 | variables.rs:106:13:106:25 | CallExpr | | -| variables.rs:108:9:108:12 | None | variables.rs:108:17:108:25 | PathExpr | match | -| variables.rs:108:17:108:25 | PathExpr | variables.rs:108:27:108:32 | "NONE" | | -| variables.rs:108:17:108:33 | CallExpr | variables.rs:101:5:109:5 | MatchExpr | | -| variables.rs:108:27:108:32 | "NONE" | variables.rs:108:17:108:33 | CallExpr | | -| variables.rs:111:5:111:13 | PathExpr | variables.rs:111:15:111:16 | y1 | | -| variables.rs:111:5:111:17 | CallExpr | variables.rs:97:21:112:1 | BlockExpr | | -| variables.rs:111:5:111:18 | ExprStmt | variables.rs:111:5:111:13 | PathExpr | | -| variables.rs:111:15:111:16 | y1 | variables.rs:111:5:111:17 | CallExpr | | -| variables.rs:114:1:139:1 | enter match_pattern2 | variables.rs:115:5:115:36 | LetStmt | | -| variables.rs:114:1:139:1 | exit match_pattern2 (normal) | variables.rs:114:1:139:1 | exit match_pattern2 | | -| variables.rs:114:21:139:1 | BlockExpr | variables.rs:114:1:139:1 | exit match_pattern2 (normal) | | -| variables.rs:115:5:115:36 | LetStmt | variables.rs:115:20:115:20 | 2 | | -| variables.rs:115:9:115:15 | numbers | variables.rs:117:5:127:5 | ExprStmt | match, no-match | -| variables.rs:115:19:115:35 | TupleExpr | variables.rs:115:9:115:15 | numbers | | -| variables.rs:115:20:115:20 | 2 | variables.rs:115:23:115:23 | 4 | | -| variables.rs:115:23:115:23 | 4 | variables.rs:115:26:115:26 | 8 | | -| variables.rs:115:26:115:26 | 8 | variables.rs:115:29:115:30 | 16 | | -| variables.rs:115:29:115:30 | 16 | variables.rs:115:33:115:34 | 32 | | -| variables.rs:115:33:115:34 | 32 | variables.rs:115:19:115:35 | TupleExpr | | -| variables.rs:117:5:127:5 | ExprStmt | variables.rs:117:11:117:17 | numbers | | -| variables.rs:117:5:127:5 | MatchExpr | variables.rs:129:11:129:17 | numbers | | -| variables.rs:117:11:117:17 | numbers | variables.rs:118:9:122:9 | TuplePat | | -| variables.rs:118:9:122:9 | TuplePat | variables.rs:123:13:123:29 | ExprStmt | match | -| variables.rs:122:14:126:9 | BlockExpr | variables.rs:117:5:127:5 | MatchExpr | | -| variables.rs:123:13:123:21 | PathExpr | variables.rs:123:23:123:27 | first | | -| variables.rs:123:13:123:28 | CallExpr | variables.rs:124:13:124:29 | ExprStmt | | -| variables.rs:123:13:123:29 | ExprStmt | variables.rs:123:13:123:21 | PathExpr | | -| variables.rs:123:23:123:27 | first | variables.rs:123:13:123:28 | CallExpr | | -| variables.rs:124:13:124:21 | PathExpr | variables.rs:124:23:124:27 | third | | -| variables.rs:124:13:124:28 | CallExpr | variables.rs:125:13:125:29 | ExprStmt | | -| variables.rs:124:13:124:29 | ExprStmt | variables.rs:124:13:124:21 | PathExpr | | -| variables.rs:124:23:124:27 | third | variables.rs:124:13:124:28 | CallExpr | | -| variables.rs:125:13:125:21 | PathExpr | variables.rs:125:23:125:27 | fifth | | -| variables.rs:125:13:125:28 | CallExpr | variables.rs:122:14:126:9 | BlockExpr | | +| variables.rs:19:5:19:6 | x2 | variables.rs:19:10:19:10 | 5 | | +| variables.rs:19:5:19:10 | ... = ... | variables.rs:20:5:20:18 | ExprStmt | | +| variables.rs:19:5:19:11 | ExprStmt | variables.rs:19:5:19:6 | x2 | | +| variables.rs:19:10:19:10 | 5 | variables.rs:19:5:19:10 | ... = ... | | +| variables.rs:20:5:20:13 | PathExpr | variables.rs:20:15:20:16 | x2 | | +| variables.rs:20:5:20:17 | CallExpr | variables.rs:16:23:21:1 | BlockExpr | | +| variables.rs:20:5:20:18 | ExprStmt | variables.rs:20:5:20:13 | PathExpr | | +| variables.rs:20:15:20:16 | x2 | variables.rs:20:5:20:17 | CallExpr | | +| variables.rs:23:1:29:1 | enter variable_shadow1 | variables.rs:24:5:24:15 | LetStmt | | +| variables.rs:23:1:29:1 | exit variable_shadow1 (normal) | variables.rs:23:1:29:1 | exit variable_shadow1 | | +| variables.rs:23:23:29:1 | BlockExpr | variables.rs:23:1:29:1 | exit variable_shadow1 (normal) | | +| variables.rs:24:5:24:15 | LetStmt | variables.rs:24:14:24:14 | 1 | | +| variables.rs:24:9:24:10 | x3 | variables.rs:25:5:25:18 | ExprStmt | match, no-match | +| variables.rs:24:14:24:14 | 1 | variables.rs:24:9:24:10 | x3 | | +| variables.rs:25:5:25:13 | PathExpr | variables.rs:25:15:25:16 | x3 | | +| variables.rs:25:5:25:17 | CallExpr | variables.rs:26:5:27:15 | LetStmt | | +| variables.rs:25:5:25:18 | ExprStmt | variables.rs:25:5:25:13 | PathExpr | | +| variables.rs:25:15:25:16 | x3 | variables.rs:25:5:25:17 | CallExpr | | +| variables.rs:26:5:27:15 | LetStmt | variables.rs:27:9:27:10 | x3 | | +| variables.rs:26:9:26:10 | x3 | variables.rs:28:5:28:18 | ExprStmt | match, no-match | +| variables.rs:27:9:27:10 | x3 | variables.rs:27:14:27:14 | 1 | | +| variables.rs:27:9:27:14 | ... + ... | variables.rs:26:9:26:10 | x3 | | +| variables.rs:27:14:27:14 | 1 | variables.rs:27:9:27:14 | ... + ... | | +| variables.rs:28:5:28:13 | PathExpr | variables.rs:28:15:28:16 | x3 | | +| variables.rs:28:5:28:17 | CallExpr | variables.rs:23:23:29:1 | BlockExpr | | +| variables.rs:28:5:28:18 | ExprStmt | variables.rs:28:5:28:13 | PathExpr | | +| variables.rs:28:15:28:16 | x3 | variables.rs:28:5:28:17 | CallExpr | | +| variables.rs:31:1:39:1 | enter variable_shadow2 | variables.rs:32:5:32:17 | LetStmt | | +| variables.rs:31:1:39:1 | exit variable_shadow2 (normal) | variables.rs:31:1:39:1 | exit variable_shadow2 | | +| variables.rs:31:23:39:1 | BlockExpr | variables.rs:31:1:39:1 | exit variable_shadow2 (normal) | | +| variables.rs:32:5:32:17 | LetStmt | variables.rs:32:14:32:16 | "a" | | +| variables.rs:32:9:32:10 | x4 | variables.rs:33:5:33:18 | ExprStmt | match, no-match | +| variables.rs:32:14:32:16 | "a" | variables.rs:32:9:32:10 | x4 | | +| variables.rs:33:5:33:13 | PathExpr | variables.rs:33:15:33:16 | x4 | | +| variables.rs:33:5:33:17 | CallExpr | variables.rs:34:5:37:5 | ExprStmt | | +| variables.rs:33:5:33:18 | ExprStmt | variables.rs:33:5:33:13 | PathExpr | | +| variables.rs:33:15:33:16 | x4 | variables.rs:33:5:33:17 | CallExpr | | +| variables.rs:34:5:37:5 | BlockExpr | variables.rs:38:5:38:18 | ExprStmt | | +| variables.rs:34:5:37:5 | ExprStmt | variables.rs:35:9:35:21 | LetStmt | | +| variables.rs:35:9:35:21 | LetStmt | variables.rs:35:18:35:20 | "b" | | +| variables.rs:35:13:35:14 | x4 | variables.rs:36:9:36:22 | ExprStmt | match, no-match | +| variables.rs:35:18:35:20 | "b" | variables.rs:35:13:35:14 | x4 | | +| variables.rs:36:9:36:17 | PathExpr | variables.rs:36:19:36:20 | x4 | | +| variables.rs:36:9:36:21 | CallExpr | variables.rs:34:5:37:5 | BlockExpr | | +| variables.rs:36:9:36:22 | ExprStmt | variables.rs:36:9:36:17 | PathExpr | | +| variables.rs:36:19:36:20 | x4 | variables.rs:36:9:36:21 | CallExpr | | +| variables.rs:38:5:38:13 | PathExpr | variables.rs:38:15:38:16 | x4 | | +| variables.rs:38:5:38:17 | CallExpr | variables.rs:31:23:39:1 | BlockExpr | | +| variables.rs:38:5:38:18 | ExprStmt | variables.rs:38:5:38:13 | PathExpr | | +| variables.rs:38:15:38:16 | x4 | variables.rs:38:5:38:17 | CallExpr | | +| variables.rs:46:1:61:1 | enter let_pattern1 | variables.rs:47:5:56:47 | LetStmt | | +| variables.rs:46:1:61:1 | exit let_pattern1 (normal) | variables.rs:46:1:61:1 | exit let_pattern1 | | +| variables.rs:46:19:61:1 | BlockExpr | variables.rs:46:1:61:1 | exit let_pattern1 (normal) | | +| variables.rs:47:5:56:47 | LetStmt | variables.rs:56:11:56:13 | "a" | | +| variables.rs:47:9:56:5 | TuplePat | variables.rs:57:5:57:18 | ExprStmt | match | +| variables.rs:56:9:56:46 | TupleExpr | variables.rs:47:9:56:5 | TuplePat | | +| variables.rs:56:10:56:19 | TupleExpr | variables.rs:56:33:56:35 | "x" | | +| variables.rs:56:11:56:13 | "a" | variables.rs:56:16:56:18 | "b" | | +| variables.rs:56:16:56:18 | "b" | variables.rs:56:10:56:19 | TupleExpr | | +| variables.rs:56:22:56:45 | RecordExpr | variables.rs:56:9:56:46 | TupleExpr | | +| variables.rs:56:33:56:35 | "x" | variables.rs:56:41:56:43 | "y" | | +| variables.rs:56:41:56:43 | "y" | variables.rs:56:22:56:45 | RecordExpr | | +| variables.rs:57:5:57:13 | PathExpr | variables.rs:57:15:57:16 | a1 | | +| variables.rs:57:5:57:17 | CallExpr | variables.rs:58:5:58:18 | ExprStmt | | +| variables.rs:57:5:57:18 | ExprStmt | variables.rs:57:5:57:13 | PathExpr | | +| variables.rs:57:15:57:16 | a1 | variables.rs:57:5:57:17 | CallExpr | | +| variables.rs:58:5:58:13 | PathExpr | variables.rs:58:15:58:16 | b1 | | +| variables.rs:58:5:58:17 | CallExpr | variables.rs:59:5:59:17 | ExprStmt | | +| variables.rs:58:5:58:18 | ExprStmt | variables.rs:58:5:58:13 | PathExpr | | +| variables.rs:58:15:58:16 | b1 | variables.rs:58:5:58:17 | CallExpr | | +| variables.rs:59:5:59:13 | PathExpr | variables.rs:59:15:59:15 | x | | +| variables.rs:59:5:59:16 | CallExpr | variables.rs:60:5:60:17 | ExprStmt | | +| variables.rs:59:5:59:17 | ExprStmt | variables.rs:59:5:59:13 | PathExpr | | +| variables.rs:59:15:59:15 | x | variables.rs:59:5:59:16 | CallExpr | | +| variables.rs:60:5:60:13 | PathExpr | variables.rs:60:15:60:15 | y | | +| variables.rs:60:5:60:16 | CallExpr | variables.rs:46:19:61:1 | BlockExpr | | +| variables.rs:60:5:60:17 | ExprStmt | variables.rs:60:5:60:13 | PathExpr | | +| variables.rs:60:15:60:15 | y | variables.rs:60:5:60:16 | CallExpr | | +| variables.rs:63:1:71:1 | enter let_pattern2 | variables.rs:64:5:64:38 | LetStmt | | +| variables.rs:63:1:71:1 | exit let_pattern2 (normal) | variables.rs:63:1:71:1 | exit let_pattern2 | | +| variables.rs:63:19:71:1 | BlockExpr | variables.rs:63:1:71:1 | exit let_pattern2 (normal) | | +| variables.rs:64:5:64:38 | LetStmt | variables.rs:64:25:64:27 | "a" | | +| variables.rs:64:9:64:10 | p1 | variables.rs:65:5:68:11 | LetStmt | match, no-match | +| variables.rs:64:14:64:37 | RecordExpr | variables.rs:64:9:64:10 | p1 | | +| variables.rs:64:25:64:27 | "a" | variables.rs:64:33:64:35 | "b" | | +| variables.rs:64:33:64:35 | "b" | variables.rs:64:14:64:37 | RecordExpr | | +| variables.rs:65:5:68:11 | LetStmt | variables.rs:68:9:68:10 | p1 | | +| variables.rs:65:9:68:5 | RecordPat | variables.rs:69:5:69:18 | ExprStmt | match | +| variables.rs:68:9:68:10 | p1 | variables.rs:65:9:68:5 | RecordPat | | +| variables.rs:69:5:69:13 | PathExpr | variables.rs:69:15:69:16 | a2 | | +| variables.rs:69:5:69:17 | CallExpr | variables.rs:70:5:70:18 | ExprStmt | | +| variables.rs:69:5:69:18 | ExprStmt | variables.rs:69:5:69:13 | PathExpr | | +| variables.rs:69:15:69:16 | a2 | variables.rs:69:5:69:17 | CallExpr | | +| variables.rs:70:5:70:13 | PathExpr | variables.rs:70:15:70:16 | b2 | | +| variables.rs:70:5:70:17 | CallExpr | variables.rs:63:19:71:1 | BlockExpr | | +| variables.rs:70:5:70:18 | ExprStmt | variables.rs:70:5:70:13 | PathExpr | | +| variables.rs:70:15:70:16 | b2 | variables.rs:70:5:70:17 | CallExpr | | +| variables.rs:73:1:80:1 | enter let_pattern3 | variables.rs:74:5:74:42 | LetStmt | | +| variables.rs:73:1:80:1 | exit let_pattern3 (normal) | variables.rs:73:1:80:1 | exit let_pattern3 | | +| variables.rs:73:19:80:1 | BlockExpr | variables.rs:73:1:80:1 | exit let_pattern3 (normal) | | +| variables.rs:74:5:74:42 | LetStmt | variables.rs:74:14:74:17 | PathExpr | | +| variables.rs:74:9:74:10 | s1 | variables.rs:76:8:77:12 | LetExpr | match, no-match | +| variables.rs:74:14:74:17 | PathExpr | variables.rs:74:19:74:30 | PathExpr | | +| variables.rs:74:14:74:41 | CallExpr | variables.rs:74:9:74:10 | s1 | | +| variables.rs:74:19:74:30 | PathExpr | variables.rs:74:32:74:39 | "Hello!" | | +| variables.rs:74:19:74:40 | CallExpr | variables.rs:74:14:74:41 | CallExpr | | +| variables.rs:74:32:74:39 | "Hello!" | variables.rs:74:19:74:40 | CallExpr | | +| variables.rs:76:5:79:5 | IfExpr | variables.rs:73:19:80:1 | BlockExpr | | +| variables.rs:76:8:77:12 | LetExpr | variables.rs:76:12:76:23 | TupleStructPat | | +| variables.rs:76:12:76:23 | TupleStructPat | variables.rs:76:5:79:5 | IfExpr | no-match | +| variables.rs:76:12:76:23 | TupleStructPat | variables.rs:78:9:78:22 | ExprStmt | match | +| variables.rs:77:14:79:5 | BlockExpr | variables.rs:76:5:79:5 | IfExpr | | +| variables.rs:78:9:78:17 | PathExpr | variables.rs:78:19:78:20 | s2 | | +| variables.rs:78:9:78:21 | CallExpr | variables.rs:77:14:79:5 | BlockExpr | | +| variables.rs:78:9:78:22 | ExprStmt | variables.rs:78:9:78:17 | PathExpr | | +| variables.rs:78:19:78:20 | s2 | variables.rs:78:9:78:21 | CallExpr | | +| variables.rs:82:1:88:1 | enter let_pattern4 | variables.rs:83:5:86:10 | LetStmt | | +| variables.rs:82:1:88:1 | exit let_pattern4 (normal) | variables.rs:82:1:88:1 | exit let_pattern4 | | +| variables.rs:82:19:88:1 | BlockExpr | variables.rs:82:1:88:1 | exit let_pattern4 (normal) | | +| variables.rs:83:5:86:10 | LetStmt | variables.rs:83:34:83:37 | PathExpr | | +| variables.rs:83:9:83:16 | TupleStructPat | variables.rs:85:13:85:19 | MacroExpr | no-match | +| variables.rs:83:9:83:16 | TupleStructPat | variables.rs:87:5:87:18 | ExprStmt | match | +| variables.rs:83:34:83:37 | PathExpr | variables.rs:83:39:83:42 | "x5" | | +| variables.rs:83:34:83:43 | CallExpr | variables.rs:83:9:83:16 | TupleStructPat | | +| variables.rs:83:39:83:42 | "x5" | variables.rs:83:34:83:43 | CallExpr | | +| variables.rs:85:13:85:19 | MacroExpr | variables.rs:84:14:86:9 | BlockExpr | | +| variables.rs:87:5:87:13 | PathExpr | variables.rs:87:15:87:16 | x5 | | +| variables.rs:87:5:87:17 | CallExpr | variables.rs:82:19:88:1 | BlockExpr | | +| variables.rs:87:5:87:18 | ExprStmt | variables.rs:87:5:87:13 | PathExpr | | +| variables.rs:87:15:87:16 | x5 | variables.rs:87:5:87:17 | CallExpr | | +| variables.rs:90:1:97:1 | enter let_pattern5 | variables.rs:91:5:91:42 | LetStmt | | +| variables.rs:90:1:97:1 | exit let_pattern5 (normal) | variables.rs:90:1:97:1 | exit let_pattern5 | | +| variables.rs:90:19:97:1 | BlockExpr | variables.rs:90:1:97:1 | exit let_pattern5 (normal) | | +| variables.rs:91:5:91:42 | LetStmt | variables.rs:91:14:91:17 | PathExpr | | +| variables.rs:91:9:91:10 | s1 | variables.rs:93:11:94:12 | LetExpr | match, no-match | +| variables.rs:91:14:91:17 | PathExpr | variables.rs:91:19:91:30 | PathExpr | | +| variables.rs:91:14:91:41 | CallExpr | variables.rs:91:9:91:10 | s1 | | +| variables.rs:91:19:91:30 | PathExpr | variables.rs:91:32:91:39 | "Hello!" | | +| variables.rs:91:19:91:40 | CallExpr | variables.rs:91:14:91:41 | CallExpr | | +| variables.rs:91:32:91:39 | "Hello!" | variables.rs:91:19:91:40 | CallExpr | | +| variables.rs:93:5:96:5 | WhileExpr | variables.rs:90:19:97:1 | BlockExpr | | +| variables.rs:93:11:94:12 | LetExpr | variables.rs:93:15:93:26 | TupleStructPat | | +| variables.rs:93:15:93:26 | TupleStructPat | variables.rs:93:5:96:5 | WhileExpr | no-match | +| variables.rs:93:15:93:26 | TupleStructPat | variables.rs:95:9:95:22 | ExprStmt | match | +| variables.rs:94:14:96:5 | BlockExpr | variables.rs:93:11:94:12 | LetExpr | | +| variables.rs:95:9:95:17 | PathExpr | variables.rs:95:19:95:20 | s2 | | +| variables.rs:95:9:95:21 | CallExpr | variables.rs:94:14:96:5 | BlockExpr | | +| variables.rs:95:9:95:22 | ExprStmt | variables.rs:95:9:95:17 | PathExpr | | +| variables.rs:95:19:95:20 | s2 | variables.rs:95:9:95:21 | CallExpr | | +| variables.rs:99:1:114:1 | enter match_pattern1 | variables.rs:100:5:100:21 | LetStmt | | +| variables.rs:99:1:114:1 | exit match_pattern1 (normal) | variables.rs:99:1:114:1 | exit match_pattern1 | | +| variables.rs:99:21:114:1 | BlockExpr | variables.rs:99:1:114:1 | exit match_pattern1 (normal) | | +| variables.rs:100:5:100:21 | LetStmt | variables.rs:100:14:100:17 | PathExpr | | +| variables.rs:100:9:100:10 | x6 | variables.rs:101:5:101:16 | LetStmt | match, no-match | +| variables.rs:100:14:100:17 | PathExpr | variables.rs:100:19:100:19 | 5 | | +| variables.rs:100:14:100:20 | CallExpr | variables.rs:100:9:100:10 | x6 | | +| variables.rs:100:19:100:19 | 5 | variables.rs:100:14:100:20 | CallExpr | | +| variables.rs:101:5:101:16 | LetStmt | variables.rs:101:14:101:15 | 10 | | +| variables.rs:101:9:101:10 | y1 | variables.rs:103:5:111:5 | ExprStmt | match, no-match | +| variables.rs:101:14:101:15 | 10 | variables.rs:101:9:101:10 | y1 | | +| variables.rs:103:5:111:5 | ExprStmt | variables.rs:103:11:103:12 | x6 | | +| variables.rs:103:5:111:5 | MatchExpr | variables.rs:113:5:113:18 | ExprStmt | | +| variables.rs:103:11:103:12 | x6 | variables.rs:104:9:104:16 | TupleStructPat | | +| variables.rs:104:9:104:16 | TupleStructPat | variables.rs:104:21:104:29 | PathExpr | match | +| variables.rs:104:9:104:16 | TupleStructPat | variables.rs:105:9:105:16 | TupleStructPat | no-match | +| variables.rs:104:21:104:29 | PathExpr | variables.rs:104:31:104:38 | "Got 50" | | +| variables.rs:104:21:104:39 | CallExpr | variables.rs:103:5:111:5 | MatchExpr | | +| variables.rs:104:31:104:38 | "Got 50" | variables.rs:104:21:104:39 | CallExpr | | +| variables.rs:105:9:105:16 | TupleStructPat | variables.rs:108:13:108:21 | PathExpr | match | +| variables.rs:105:9:105:16 | TupleStructPat | variables.rs:110:9:110:12 | None | no-match | +| variables.rs:107:9:109:9 | BlockExpr | variables.rs:103:5:111:5 | MatchExpr | | +| variables.rs:108:13:108:21 | PathExpr | variables.rs:108:23:108:24 | y1 | | +| variables.rs:108:13:108:25 | CallExpr | variables.rs:107:9:109:9 | BlockExpr | | +| variables.rs:108:23:108:24 | y1 | variables.rs:108:13:108:25 | CallExpr | | +| variables.rs:110:9:110:12 | None | variables.rs:110:17:110:25 | PathExpr | match | +| variables.rs:110:17:110:25 | PathExpr | variables.rs:110:27:110:32 | "NONE" | | +| variables.rs:110:17:110:33 | CallExpr | variables.rs:103:5:111:5 | MatchExpr | | +| variables.rs:110:27:110:32 | "NONE" | variables.rs:110:17:110:33 | CallExpr | | +| variables.rs:113:5:113:13 | PathExpr | variables.rs:113:15:113:16 | y1 | | +| variables.rs:113:5:113:17 | CallExpr | variables.rs:99:21:114:1 | BlockExpr | | +| variables.rs:113:5:113:18 | ExprStmt | variables.rs:113:5:113:13 | PathExpr | | +| variables.rs:113:15:113:16 | y1 | variables.rs:113:5:113:17 | CallExpr | | +| variables.rs:116:1:141:1 | enter match_pattern2 | variables.rs:117:5:117:36 | LetStmt | | +| variables.rs:116:1:141:1 | exit match_pattern2 (normal) | variables.rs:116:1:141:1 | exit match_pattern2 | | +| variables.rs:116:21:141:1 | BlockExpr | variables.rs:116:1:141:1 | exit match_pattern2 (normal) | | +| variables.rs:117:5:117:36 | LetStmt | variables.rs:117:20:117:20 | 2 | | +| variables.rs:117:9:117:15 | numbers | variables.rs:119:5:129:5 | ExprStmt | match, no-match | +| variables.rs:117:19:117:35 | TupleExpr | variables.rs:117:9:117:15 | numbers | | +| variables.rs:117:20:117:20 | 2 | variables.rs:117:23:117:23 | 4 | | +| variables.rs:117:23:117:23 | 4 | variables.rs:117:26:117:26 | 8 | | +| variables.rs:117:26:117:26 | 8 | variables.rs:117:29:117:30 | 16 | | +| variables.rs:117:29:117:30 | 16 | variables.rs:117:33:117:34 | 32 | | +| variables.rs:117:33:117:34 | 32 | variables.rs:117:19:117:35 | TupleExpr | | +| variables.rs:119:5:129:5 | ExprStmt | variables.rs:119:11:119:17 | numbers | | +| variables.rs:119:5:129:5 | MatchExpr | variables.rs:131:11:131:17 | numbers | | +| variables.rs:119:11:119:17 | numbers | variables.rs:120:9:124:9 | TuplePat | | +| variables.rs:120:9:124:9 | TuplePat | variables.rs:125:13:125:29 | ExprStmt | match | +| variables.rs:124:14:128:9 | BlockExpr | variables.rs:119:5:129:5 | MatchExpr | | +| variables.rs:125:13:125:21 | PathExpr | variables.rs:125:23:125:27 | first | | +| variables.rs:125:13:125:28 | CallExpr | variables.rs:126:13:126:29 | ExprStmt | | | variables.rs:125:13:125:29 | ExprStmt | variables.rs:125:13:125:21 | PathExpr | | -| variables.rs:125:23:125:27 | fifth | variables.rs:125:13:125:28 | CallExpr | | -| variables.rs:129:5:138:5 | MatchExpr | variables.rs:114:21:139:1 | BlockExpr | | -| variables.rs:129:11:129:17 | numbers | variables.rs:130:9:134:9 | TuplePat | | -| variables.rs:130:9:134:9 | TuplePat | variables.rs:135:13:135:29 | ExprStmt | match | -| variables.rs:134:14:137:9 | BlockExpr | variables.rs:129:5:138:5 | MatchExpr | | -| variables.rs:135:13:135:21 | PathExpr | variables.rs:135:23:135:27 | first | | -| variables.rs:135:13:135:28 | CallExpr | variables.rs:136:13:136:28 | ExprStmt | | -| variables.rs:135:13:135:29 | ExprStmt | variables.rs:135:13:135:21 | PathExpr | | -| variables.rs:135:23:135:27 | first | variables.rs:135:13:135:28 | CallExpr | | -| variables.rs:136:13:136:21 | PathExpr | variables.rs:136:23:136:26 | last | | -| variables.rs:136:13:136:27 | CallExpr | variables.rs:134:14:137:9 | BlockExpr | | -| variables.rs:136:13:136:28 | ExprStmt | variables.rs:136:13:136:21 | PathExpr | | -| variables.rs:136:23:136:26 | last | variables.rs:136:13:136:27 | CallExpr | | -| variables.rs:141:1:149:1 | enter match_pattern3 | variables.rs:142:5:142:38 | LetStmt | | -| variables.rs:141:1:149:1 | exit match_pattern3 (normal) | variables.rs:141:1:149:1 | exit match_pattern3 | | -| variables.rs:141:21:149:1 | BlockExpr | variables.rs:141:1:149:1 | exit match_pattern3 (normal) | | -| variables.rs:142:5:142:38 | LetStmt | variables.rs:142:25:142:27 | "x" | | -| variables.rs:142:9:142:10 | p2 | variables.rs:144:11:144:12 | p2 | match, no-match | -| variables.rs:142:14:142:37 | RecordExpr | variables.rs:142:9:142:10 | p2 | | -| variables.rs:142:25:142:27 | "x" | variables.rs:142:33:142:35 | "y" | | -| variables.rs:142:33:142:35 | "y" | variables.rs:142:14:142:37 | RecordExpr | | -| variables.rs:144:5:148:5 | MatchExpr | variables.rs:141:21:149:1 | BlockExpr | | -| variables.rs:144:11:144:12 | p2 | variables.rs:145:9:147:9 | RecordPat | | -| variables.rs:145:9:147:9 | RecordPat | variables.rs:147:14:147:22 | PathExpr | match | -| variables.rs:147:14:147:22 | PathExpr | variables.rs:147:24:147:25 | x7 | | -| variables.rs:147:14:147:26 | CallExpr | variables.rs:144:5:148:5 | MatchExpr | | -| variables.rs:147:24:147:25 | x7 | variables.rs:147:14:147:26 | CallExpr | | -| variables.rs:155:1:168:1 | enter match_pattern4 | variables.rs:156:5:156:39 | LetStmt | | -| variables.rs:155:1:168:1 | exit match_pattern4 (normal) | variables.rs:155:1:168:1 | exit match_pattern4 | | -| variables.rs:155:21:168:1 | BlockExpr | variables.rs:155:1:168:1 | exit match_pattern4 (normal) | | -| variables.rs:156:5:156:39 | LetStmt | variables.rs:156:36:156:36 | 0 | | -| variables.rs:156:9:156:11 | msg | variables.rs:158:11:158:13 | msg | match, no-match | -| variables.rs:156:15:156:38 | RecordExpr | variables.rs:156:9:156:11 | msg | | -| variables.rs:156:36:156:36 | 0 | variables.rs:156:15:156:38 | RecordExpr | | -| variables.rs:158:5:167:5 | MatchExpr | variables.rs:155:21:168:1 | BlockExpr | | -| variables.rs:158:11:158:13 | msg | variables.rs:159:9:161:9 | RecordPat | | -| variables.rs:159:9:161:9 | RecordPat | variables.rs:161:14:161:22 | PathExpr | match | -| variables.rs:159:9:161:9 | RecordPat | variables.rs:162:9:162:38 | RecordPat | no-match | -| variables.rs:161:14:161:22 | PathExpr | variables.rs:161:24:161:34 | id_variable | | -| variables.rs:161:14:161:35 | CallExpr | variables.rs:158:5:167:5 | MatchExpr | | -| variables.rs:161:24:161:34 | id_variable | variables.rs:161:14:161:35 | CallExpr | | -| variables.rs:162:9:162:38 | RecordPat | variables.rs:163:13:163:52 | MacroExpr | match | -| variables.rs:162:9:162:38 | RecordPat | variables.rs:165:9:165:29 | RecordPat | no-match | -| variables.rs:162:43:164:9 | BlockExpr | variables.rs:158:5:167:5 | MatchExpr | | -| variables.rs:163:13:163:52 | MacroExpr | variables.rs:162:43:164:9 | BlockExpr | | -| variables.rs:165:9:165:29 | RecordPat | variables.rs:166:13:166:21 | PathExpr | match | -| variables.rs:166:13:166:21 | PathExpr | variables.rs:166:23:166:24 | id | | -| variables.rs:166:13:166:25 | CallExpr | variables.rs:158:5:167:5 | MatchExpr | | -| variables.rs:166:23:166:24 | id | variables.rs:166:13:166:25 | CallExpr | | -| variables.rs:175:1:181:1 | enter match_pattern5 | variables.rs:176:5:176:34 | LetStmt | | -| variables.rs:175:1:181:1 | exit match_pattern5 (normal) | variables.rs:175:1:181:1 | exit match_pattern5 | | -| variables.rs:175:21:181:1 | BlockExpr | variables.rs:175:1:181:1 | exit match_pattern5 (normal) | | -| variables.rs:176:5:176:34 | LetStmt | variables.rs:176:18:176:29 | PathExpr | | -| variables.rs:176:9:176:14 | either | variables.rs:177:11:177:16 | either | match, no-match | -| variables.rs:176:18:176:29 | PathExpr | variables.rs:176:31:176:32 | 32 | | -| variables.rs:176:18:176:33 | CallExpr | variables.rs:176:9:176:14 | either | | -| variables.rs:176:31:176:32 | 32 | variables.rs:176:18:176:33 | CallExpr | | -| variables.rs:177:5:180:5 | MatchExpr | variables.rs:175:21:181:1 | BlockExpr | | -| variables.rs:177:11:177:16 | either | variables.rs:178:9:178:44 | OrPat | | -| variables.rs:178:9:178:44 | OrPat | variables.rs:179:16:179:24 | PathExpr | match | -| variables.rs:179:16:179:24 | PathExpr | variables.rs:179:26:179:27 | a3 | | -| variables.rs:179:16:179:28 | CallExpr | variables.rs:177:5:180:5 | MatchExpr | | -| variables.rs:179:26:179:27 | a3 | variables.rs:179:16:179:28 | CallExpr | | -| variables.rs:189:1:203:1 | enter match_pattern6 | variables.rs:190:5:190:37 | LetStmt | | -| variables.rs:189:1:203:1 | exit match_pattern6 (normal) | variables.rs:189:1:203:1 | exit match_pattern6 | | -| variables.rs:189:21:203:1 | BlockExpr | variables.rs:189:1:203:1 | exit match_pattern6 (normal) | | -| variables.rs:190:5:190:37 | LetStmt | variables.rs:190:14:190:32 | PathExpr | | -| variables.rs:190:9:190:10 | tv | variables.rs:191:5:194:5 | ExprStmt | match, no-match | -| variables.rs:190:14:190:32 | PathExpr | variables.rs:190:34:190:35 | 62 | | -| variables.rs:190:14:190:36 | CallExpr | variables.rs:190:9:190:10 | tv | | -| variables.rs:190:34:190:35 | 62 | variables.rs:190:14:190:36 | CallExpr | | -| variables.rs:191:5:194:5 | ExprStmt | variables.rs:191:11:191:12 | tv | | -| variables.rs:191:5:194:5 | MatchExpr | variables.rs:195:5:198:5 | ExprStmt | | -| variables.rs:191:11:191:12 | tv | variables.rs:192:9:192:81 | OrPat | | -| variables.rs:192:9:192:81 | OrPat | variables.rs:193:16:193:24 | PathExpr | match | -| variables.rs:193:16:193:24 | PathExpr | variables.rs:193:26:193:27 | a4 | | -| variables.rs:193:16:193:28 | CallExpr | variables.rs:191:5:194:5 | MatchExpr | | -| variables.rs:193:26:193:27 | a4 | variables.rs:193:16:193:28 | CallExpr | | -| variables.rs:195:5:198:5 | ExprStmt | variables.rs:195:11:195:12 | tv | | -| variables.rs:195:5:198:5 | MatchExpr | variables.rs:199:11:199:12 | tv | | -| variables.rs:195:11:195:12 | tv | variables.rs:196:9:196:83 | OrPat | | -| variables.rs:196:9:196:83 | OrPat | variables.rs:197:16:197:24 | PathExpr | match | -| variables.rs:197:16:197:24 | PathExpr | variables.rs:197:26:197:27 | a5 | | -| variables.rs:197:16:197:28 | CallExpr | variables.rs:195:5:198:5 | MatchExpr | | -| variables.rs:197:26:197:27 | a5 | variables.rs:197:16:197:28 | CallExpr | | -| variables.rs:199:5:202:5 | MatchExpr | variables.rs:189:21:203:1 | BlockExpr | | -| variables.rs:199:11:199:12 | tv | variables.rs:200:9:200:83 | OrPat | | -| variables.rs:200:9:200:83 | OrPat | variables.rs:201:16:201:24 | PathExpr | match | -| variables.rs:201:16:201:24 | PathExpr | variables.rs:201:26:201:27 | a6 | | -| variables.rs:201:16:201:28 | CallExpr | variables.rs:199:5:202:5 | MatchExpr | | -| variables.rs:201:26:201:27 | a6 | variables.rs:201:16:201:28 | CallExpr | | -| variables.rs:205:1:213:1 | enter match_pattern7 | variables.rs:206:5:206:34 | LetStmt | | -| variables.rs:205:1:213:1 | exit match_pattern7 (normal) | variables.rs:205:1:213:1 | exit match_pattern7 | | -| variables.rs:205:21:213:1 | BlockExpr | variables.rs:205:1:213:1 | exit match_pattern7 (normal) | | -| variables.rs:206:5:206:34 | LetStmt | variables.rs:206:18:206:29 | PathExpr | | -| variables.rs:206:9:206:14 | either | variables.rs:207:11:207:16 | either | match, no-match | -| variables.rs:206:18:206:29 | PathExpr | variables.rs:206:31:206:32 | 32 | | -| variables.rs:206:18:206:33 | CallExpr | variables.rs:206:9:206:14 | either | | -| variables.rs:206:31:206:32 | 32 | variables.rs:206:18:206:33 | CallExpr | | -| variables.rs:207:5:212:5 | MatchExpr | variables.rs:205:21:213:1 | BlockExpr | | -| variables.rs:207:11:207:16 | either | variables.rs:208:9:208:44 | OrPat | | -| variables.rs:208:9:208:44 | OrPat | variables.rs:209:16:209:17 | a7 | match | -| variables.rs:208:9:208:44 | OrPat | variables.rs:211:9:211:9 | WildcardPat | no-match | -| variables.rs:209:16:209:17 | a7 | variables.rs:209:21:209:21 | 0 | | -| variables.rs:209:16:209:21 | ... > ... | variables.rs:210:16:210:24 | PathExpr | true | -| variables.rs:209:16:209:21 | ... > ... | variables.rs:211:9:211:9 | WildcardPat | false | -| variables.rs:209:21:209:21 | 0 | variables.rs:209:16:209:21 | ... > ... | | -| variables.rs:210:16:210:24 | PathExpr | variables.rs:210:26:210:27 | a7 | | -| variables.rs:210:16:210:28 | CallExpr | variables.rs:207:5:212:5 | MatchExpr | | -| variables.rs:210:26:210:27 | a7 | variables.rs:210:16:210:28 | CallExpr | | -| variables.rs:211:9:211:9 | WildcardPat | variables.rs:211:14:211:15 | TupleExpr | match | -| variables.rs:211:14:211:15 | TupleExpr | variables.rs:207:5:212:5 | MatchExpr | | -| variables.rs:215:1:230:1 | enter match_pattern8 | variables.rs:216:5:216:34 | LetStmt | | -| variables.rs:215:1:230:1 | exit match_pattern8 (normal) | variables.rs:215:1:230:1 | exit match_pattern8 | | -| variables.rs:215:21:230:1 | BlockExpr | variables.rs:215:1:230:1 | exit match_pattern8 (normal) | | -| variables.rs:216:5:216:34 | LetStmt | variables.rs:216:18:216:29 | PathExpr | | -| variables.rs:216:9:216:14 | either | variables.rs:218:11:218:16 | either | match, no-match | -| variables.rs:216:18:216:29 | PathExpr | variables.rs:216:31:216:32 | 32 | | -| variables.rs:216:18:216:33 | CallExpr | variables.rs:216:9:216:14 | either | | -| variables.rs:216:31:216:32 | 32 | variables.rs:216:18:216:33 | CallExpr | | -| variables.rs:218:5:229:5 | MatchExpr | variables.rs:215:21:230:1 | BlockExpr | | -| variables.rs:218:11:218:16 | either | variables.rs:219:9:220:52 | e | | -| variables.rs:219:9:220:52 | e | variables.rs:222:13:222:27 | ExprStmt | match | -| variables.rs:219:9:220:52 | e | variables.rs:228:9:228:9 | WildcardPat | no-match | -| variables.rs:221:12:227:9 | BlockExpr | variables.rs:218:5:229:5 | MatchExpr | | -| variables.rs:222:13:222:21 | PathExpr | variables.rs:222:23:222:25 | a11 | | -| variables.rs:222:13:222:26 | CallExpr | variables.rs:223:16:224:15 | LetExpr | | -| variables.rs:222:13:222:27 | ExprStmt | variables.rs:222:13:222:21 | PathExpr | | -| variables.rs:222:23:222:25 | a11 | variables.rs:222:13:222:26 | CallExpr | | -| variables.rs:223:13:226:13 | IfExpr | variables.rs:221:12:227:9 | BlockExpr | | -| variables.rs:223:16:224:15 | LetExpr | variables.rs:223:20:223:36 | TupleStructPat | | -| variables.rs:223:20:223:36 | TupleStructPat | variables.rs:223:13:226:13 | IfExpr | no-match | -| variables.rs:223:20:223:36 | TupleStructPat | variables.rs:225:17:225:32 | ExprStmt | match | -| variables.rs:224:17:226:13 | BlockExpr | variables.rs:223:13:226:13 | IfExpr | | -| variables.rs:225:17:225:25 | PathExpr | variables.rs:225:28:225:30 | a12 | | -| variables.rs:225:17:225:31 | CallExpr | variables.rs:224:17:226:13 | BlockExpr | | -| variables.rs:225:17:225:32 | ExprStmt | variables.rs:225:17:225:25 | PathExpr | | -| variables.rs:225:27:225:30 | * ... | variables.rs:225:17:225:31 | CallExpr | | -| variables.rs:225:28:225:30 | a12 | variables.rs:225:27:225:30 | * ... | | -| variables.rs:228:9:228:9 | WildcardPat | variables.rs:228:14:228:15 | TupleExpr | match | -| variables.rs:228:14:228:15 | TupleExpr | variables.rs:218:5:229:5 | MatchExpr | | -| variables.rs:239:1:245:1 | enter match_pattern9 | variables.rs:240:5:240:36 | LetStmt | | -| variables.rs:239:1:245:1 | exit match_pattern9 (normal) | variables.rs:239:1:245:1 | exit match_pattern9 | | -| variables.rs:239:21:245:1 | BlockExpr | variables.rs:239:1:245:1 | exit match_pattern9 (normal) | | -| variables.rs:240:5:240:36 | LetStmt | variables.rs:240:14:240:31 | PathExpr | | -| variables.rs:240:9:240:10 | fv | variables.rs:241:11:241:12 | fv | match, no-match | -| variables.rs:240:14:240:31 | PathExpr | variables.rs:240:33:240:34 | 62 | | -| variables.rs:240:14:240:35 | CallExpr | variables.rs:240:9:240:10 | fv | | -| variables.rs:240:33:240:34 | 62 | variables.rs:240:14:240:35 | CallExpr | | -| variables.rs:241:5:244:5 | MatchExpr | variables.rs:239:21:245:1 | BlockExpr | | -| variables.rs:241:11:241:12 | fv | variables.rs:242:9:242:109 | OrPat | | -| variables.rs:242:9:242:109 | OrPat | variables.rs:243:16:243:24 | PathExpr | match | -| variables.rs:243:16:243:24 | PathExpr | variables.rs:243:26:243:28 | a13 | | -| variables.rs:243:16:243:29 | CallExpr | variables.rs:241:5:244:5 | MatchExpr | | -| variables.rs:243:26:243:28 | a13 | variables.rs:243:16:243:29 | CallExpr | | -| variables.rs:247:1:256:1 | enter param_pattern1 | variables.rs:253:5:253:18 | ExprStmt | | -| variables.rs:247:1:256:1 | exit param_pattern1 (normal) | variables.rs:247:1:256:1 | exit param_pattern1 | | -| variables.rs:252:28:256:1 | BlockExpr | variables.rs:247:1:256:1 | exit param_pattern1 (normal) | | -| variables.rs:253:5:253:13 | PathExpr | variables.rs:253:15:253:16 | a8 | | -| variables.rs:253:5:253:17 | CallExpr | variables.rs:254:5:254:18 | ExprStmt | | -| variables.rs:253:5:253:18 | ExprStmt | variables.rs:253:5:253:13 | PathExpr | | -| variables.rs:253:15:253:16 | a8 | variables.rs:253:5:253:17 | CallExpr | | -| variables.rs:254:5:254:13 | PathExpr | variables.rs:254:15:254:16 | b3 | | -| variables.rs:254:5:254:17 | CallExpr | variables.rs:255:5:255:18 | ExprStmt | | -| variables.rs:254:5:254:18 | ExprStmt | variables.rs:254:5:254:13 | PathExpr | | -| variables.rs:254:15:254:16 | b3 | variables.rs:254:5:254:17 | CallExpr | | -| variables.rs:255:5:255:13 | PathExpr | variables.rs:255:15:255:16 | c1 | | -| variables.rs:255:5:255:17 | CallExpr | variables.rs:252:28:256:1 | BlockExpr | | +| variables.rs:125:23:125:27 | first | variables.rs:125:13:125:28 | CallExpr | | +| variables.rs:126:13:126:21 | PathExpr | variables.rs:126:23:126:27 | third | | +| variables.rs:126:13:126:28 | CallExpr | variables.rs:127:13:127:29 | ExprStmt | | +| variables.rs:126:13:126:29 | ExprStmt | variables.rs:126:13:126:21 | PathExpr | | +| variables.rs:126:23:126:27 | third | variables.rs:126:13:126:28 | CallExpr | | +| variables.rs:127:13:127:21 | PathExpr | variables.rs:127:23:127:27 | fifth | | +| variables.rs:127:13:127:28 | CallExpr | variables.rs:124:14:128:9 | BlockExpr | | +| variables.rs:127:13:127:29 | ExprStmt | variables.rs:127:13:127:21 | PathExpr | | +| variables.rs:127:23:127:27 | fifth | variables.rs:127:13:127:28 | CallExpr | | +| variables.rs:131:5:140:5 | MatchExpr | variables.rs:116:21:141:1 | BlockExpr | | +| variables.rs:131:11:131:17 | numbers | variables.rs:132:9:136:9 | TuplePat | | +| variables.rs:132:9:136:9 | TuplePat | variables.rs:137:13:137:29 | ExprStmt | match | +| variables.rs:136:14:139:9 | BlockExpr | variables.rs:131:5:140:5 | MatchExpr | | +| variables.rs:137:13:137:21 | PathExpr | variables.rs:137:23:137:27 | first | | +| variables.rs:137:13:137:28 | CallExpr | variables.rs:138:13:138:28 | ExprStmt | | +| variables.rs:137:13:137:29 | ExprStmt | variables.rs:137:13:137:21 | PathExpr | | +| variables.rs:137:23:137:27 | first | variables.rs:137:13:137:28 | CallExpr | | +| variables.rs:138:13:138:21 | PathExpr | variables.rs:138:23:138:26 | last | | +| variables.rs:138:13:138:27 | CallExpr | variables.rs:136:14:139:9 | BlockExpr | | +| variables.rs:138:13:138:28 | ExprStmt | variables.rs:138:13:138:21 | PathExpr | | +| variables.rs:138:23:138:26 | last | variables.rs:138:13:138:27 | CallExpr | | +| variables.rs:143:1:151:1 | enter match_pattern3 | variables.rs:144:5:144:38 | LetStmt | | +| variables.rs:143:1:151:1 | exit match_pattern3 (normal) | variables.rs:143:1:151:1 | exit match_pattern3 | | +| variables.rs:143:21:151:1 | BlockExpr | variables.rs:143:1:151:1 | exit match_pattern3 (normal) | | +| variables.rs:144:5:144:38 | LetStmt | variables.rs:144:25:144:27 | "x" | | +| variables.rs:144:9:144:10 | p2 | variables.rs:146:11:146:12 | p2 | match, no-match | +| variables.rs:144:14:144:37 | RecordExpr | variables.rs:144:9:144:10 | p2 | | +| variables.rs:144:25:144:27 | "x" | variables.rs:144:33:144:35 | "y" | | +| variables.rs:144:33:144:35 | "y" | variables.rs:144:14:144:37 | RecordExpr | | +| variables.rs:146:5:150:5 | MatchExpr | variables.rs:143:21:151:1 | BlockExpr | | +| variables.rs:146:11:146:12 | p2 | variables.rs:147:9:149:9 | RecordPat | | +| variables.rs:147:9:149:9 | RecordPat | variables.rs:149:14:149:22 | PathExpr | match | +| variables.rs:149:14:149:22 | PathExpr | variables.rs:149:24:149:25 | x7 | | +| variables.rs:149:14:149:26 | CallExpr | variables.rs:146:5:150:5 | MatchExpr | | +| variables.rs:149:24:149:25 | x7 | variables.rs:149:14:149:26 | CallExpr | | +| variables.rs:157:1:170:1 | enter match_pattern4 | variables.rs:158:5:158:39 | LetStmt | | +| variables.rs:157:1:170:1 | exit match_pattern4 (normal) | variables.rs:157:1:170:1 | exit match_pattern4 | | +| variables.rs:157:21:170:1 | BlockExpr | variables.rs:157:1:170:1 | exit match_pattern4 (normal) | | +| variables.rs:158:5:158:39 | LetStmt | variables.rs:158:36:158:36 | 0 | | +| variables.rs:158:9:158:11 | msg | variables.rs:160:11:160:13 | msg | match, no-match | +| variables.rs:158:15:158:38 | RecordExpr | variables.rs:158:9:158:11 | msg | | +| variables.rs:158:36:158:36 | 0 | variables.rs:158:15:158:38 | RecordExpr | | +| variables.rs:160:5:169:5 | MatchExpr | variables.rs:157:21:170:1 | BlockExpr | | +| variables.rs:160:11:160:13 | msg | variables.rs:161:9:163:9 | RecordPat | | +| variables.rs:161:9:163:9 | RecordPat | variables.rs:163:14:163:22 | PathExpr | match | +| variables.rs:161:9:163:9 | RecordPat | variables.rs:164:9:164:38 | RecordPat | no-match | +| variables.rs:163:14:163:22 | PathExpr | variables.rs:163:24:163:34 | id_variable | | +| variables.rs:163:14:163:35 | CallExpr | variables.rs:160:5:169:5 | MatchExpr | | +| variables.rs:163:24:163:34 | id_variable | variables.rs:163:14:163:35 | CallExpr | | +| variables.rs:164:9:164:38 | RecordPat | variables.rs:165:13:165:52 | MacroExpr | match | +| variables.rs:164:9:164:38 | RecordPat | variables.rs:167:9:167:29 | RecordPat | no-match | +| variables.rs:164:43:166:9 | BlockExpr | variables.rs:160:5:169:5 | MatchExpr | | +| variables.rs:165:13:165:52 | MacroExpr | variables.rs:164:43:166:9 | BlockExpr | | +| variables.rs:167:9:167:29 | RecordPat | variables.rs:168:13:168:21 | PathExpr | match | +| variables.rs:168:13:168:21 | PathExpr | variables.rs:168:23:168:24 | id | | +| variables.rs:168:13:168:25 | CallExpr | variables.rs:160:5:169:5 | MatchExpr | | +| variables.rs:168:23:168:24 | id | variables.rs:168:13:168:25 | CallExpr | | +| variables.rs:177:1:183:1 | enter match_pattern5 | variables.rs:178:5:178:34 | LetStmt | | +| variables.rs:177:1:183:1 | exit match_pattern5 (normal) | variables.rs:177:1:183:1 | exit match_pattern5 | | +| variables.rs:177:21:183:1 | BlockExpr | variables.rs:177:1:183:1 | exit match_pattern5 (normal) | | +| variables.rs:178:5:178:34 | LetStmt | variables.rs:178:18:178:29 | PathExpr | | +| variables.rs:178:9:178:14 | either | variables.rs:179:11:179:16 | either | match, no-match | +| variables.rs:178:18:178:29 | PathExpr | variables.rs:178:31:178:32 | 32 | | +| variables.rs:178:18:178:33 | CallExpr | variables.rs:178:9:178:14 | either | | +| variables.rs:178:31:178:32 | 32 | variables.rs:178:18:178:33 | CallExpr | | +| variables.rs:179:5:182:5 | MatchExpr | variables.rs:177:21:183:1 | BlockExpr | | +| variables.rs:179:11:179:16 | either | variables.rs:180:9:180:44 | OrPat | | +| variables.rs:180:9:180:44 | OrPat | variables.rs:181:16:181:24 | PathExpr | match | +| variables.rs:181:16:181:24 | PathExpr | variables.rs:181:26:181:27 | a3 | | +| variables.rs:181:16:181:28 | CallExpr | variables.rs:179:5:182:5 | MatchExpr | | +| variables.rs:181:26:181:27 | a3 | variables.rs:181:16:181:28 | CallExpr | | +| variables.rs:191:1:205:1 | enter match_pattern6 | variables.rs:192:5:192:37 | LetStmt | | +| variables.rs:191:1:205:1 | exit match_pattern6 (normal) | variables.rs:191:1:205:1 | exit match_pattern6 | | +| variables.rs:191:21:205:1 | BlockExpr | variables.rs:191:1:205:1 | exit match_pattern6 (normal) | | +| variables.rs:192:5:192:37 | LetStmt | variables.rs:192:14:192:32 | PathExpr | | +| variables.rs:192:9:192:10 | tv | variables.rs:193:5:196:5 | ExprStmt | match, no-match | +| variables.rs:192:14:192:32 | PathExpr | variables.rs:192:34:192:35 | 62 | | +| variables.rs:192:14:192:36 | CallExpr | variables.rs:192:9:192:10 | tv | | +| variables.rs:192:34:192:35 | 62 | variables.rs:192:14:192:36 | CallExpr | | +| variables.rs:193:5:196:5 | ExprStmt | variables.rs:193:11:193:12 | tv | | +| variables.rs:193:5:196:5 | MatchExpr | variables.rs:197:5:200:5 | ExprStmt | | +| variables.rs:193:11:193:12 | tv | variables.rs:194:9:194:81 | OrPat | | +| variables.rs:194:9:194:81 | OrPat | variables.rs:195:16:195:24 | PathExpr | match | +| variables.rs:195:16:195:24 | PathExpr | variables.rs:195:26:195:27 | a4 | | +| variables.rs:195:16:195:28 | CallExpr | variables.rs:193:5:196:5 | MatchExpr | | +| variables.rs:195:26:195:27 | a4 | variables.rs:195:16:195:28 | CallExpr | | +| variables.rs:197:5:200:5 | ExprStmt | variables.rs:197:11:197:12 | tv | | +| variables.rs:197:5:200:5 | MatchExpr | variables.rs:201:11:201:12 | tv | | +| variables.rs:197:11:197:12 | tv | variables.rs:198:9:198:83 | OrPat | | +| variables.rs:198:9:198:83 | OrPat | variables.rs:199:16:199:24 | PathExpr | match | +| variables.rs:199:16:199:24 | PathExpr | variables.rs:199:26:199:27 | a5 | | +| variables.rs:199:16:199:28 | CallExpr | variables.rs:197:5:200:5 | MatchExpr | | +| variables.rs:199:26:199:27 | a5 | variables.rs:199:16:199:28 | CallExpr | | +| variables.rs:201:5:204:5 | MatchExpr | variables.rs:191:21:205:1 | BlockExpr | | +| variables.rs:201:11:201:12 | tv | variables.rs:202:9:202:83 | OrPat | | +| variables.rs:202:9:202:83 | OrPat | variables.rs:203:16:203:24 | PathExpr | match | +| variables.rs:203:16:203:24 | PathExpr | variables.rs:203:26:203:27 | a6 | | +| variables.rs:203:16:203:28 | CallExpr | variables.rs:201:5:204:5 | MatchExpr | | +| variables.rs:203:26:203:27 | a6 | variables.rs:203:16:203:28 | CallExpr | | +| variables.rs:207:1:215:1 | enter match_pattern7 | variables.rs:208:5:208:34 | LetStmt | | +| variables.rs:207:1:215:1 | exit match_pattern7 (normal) | variables.rs:207:1:215:1 | exit match_pattern7 | | +| variables.rs:207:21:215:1 | BlockExpr | variables.rs:207:1:215:1 | exit match_pattern7 (normal) | | +| variables.rs:208:5:208:34 | LetStmt | variables.rs:208:18:208:29 | PathExpr | | +| variables.rs:208:9:208:14 | either | variables.rs:209:11:209:16 | either | match, no-match | +| variables.rs:208:18:208:29 | PathExpr | variables.rs:208:31:208:32 | 32 | | +| variables.rs:208:18:208:33 | CallExpr | variables.rs:208:9:208:14 | either | | +| variables.rs:208:31:208:32 | 32 | variables.rs:208:18:208:33 | CallExpr | | +| variables.rs:209:5:214:5 | MatchExpr | variables.rs:207:21:215:1 | BlockExpr | | +| variables.rs:209:11:209:16 | either | variables.rs:210:9:210:44 | OrPat | | +| variables.rs:210:9:210:44 | OrPat | variables.rs:211:16:211:17 | a7 | match | +| variables.rs:210:9:210:44 | OrPat | variables.rs:213:9:213:9 | WildcardPat | no-match | +| variables.rs:211:16:211:17 | a7 | variables.rs:211:21:211:21 | 0 | | +| variables.rs:211:16:211:21 | ... > ... | variables.rs:212:16:212:24 | PathExpr | true | +| variables.rs:211:16:211:21 | ... > ... | variables.rs:213:9:213:9 | WildcardPat | false | +| variables.rs:211:21:211:21 | 0 | variables.rs:211:16:211:21 | ... > ... | | +| variables.rs:212:16:212:24 | PathExpr | variables.rs:212:26:212:27 | a7 | | +| variables.rs:212:16:212:28 | CallExpr | variables.rs:209:5:214:5 | MatchExpr | | +| variables.rs:212:26:212:27 | a7 | variables.rs:212:16:212:28 | CallExpr | | +| variables.rs:213:9:213:9 | WildcardPat | variables.rs:213:14:213:15 | TupleExpr | match | +| variables.rs:213:14:213:15 | TupleExpr | variables.rs:209:5:214:5 | MatchExpr | | +| variables.rs:217:1:232:1 | enter match_pattern8 | variables.rs:218:5:218:34 | LetStmt | | +| variables.rs:217:1:232:1 | exit match_pattern8 (normal) | variables.rs:217:1:232:1 | exit match_pattern8 | | +| variables.rs:217:21:232:1 | BlockExpr | variables.rs:217:1:232:1 | exit match_pattern8 (normal) | | +| variables.rs:218:5:218:34 | LetStmt | variables.rs:218:18:218:29 | PathExpr | | +| variables.rs:218:9:218:14 | either | variables.rs:220:11:220:16 | either | match, no-match | +| variables.rs:218:18:218:29 | PathExpr | variables.rs:218:31:218:32 | 32 | | +| variables.rs:218:18:218:33 | CallExpr | variables.rs:218:9:218:14 | either | | +| variables.rs:218:31:218:32 | 32 | variables.rs:218:18:218:33 | CallExpr | | +| variables.rs:220:5:231:5 | MatchExpr | variables.rs:217:21:232:1 | BlockExpr | | +| variables.rs:220:11:220:16 | either | variables.rs:221:9:222:52 | e | | +| variables.rs:221:9:222:52 | e | variables.rs:224:13:224:27 | ExprStmt | match | +| variables.rs:221:9:222:52 | e | variables.rs:230:9:230:9 | WildcardPat | no-match | +| variables.rs:223:12:229:9 | BlockExpr | variables.rs:220:5:231:5 | MatchExpr | | +| variables.rs:224:13:224:21 | PathExpr | variables.rs:224:23:224:25 | a11 | | +| variables.rs:224:13:224:26 | CallExpr | variables.rs:225:16:226:15 | LetExpr | | +| variables.rs:224:13:224:27 | ExprStmt | variables.rs:224:13:224:21 | PathExpr | | +| variables.rs:224:23:224:25 | a11 | variables.rs:224:13:224:26 | CallExpr | | +| variables.rs:225:13:228:13 | IfExpr | variables.rs:223:12:229:9 | BlockExpr | | +| variables.rs:225:16:226:15 | LetExpr | variables.rs:225:20:225:36 | TupleStructPat | | +| variables.rs:225:20:225:36 | TupleStructPat | variables.rs:225:13:228:13 | IfExpr | no-match | +| variables.rs:225:20:225:36 | TupleStructPat | variables.rs:227:17:227:32 | ExprStmt | match | +| variables.rs:226:17:228:13 | BlockExpr | variables.rs:225:13:228:13 | IfExpr | | +| variables.rs:227:17:227:25 | PathExpr | variables.rs:227:28:227:30 | a12 | | +| variables.rs:227:17:227:31 | CallExpr | variables.rs:226:17:228:13 | BlockExpr | | +| variables.rs:227:17:227:32 | ExprStmt | variables.rs:227:17:227:25 | PathExpr | | +| variables.rs:227:27:227:30 | * ... | variables.rs:227:17:227:31 | CallExpr | | +| variables.rs:227:28:227:30 | a12 | variables.rs:227:27:227:30 | * ... | | +| variables.rs:230:9:230:9 | WildcardPat | variables.rs:230:14:230:15 | TupleExpr | match | +| variables.rs:230:14:230:15 | TupleExpr | variables.rs:220:5:231:5 | MatchExpr | | +| variables.rs:241:1:247:1 | enter match_pattern9 | variables.rs:242:5:242:36 | LetStmt | | +| variables.rs:241:1:247:1 | exit match_pattern9 (normal) | variables.rs:241:1:247:1 | exit match_pattern9 | | +| variables.rs:241:21:247:1 | BlockExpr | variables.rs:241:1:247:1 | exit match_pattern9 (normal) | | +| variables.rs:242:5:242:36 | LetStmt | variables.rs:242:14:242:31 | PathExpr | | +| variables.rs:242:9:242:10 | fv | variables.rs:243:11:243:12 | fv | match, no-match | +| variables.rs:242:14:242:31 | PathExpr | variables.rs:242:33:242:34 | 62 | | +| variables.rs:242:14:242:35 | CallExpr | variables.rs:242:9:242:10 | fv | | +| variables.rs:242:33:242:34 | 62 | variables.rs:242:14:242:35 | CallExpr | | +| variables.rs:243:5:246:5 | MatchExpr | variables.rs:241:21:247:1 | BlockExpr | | +| variables.rs:243:11:243:12 | fv | variables.rs:244:9:244:109 | OrPat | | +| variables.rs:244:9:244:109 | OrPat | variables.rs:245:16:245:24 | PathExpr | match | +| variables.rs:245:16:245:24 | PathExpr | variables.rs:245:26:245:28 | a13 | | +| variables.rs:245:16:245:29 | CallExpr | variables.rs:243:5:246:5 | MatchExpr | | +| variables.rs:245:26:245:28 | a13 | variables.rs:245:16:245:29 | CallExpr | | +| variables.rs:249:1:258:1 | enter param_pattern1 | variables.rs:255:5:255:18 | ExprStmt | | +| variables.rs:249:1:258:1 | exit param_pattern1 (normal) | variables.rs:249:1:258:1 | exit param_pattern1 | | +| variables.rs:254:28:258:1 | BlockExpr | variables.rs:249:1:258:1 | exit param_pattern1 (normal) | | +| variables.rs:255:5:255:13 | PathExpr | variables.rs:255:15:255:16 | a8 | | +| variables.rs:255:5:255:17 | CallExpr | variables.rs:256:5:256:18 | ExprStmt | | | variables.rs:255:5:255:18 | ExprStmt | variables.rs:255:5:255:13 | PathExpr | | -| variables.rs:255:15:255:16 | c1 | variables.rs:255:5:255:17 | CallExpr | | -| variables.rs:258:1:262:1 | enter param_pattern2 | variables.rs:261:5:261:18 | ExprStmt | | -| variables.rs:258:1:262:1 | exit param_pattern2 (normal) | variables.rs:258:1:262:1 | exit param_pattern2 | | -| variables.rs:260:9:262:1 | BlockExpr | variables.rs:258:1:262:1 | exit param_pattern2 (normal) | | -| variables.rs:261:5:261:13 | PathExpr | variables.rs:261:15:261:16 | a9 | | -| variables.rs:261:5:261:17 | CallExpr | variables.rs:260:9:262:1 | BlockExpr | | -| variables.rs:261:5:261:18 | ExprStmt | variables.rs:261:5:261:13 | PathExpr | | -| variables.rs:261:15:261:16 | a9 | variables.rs:261:5:261:17 | CallExpr | | -| variables.rs:264:1:299:1 | enter destruct_assignment | variables.rs:265:5:269:18 | LetStmt | | -| variables.rs:264:1:299:1 | exit destruct_assignment (normal) | variables.rs:264:1:299:1 | exit destruct_assignment | | -| variables.rs:264:26:299:1 | BlockExpr | variables.rs:264:1:299:1 | exit destruct_assignment (normal) | | -| variables.rs:265:5:269:18 | LetStmt | variables.rs:269:10:269:10 | 1 | | -| variables.rs:265:9:269:5 | TuplePat | variables.rs:270:5:270:19 | ExprStmt | match | -| variables.rs:269:9:269:17 | TupleExpr | variables.rs:265:9:269:5 | TuplePat | | -| variables.rs:269:10:269:10 | 1 | variables.rs:269:13:269:13 | 2 | | -| variables.rs:269:13:269:13 | 2 | variables.rs:269:16:269:16 | 3 | | -| variables.rs:269:16:269:16 | 3 | variables.rs:269:9:269:17 | TupleExpr | | -| variables.rs:270:5:270:13 | PathExpr | variables.rs:270:15:270:17 | a10 | | -| variables.rs:270:5:270:18 | CallExpr | variables.rs:271:5:271:18 | ExprStmt | | -| variables.rs:270:5:270:19 | ExprStmt | variables.rs:270:5:270:13 | PathExpr | | -| variables.rs:270:15:270:17 | a10 | variables.rs:270:5:270:18 | CallExpr | | -| variables.rs:271:5:271:13 | PathExpr | variables.rs:271:15:271:16 | b4 | | -| variables.rs:271:5:271:17 | CallExpr | variables.rs:272:5:272:18 | ExprStmt | | -| variables.rs:271:5:271:18 | ExprStmt | variables.rs:271:5:271:13 | PathExpr | | -| variables.rs:271:15:271:16 | b4 | variables.rs:271:5:271:17 | CallExpr | | -| variables.rs:272:5:272:13 | PathExpr | variables.rs:272:15:272:16 | c2 | | -| variables.rs:272:5:272:17 | CallExpr | variables.rs:274:5:282:6 | ExprStmt | | -| variables.rs:272:5:272:18 | ExprStmt | variables.rs:272:5:272:13 | PathExpr | | -| variables.rs:272:15:272:16 | c2 | variables.rs:272:5:272:17 | CallExpr | | -| variables.rs:274:5:278:5 | TupleExpr | variables.rs:279:9:279:11 | a10 | | -| variables.rs:274:5:282:5 | ... = ... | variables.rs:283:5:283:19 | ExprStmt | | -| variables.rs:274:5:282:6 | ExprStmt | variables.rs:275:9:275:10 | c2 | | -| variables.rs:275:9:275:10 | c2 | variables.rs:276:9:276:10 | b4 | | -| variables.rs:276:9:276:10 | b4 | variables.rs:277:9:277:11 | a10 | | -| variables.rs:277:9:277:11 | a10 | variables.rs:274:5:278:5 | TupleExpr | | -| variables.rs:278:9:282:5 | TupleExpr | variables.rs:274:5:282:5 | ... = ... | | -| variables.rs:279:9:279:11 | a10 | variables.rs:280:9:280:10 | b4 | | -| variables.rs:280:9:280:10 | b4 | variables.rs:281:9:281:10 | c2 | | -| variables.rs:281:9:281:10 | c2 | variables.rs:278:9:282:5 | TupleExpr | | -| variables.rs:283:5:283:13 | PathExpr | variables.rs:283:15:283:17 | a10 | | -| variables.rs:283:5:283:18 | CallExpr | variables.rs:284:5:284:18 | ExprStmt | | -| variables.rs:283:5:283:19 | ExprStmt | variables.rs:283:5:283:13 | PathExpr | | -| variables.rs:283:15:283:17 | a10 | variables.rs:283:5:283:18 | CallExpr | | -| variables.rs:284:5:284:13 | PathExpr | variables.rs:284:15:284:16 | b4 | | -| variables.rs:284:5:284:17 | CallExpr | variables.rs:285:5:285:18 | ExprStmt | | -| variables.rs:284:5:284:18 | ExprStmt | variables.rs:284:5:284:13 | PathExpr | | -| variables.rs:284:15:284:16 | b4 | variables.rs:284:5:284:17 | CallExpr | | -| variables.rs:285:5:285:13 | PathExpr | variables.rs:285:15:285:16 | c2 | | -| variables.rs:285:5:285:17 | CallExpr | variables.rs:287:5:295:5 | ExprStmt | | -| variables.rs:285:5:285:18 | ExprStmt | variables.rs:285:5:285:13 | PathExpr | | -| variables.rs:285:15:285:16 | c2 | variables.rs:285:5:285:17 | CallExpr | | -| variables.rs:287:5:295:5 | ExprStmt | variables.rs:287:12:287:12 | 4 | | -| variables.rs:287:5:295:5 | MatchExpr | variables.rs:297:5:297:19 | ExprStmt | | -| variables.rs:287:11:287:16 | TupleExpr | variables.rs:288:9:291:9 | TuplePat | | -| variables.rs:287:12:287:12 | 4 | variables.rs:287:15:287:15 | 5 | | -| variables.rs:287:15:287:15 | 5 | variables.rs:287:11:287:16 | TupleExpr | | -| variables.rs:288:9:291:9 | TuplePat | variables.rs:292:13:292:27 | ExprStmt | match | -| variables.rs:291:14:294:9 | BlockExpr | variables.rs:287:5:295:5 | MatchExpr | | -| variables.rs:292:13:292:21 | PathExpr | variables.rs:292:23:292:25 | a10 | | -| variables.rs:292:13:292:26 | CallExpr | variables.rs:293:13:293:26 | ExprStmt | | -| variables.rs:292:13:292:27 | ExprStmt | variables.rs:292:13:292:21 | PathExpr | | -| variables.rs:292:23:292:25 | a10 | variables.rs:292:13:292:26 | CallExpr | | -| variables.rs:293:13:293:21 | PathExpr | variables.rs:293:23:293:24 | b4 | | -| variables.rs:293:13:293:25 | CallExpr | variables.rs:291:14:294:9 | BlockExpr | | -| variables.rs:293:13:293:26 | ExprStmt | variables.rs:293:13:293:21 | PathExpr | | -| variables.rs:293:23:293:24 | b4 | variables.rs:293:13:293:25 | CallExpr | | -| variables.rs:297:5:297:13 | PathExpr | variables.rs:297:15:297:17 | a10 | | -| variables.rs:297:5:297:18 | CallExpr | variables.rs:298:5:298:18 | ExprStmt | | -| variables.rs:297:5:297:19 | ExprStmt | variables.rs:297:5:297:13 | PathExpr | | -| variables.rs:297:15:297:17 | a10 | variables.rs:297:5:297:18 | CallExpr | | -| variables.rs:298:5:298:13 | PathExpr | variables.rs:298:15:298:16 | b4 | | -| variables.rs:298:5:298:17 | CallExpr | variables.rs:264:26:299:1 | BlockExpr | | -| variables.rs:298:5:298:18 | ExprStmt | variables.rs:298:5:298:13 | PathExpr | | -| variables.rs:298:15:298:16 | b4 | variables.rs:298:5:298:17 | CallExpr | | -| variables.rs:301:1:316:1 | enter closure_variable | variables.rs:302:5:304:10 | LetStmt | | -| variables.rs:301:1:316:1 | exit closure_variable (normal) | variables.rs:301:1:316:1 | exit closure_variable | | -| variables.rs:301:23:316:1 | BlockExpr | variables.rs:301:1:316:1 | exit closure_variable (normal) | | -| variables.rs:302:5:304:10 | LetStmt | variables.rs:303:9:304:9 | ClosureExpr | | -| variables.rs:302:9:302:23 | example_closure | variables.rs:305:5:306:27 | LetStmt | match, no-match | -| variables.rs:303:9:304:9 | ClosureExpr | variables.rs:302:9:302:23 | example_closure | | -| variables.rs:303:9:304:9 | enter ClosureExpr | variables.rs:304:9:304:9 | x | | -| variables.rs:303:9:304:9 | exit ClosureExpr (normal) | variables.rs:303:9:304:9 | exit ClosureExpr | | -| variables.rs:304:9:304:9 | x | variables.rs:303:9:304:9 | exit ClosureExpr (normal) | | -| variables.rs:305:5:306:27 | LetStmt | variables.rs:306:9:306:23 | example_closure | | -| variables.rs:305:9:305:10 | n1 | variables.rs:307:5:307:18 | ExprStmt | match, no-match | -| variables.rs:306:9:306:23 | example_closure | variables.rs:306:25:306:25 | 5 | | -| variables.rs:306:9:306:26 | CallExpr | variables.rs:305:9:305:10 | n1 | | -| variables.rs:306:25:306:25 | 5 | variables.rs:306:9:306:26 | CallExpr | | -| variables.rs:307:5:307:13 | PathExpr | variables.rs:307:15:307:16 | n1 | | -| variables.rs:307:5:307:17 | CallExpr | variables.rs:309:5:309:25 | ExprStmt | | -| variables.rs:307:5:307:18 | ExprStmt | variables.rs:307:5:307:13 | PathExpr | | -| variables.rs:307:15:307:16 | n1 | variables.rs:307:5:307:17 | CallExpr | | -| variables.rs:309:5:309:22 | PathExpr | variables.rs:309:5:309:24 | CallExpr | | -| variables.rs:309:5:309:24 | CallExpr | variables.rs:310:5:312:10 | LetStmt | | -| variables.rs:309:5:309:25 | ExprStmt | variables.rs:309:5:309:22 | PathExpr | | -| variables.rs:310:5:312:10 | LetStmt | variables.rs:311:9:312:9 | ClosureExpr | | -| variables.rs:310:9:310:26 | immutable_variable | variables.rs:313:5:314:30 | LetStmt | match, no-match | -| variables.rs:311:9:312:9 | ClosureExpr | variables.rs:310:9:310:26 | immutable_variable | | -| variables.rs:311:9:312:9 | enter ClosureExpr | variables.rs:312:9:312:9 | x | | -| variables.rs:311:9:312:9 | exit ClosureExpr (normal) | variables.rs:311:9:312:9 | exit ClosureExpr | | -| variables.rs:312:9:312:9 | x | variables.rs:311:9:312:9 | exit ClosureExpr (normal) | | -| variables.rs:313:5:314:30 | LetStmt | variables.rs:314:9:314:26 | immutable_variable | | -| variables.rs:313:9:313:10 | n2 | variables.rs:315:5:315:18 | ExprStmt | match, no-match | -| variables.rs:314:9:314:26 | immutable_variable | variables.rs:314:28:314:28 | 6 | | -| variables.rs:314:9:314:29 | CallExpr | variables.rs:313:9:313:10 | n2 | | -| variables.rs:314:28:314:28 | 6 | variables.rs:314:9:314:29 | CallExpr | | -| variables.rs:315:5:315:13 | PathExpr | variables.rs:315:15:315:16 | n2 | | -| variables.rs:315:5:315:17 | CallExpr | variables.rs:301:23:316:1 | BlockExpr | | -| variables.rs:315:5:315:18 | ExprStmt | variables.rs:315:5:315:13 | PathExpr | | -| variables.rs:315:15:315:16 | n2 | variables.rs:315:5:315:17 | CallExpr | | -| variables.rs:318:1:325:1 | enter for_variable | variables.rs:319:5:319:42 | LetStmt | | -| variables.rs:318:1:325:1 | exit for_variable (normal) | variables.rs:318:1:325:1 | exit for_variable | | -| variables.rs:318:19:325:1 | BlockExpr | variables.rs:318:1:325:1 | exit for_variable (normal) | | -| variables.rs:319:5:319:42 | LetStmt | variables.rs:319:15:319:22 | "apples" | | -| variables.rs:319:9:319:9 | v | variables.rs:322:12:322:12 | v | match, no-match | -| variables.rs:319:13:319:41 | RefExpr | variables.rs:319:9:319:9 | v | | -| variables.rs:319:14:319:41 | ArrayExpr | variables.rs:319:13:319:41 | RefExpr | | -| variables.rs:319:15:319:22 | "apples" | variables.rs:319:25:319:30 | "cake" | | -| variables.rs:319:25:319:30 | "cake" | variables.rs:319:33:319:40 | "coffee" | | -| variables.rs:319:33:319:40 | "coffee" | variables.rs:319:14:319:41 | ArrayExpr | | -| variables.rs:321:5:324:5 | ForExpr | variables.rs:318:19:325:1 | BlockExpr | | -| variables.rs:321:9:321:12 | text | variables.rs:321:5:324:5 | ForExpr | no-match | -| variables.rs:321:9:321:12 | text | variables.rs:323:9:323:24 | ExprStmt | match | -| variables.rs:322:12:322:12 | v | variables.rs:321:9:321:12 | text | | -| variables.rs:322:14:324:5 | BlockExpr | variables.rs:321:9:321:12 | text | | -| variables.rs:323:9:323:17 | PathExpr | variables.rs:323:19:323:22 | text | | -| variables.rs:323:9:323:23 | CallExpr | variables.rs:322:14:324:5 | BlockExpr | | -| variables.rs:323:9:323:24 | ExprStmt | variables.rs:323:9:323:17 | PathExpr | | -| variables.rs:323:19:323:22 | text | variables.rs:323:9:323:23 | CallExpr | | -| variables.rs:327:1:350:1 | enter main | variables.rs:328:5:328:25 | ExprStmt | | -| variables.rs:327:1:350:1 | exit main (normal) | variables.rs:327:1:350:1 | exit main | | -| variables.rs:327:11:350:1 | BlockExpr | variables.rs:327:1:350:1 | exit main (normal) | | -| variables.rs:328:5:328:22 | PathExpr | variables.rs:328:5:328:24 | CallExpr | | -| variables.rs:328:5:328:24 | CallExpr | variables.rs:329:5:329:23 | ExprStmt | | -| variables.rs:328:5:328:25 | ExprStmt | variables.rs:328:5:328:22 | PathExpr | | -| variables.rs:329:5:329:20 | PathExpr | variables.rs:329:5:329:22 | CallExpr | | -| variables.rs:329:5:329:22 | CallExpr | variables.rs:330:5:330:23 | ExprStmt | | -| variables.rs:329:5:329:23 | ExprStmt | variables.rs:329:5:329:20 | PathExpr | | -| variables.rs:330:5:330:20 | PathExpr | variables.rs:330:5:330:22 | CallExpr | | -| variables.rs:330:5:330:22 | CallExpr | variables.rs:331:5:331:23 | ExprStmt | | -| variables.rs:330:5:330:23 | ExprStmt | variables.rs:330:5:330:20 | PathExpr | | -| variables.rs:331:5:331:20 | PathExpr | variables.rs:331:5:331:22 | CallExpr | | -| variables.rs:331:5:331:22 | CallExpr | variables.rs:332:5:332:19 | ExprStmt | | -| variables.rs:331:5:331:23 | ExprStmt | variables.rs:331:5:331:20 | PathExpr | | -| variables.rs:332:5:332:16 | PathExpr | variables.rs:332:5:332:18 | CallExpr | | -| variables.rs:332:5:332:18 | CallExpr | variables.rs:333:5:333:19 | ExprStmt | | -| variables.rs:332:5:332:19 | ExprStmt | variables.rs:332:5:332:16 | PathExpr | | -| variables.rs:333:5:333:16 | PathExpr | variables.rs:333:5:333:18 | CallExpr | | -| variables.rs:333:5:333:18 | CallExpr | variables.rs:334:5:334:19 | ExprStmt | | -| variables.rs:333:5:333:19 | ExprStmt | variables.rs:333:5:333:16 | PathExpr | | -| variables.rs:334:5:334:16 | PathExpr | variables.rs:334:5:334:18 | CallExpr | | -| variables.rs:334:5:334:18 | CallExpr | variables.rs:335:5:335:19 | ExprStmt | | -| variables.rs:334:5:334:19 | ExprStmt | variables.rs:334:5:334:16 | PathExpr | | -| variables.rs:335:5:335:16 | PathExpr | variables.rs:335:5:335:18 | CallExpr | | -| variables.rs:335:5:335:18 | CallExpr | variables.rs:336:5:336:21 | ExprStmt | | -| variables.rs:335:5:335:19 | ExprStmt | variables.rs:335:5:335:16 | PathExpr | | -| variables.rs:336:5:336:18 | PathExpr | variables.rs:336:5:336:20 | CallExpr | | -| variables.rs:336:5:336:20 | CallExpr | variables.rs:337:5:337:21 | ExprStmt | | -| variables.rs:336:5:336:21 | ExprStmt | variables.rs:336:5:336:18 | PathExpr | | -| variables.rs:337:5:337:18 | PathExpr | variables.rs:337:5:337:20 | CallExpr | | -| variables.rs:337:5:337:20 | CallExpr | variables.rs:338:5:338:21 | ExprStmt | | -| variables.rs:337:5:337:21 | ExprStmt | variables.rs:337:5:337:18 | PathExpr | | -| variables.rs:338:5:338:18 | PathExpr | variables.rs:338:5:338:20 | CallExpr | | -| variables.rs:338:5:338:20 | CallExpr | variables.rs:339:5:339:21 | ExprStmt | | -| variables.rs:338:5:338:21 | ExprStmt | variables.rs:338:5:338:18 | PathExpr | | -| variables.rs:339:5:339:18 | PathExpr | variables.rs:339:5:339:20 | CallExpr | | -| variables.rs:339:5:339:20 | CallExpr | variables.rs:340:5:340:21 | ExprStmt | | -| variables.rs:339:5:339:21 | ExprStmt | variables.rs:339:5:339:18 | PathExpr | | -| variables.rs:340:5:340:18 | PathExpr | variables.rs:340:5:340:20 | CallExpr | | -| variables.rs:340:5:340:20 | CallExpr | variables.rs:341:5:341:21 | ExprStmt | | -| variables.rs:340:5:340:21 | ExprStmt | variables.rs:340:5:340:18 | PathExpr | | -| variables.rs:341:5:341:18 | PathExpr | variables.rs:341:5:341:20 | CallExpr | | -| variables.rs:341:5:341:20 | CallExpr | variables.rs:342:5:342:21 | ExprStmt | | -| variables.rs:341:5:341:21 | ExprStmt | variables.rs:341:5:341:18 | PathExpr | | -| variables.rs:342:5:342:18 | PathExpr | variables.rs:342:5:342:20 | CallExpr | | -| variables.rs:342:5:342:20 | CallExpr | variables.rs:343:5:343:21 | ExprStmt | | -| variables.rs:342:5:342:21 | ExprStmt | variables.rs:342:5:342:18 | PathExpr | | -| variables.rs:343:5:343:18 | PathExpr | variables.rs:343:5:343:20 | CallExpr | | -| variables.rs:343:5:343:20 | CallExpr | variables.rs:344:5:344:21 | ExprStmt | | -| variables.rs:343:5:343:21 | ExprStmt | variables.rs:343:5:343:18 | PathExpr | | -| variables.rs:344:5:344:18 | PathExpr | variables.rs:344:5:344:20 | CallExpr | | -| variables.rs:344:5:344:20 | CallExpr | variables.rs:345:5:345:36 | ExprStmt | | -| variables.rs:344:5:344:21 | ExprStmt | variables.rs:344:5:344:18 | PathExpr | | -| variables.rs:345:5:345:18 | PathExpr | variables.rs:345:20:345:22 | "a" | | -| variables.rs:345:5:345:35 | CallExpr | variables.rs:346:5:346:37 | ExprStmt | | -| variables.rs:345:5:345:36 | ExprStmt | variables.rs:345:5:345:18 | PathExpr | | -| variables.rs:345:20:345:22 | "a" | variables.rs:345:26:345:28 | "b" | | -| variables.rs:345:25:345:34 | TupleExpr | variables.rs:345:5:345:35 | CallExpr | | -| variables.rs:345:26:345:28 | "b" | variables.rs:345:31:345:33 | "c" | | -| variables.rs:345:31:345:33 | "c" | variables.rs:345:25:345:34 | TupleExpr | | -| variables.rs:346:5:346:18 | PathExpr | variables.rs:346:20:346:31 | PathExpr | | -| variables.rs:346:5:346:36 | CallExpr | variables.rs:347:5:347:26 | ExprStmt | | -| variables.rs:346:5:346:37 | ExprStmt | variables.rs:346:5:346:18 | PathExpr | | -| variables.rs:346:20:346:31 | PathExpr | variables.rs:346:33:346:34 | 45 | | -| variables.rs:346:20:346:35 | CallExpr | variables.rs:346:5:346:36 | CallExpr | | -| variables.rs:346:33:346:34 | 45 | variables.rs:346:20:346:35 | CallExpr | | -| variables.rs:347:5:347:23 | PathExpr | variables.rs:347:5:347:25 | CallExpr | | -| variables.rs:347:5:347:25 | CallExpr | variables.rs:348:5:348:23 | ExprStmt | | -| variables.rs:347:5:347:26 | ExprStmt | variables.rs:347:5:347:23 | PathExpr | | -| variables.rs:348:5:348:20 | PathExpr | variables.rs:348:5:348:22 | CallExpr | | -| variables.rs:348:5:348:22 | CallExpr | variables.rs:349:5:349:19 | ExprStmt | | -| variables.rs:348:5:348:23 | ExprStmt | variables.rs:348:5:348:20 | PathExpr | | -| variables.rs:349:5:349:16 | PathExpr | variables.rs:349:5:349:18 | CallExpr | | -| variables.rs:349:5:349:18 | CallExpr | variables.rs:327:11:350:1 | BlockExpr | | -| variables.rs:349:5:349:19 | ExprStmt | variables.rs:349:5:349:16 | PathExpr | | +| variables.rs:255:15:255:16 | a8 | variables.rs:255:5:255:17 | CallExpr | | +| variables.rs:256:5:256:13 | PathExpr | variables.rs:256:15:256:16 | b3 | | +| variables.rs:256:5:256:17 | CallExpr | variables.rs:257:5:257:18 | ExprStmt | | +| variables.rs:256:5:256:18 | ExprStmt | variables.rs:256:5:256:13 | PathExpr | | +| variables.rs:256:15:256:16 | b3 | variables.rs:256:5:256:17 | CallExpr | | +| variables.rs:257:5:257:13 | PathExpr | variables.rs:257:15:257:16 | c1 | | +| variables.rs:257:5:257:17 | CallExpr | variables.rs:254:28:258:1 | BlockExpr | | +| variables.rs:257:5:257:18 | ExprStmt | variables.rs:257:5:257:13 | PathExpr | | +| variables.rs:257:15:257:16 | c1 | variables.rs:257:5:257:17 | CallExpr | | +| variables.rs:260:1:264:1 | enter param_pattern2 | variables.rs:263:5:263:18 | ExprStmt | | +| variables.rs:260:1:264:1 | exit param_pattern2 (normal) | variables.rs:260:1:264:1 | exit param_pattern2 | | +| variables.rs:262:9:264:1 | BlockExpr | variables.rs:260:1:264:1 | exit param_pattern2 (normal) | | +| variables.rs:263:5:263:13 | PathExpr | variables.rs:263:15:263:16 | a9 | | +| variables.rs:263:5:263:17 | CallExpr | variables.rs:262:9:264:1 | BlockExpr | | +| variables.rs:263:5:263:18 | ExprStmt | variables.rs:263:5:263:13 | PathExpr | | +| variables.rs:263:15:263:16 | a9 | variables.rs:263:5:263:17 | CallExpr | | +| variables.rs:266:1:301:1 | enter destruct_assignment | variables.rs:267:5:271:18 | LetStmt | | +| variables.rs:266:1:301:1 | exit destruct_assignment (normal) | variables.rs:266:1:301:1 | exit destruct_assignment | | +| variables.rs:266:26:301:1 | BlockExpr | variables.rs:266:1:301:1 | exit destruct_assignment (normal) | | +| variables.rs:267:5:271:18 | LetStmt | variables.rs:271:10:271:10 | 1 | | +| variables.rs:267:9:271:5 | TuplePat | variables.rs:272:5:272:19 | ExprStmt | match | +| variables.rs:271:9:271:17 | TupleExpr | variables.rs:267:9:271:5 | TuplePat | | +| variables.rs:271:10:271:10 | 1 | variables.rs:271:13:271:13 | 2 | | +| variables.rs:271:13:271:13 | 2 | variables.rs:271:16:271:16 | 3 | | +| variables.rs:271:16:271:16 | 3 | variables.rs:271:9:271:17 | TupleExpr | | +| variables.rs:272:5:272:13 | PathExpr | variables.rs:272:15:272:17 | a10 | | +| variables.rs:272:5:272:18 | CallExpr | variables.rs:273:5:273:18 | ExprStmt | | +| variables.rs:272:5:272:19 | ExprStmt | variables.rs:272:5:272:13 | PathExpr | | +| variables.rs:272:15:272:17 | a10 | variables.rs:272:5:272:18 | CallExpr | | +| variables.rs:273:5:273:13 | PathExpr | variables.rs:273:15:273:16 | b4 | | +| variables.rs:273:5:273:17 | CallExpr | variables.rs:274:5:274:18 | ExprStmt | | +| variables.rs:273:5:273:18 | ExprStmt | variables.rs:273:5:273:13 | PathExpr | | +| variables.rs:273:15:273:16 | b4 | variables.rs:273:5:273:17 | CallExpr | | +| variables.rs:274:5:274:13 | PathExpr | variables.rs:274:15:274:16 | c2 | | +| variables.rs:274:5:274:17 | CallExpr | variables.rs:276:5:284:6 | ExprStmt | | +| variables.rs:274:5:274:18 | ExprStmt | variables.rs:274:5:274:13 | PathExpr | | +| variables.rs:274:15:274:16 | c2 | variables.rs:274:5:274:17 | CallExpr | | +| variables.rs:276:5:280:5 | TupleExpr | variables.rs:281:9:281:11 | a10 | | +| variables.rs:276:5:284:5 | ... = ... | variables.rs:285:5:285:19 | ExprStmt | | +| variables.rs:276:5:284:6 | ExprStmt | variables.rs:277:9:277:10 | c2 | | +| variables.rs:277:9:277:10 | c2 | variables.rs:278:9:278:10 | b4 | | +| variables.rs:278:9:278:10 | b4 | variables.rs:279:9:279:11 | a10 | | +| variables.rs:279:9:279:11 | a10 | variables.rs:276:5:280:5 | TupleExpr | | +| variables.rs:280:9:284:5 | TupleExpr | variables.rs:276:5:284:5 | ... = ... | | +| variables.rs:281:9:281:11 | a10 | variables.rs:282:9:282:10 | b4 | | +| variables.rs:282:9:282:10 | b4 | variables.rs:283:9:283:10 | c2 | | +| variables.rs:283:9:283:10 | c2 | variables.rs:280:9:284:5 | TupleExpr | | +| variables.rs:285:5:285:13 | PathExpr | variables.rs:285:15:285:17 | a10 | | +| variables.rs:285:5:285:18 | CallExpr | variables.rs:286:5:286:18 | ExprStmt | | +| variables.rs:285:5:285:19 | ExprStmt | variables.rs:285:5:285:13 | PathExpr | | +| variables.rs:285:15:285:17 | a10 | variables.rs:285:5:285:18 | CallExpr | | +| variables.rs:286:5:286:13 | PathExpr | variables.rs:286:15:286:16 | b4 | | +| variables.rs:286:5:286:17 | CallExpr | variables.rs:287:5:287:18 | ExprStmt | | +| variables.rs:286:5:286:18 | ExprStmt | variables.rs:286:5:286:13 | PathExpr | | +| variables.rs:286:15:286:16 | b4 | variables.rs:286:5:286:17 | CallExpr | | +| variables.rs:287:5:287:13 | PathExpr | variables.rs:287:15:287:16 | c2 | | +| variables.rs:287:5:287:17 | CallExpr | variables.rs:289:5:297:5 | ExprStmt | | +| variables.rs:287:5:287:18 | ExprStmt | variables.rs:287:5:287:13 | PathExpr | | +| variables.rs:287:15:287:16 | c2 | variables.rs:287:5:287:17 | CallExpr | | +| variables.rs:289:5:297:5 | ExprStmt | variables.rs:289:12:289:12 | 4 | | +| variables.rs:289:5:297:5 | MatchExpr | variables.rs:299:5:299:19 | ExprStmt | | +| variables.rs:289:11:289:16 | TupleExpr | variables.rs:290:9:293:9 | TuplePat | | +| variables.rs:289:12:289:12 | 4 | variables.rs:289:15:289:15 | 5 | | +| variables.rs:289:15:289:15 | 5 | variables.rs:289:11:289:16 | TupleExpr | | +| variables.rs:290:9:293:9 | TuplePat | variables.rs:294:13:294:27 | ExprStmt | match | +| variables.rs:293:14:296:9 | BlockExpr | variables.rs:289:5:297:5 | MatchExpr | | +| variables.rs:294:13:294:21 | PathExpr | variables.rs:294:23:294:25 | a10 | | +| variables.rs:294:13:294:26 | CallExpr | variables.rs:295:13:295:26 | ExprStmt | | +| variables.rs:294:13:294:27 | ExprStmt | variables.rs:294:13:294:21 | PathExpr | | +| variables.rs:294:23:294:25 | a10 | variables.rs:294:13:294:26 | CallExpr | | +| variables.rs:295:13:295:21 | PathExpr | variables.rs:295:23:295:24 | b4 | | +| variables.rs:295:13:295:25 | CallExpr | variables.rs:293:14:296:9 | BlockExpr | | +| variables.rs:295:13:295:26 | ExprStmt | variables.rs:295:13:295:21 | PathExpr | | +| variables.rs:295:23:295:24 | b4 | variables.rs:295:13:295:25 | CallExpr | | +| variables.rs:299:5:299:13 | PathExpr | variables.rs:299:15:299:17 | a10 | | +| variables.rs:299:5:299:18 | CallExpr | variables.rs:300:5:300:18 | ExprStmt | | +| variables.rs:299:5:299:19 | ExprStmt | variables.rs:299:5:299:13 | PathExpr | | +| variables.rs:299:15:299:17 | a10 | variables.rs:299:5:299:18 | CallExpr | | +| variables.rs:300:5:300:13 | PathExpr | variables.rs:300:15:300:16 | b4 | | +| variables.rs:300:5:300:17 | CallExpr | variables.rs:266:26:301:1 | BlockExpr | | +| variables.rs:300:5:300:18 | ExprStmt | variables.rs:300:5:300:13 | PathExpr | | +| variables.rs:300:15:300:16 | b4 | variables.rs:300:5:300:17 | CallExpr | | +| variables.rs:303:1:318:1 | enter closure_variable | variables.rs:304:5:306:10 | LetStmt | | +| variables.rs:303:1:318:1 | exit closure_variable (normal) | variables.rs:303:1:318:1 | exit closure_variable | | +| variables.rs:303:23:318:1 | BlockExpr | variables.rs:303:1:318:1 | exit closure_variable (normal) | | +| variables.rs:304:5:306:10 | LetStmt | variables.rs:305:9:306:9 | ClosureExpr | | +| variables.rs:304:9:304:23 | example_closure | variables.rs:307:5:308:27 | LetStmt | match, no-match | +| variables.rs:305:9:306:9 | ClosureExpr | variables.rs:304:9:304:23 | example_closure | | +| variables.rs:305:9:306:9 | enter ClosureExpr | variables.rs:306:9:306:9 | x | | +| variables.rs:305:9:306:9 | exit ClosureExpr (normal) | variables.rs:305:9:306:9 | exit ClosureExpr | | +| variables.rs:306:9:306:9 | x | variables.rs:305:9:306:9 | exit ClosureExpr (normal) | | +| variables.rs:307:5:308:27 | LetStmt | variables.rs:308:9:308:23 | example_closure | | +| variables.rs:307:9:307:10 | n1 | variables.rs:309:5:309:18 | ExprStmt | match, no-match | +| variables.rs:308:9:308:23 | example_closure | variables.rs:308:25:308:25 | 5 | | +| variables.rs:308:9:308:26 | CallExpr | variables.rs:307:9:307:10 | n1 | | +| variables.rs:308:25:308:25 | 5 | variables.rs:308:9:308:26 | CallExpr | | +| variables.rs:309:5:309:13 | PathExpr | variables.rs:309:15:309:16 | n1 | | +| variables.rs:309:5:309:17 | CallExpr | variables.rs:311:5:311:25 | ExprStmt | | +| variables.rs:309:5:309:18 | ExprStmt | variables.rs:309:5:309:13 | PathExpr | | +| variables.rs:309:15:309:16 | n1 | variables.rs:309:5:309:17 | CallExpr | | +| variables.rs:311:5:311:22 | PathExpr | variables.rs:311:5:311:24 | CallExpr | | +| variables.rs:311:5:311:24 | CallExpr | variables.rs:312:5:314:10 | LetStmt | | +| variables.rs:311:5:311:25 | ExprStmt | variables.rs:311:5:311:22 | PathExpr | | +| variables.rs:312:5:314:10 | LetStmt | variables.rs:313:9:314:9 | ClosureExpr | | +| variables.rs:312:9:312:26 | immutable_variable | variables.rs:315:5:316:30 | LetStmt | match, no-match | +| variables.rs:313:9:314:9 | ClosureExpr | variables.rs:312:9:312:26 | immutable_variable | | +| variables.rs:313:9:314:9 | enter ClosureExpr | variables.rs:314:9:314:9 | x | | +| variables.rs:313:9:314:9 | exit ClosureExpr (normal) | variables.rs:313:9:314:9 | exit ClosureExpr | | +| variables.rs:314:9:314:9 | x | variables.rs:313:9:314:9 | exit ClosureExpr (normal) | | +| variables.rs:315:5:316:30 | LetStmt | variables.rs:316:9:316:26 | immutable_variable | | +| variables.rs:315:9:315:10 | n2 | variables.rs:317:5:317:18 | ExprStmt | match, no-match | +| variables.rs:316:9:316:26 | immutable_variable | variables.rs:316:28:316:28 | 6 | | +| variables.rs:316:9:316:29 | CallExpr | variables.rs:315:9:315:10 | n2 | | +| variables.rs:316:28:316:28 | 6 | variables.rs:316:9:316:29 | CallExpr | | +| variables.rs:317:5:317:13 | PathExpr | variables.rs:317:15:317:16 | n2 | | +| variables.rs:317:5:317:17 | CallExpr | variables.rs:303:23:318:1 | BlockExpr | | +| variables.rs:317:5:317:18 | ExprStmt | variables.rs:317:5:317:13 | PathExpr | | +| variables.rs:317:15:317:16 | n2 | variables.rs:317:5:317:17 | CallExpr | | +| variables.rs:320:1:327:1 | enter for_variable | variables.rs:321:5:321:42 | LetStmt | | +| variables.rs:320:1:327:1 | exit for_variable (normal) | variables.rs:320:1:327:1 | exit for_variable | | +| variables.rs:320:19:327:1 | BlockExpr | variables.rs:320:1:327:1 | exit for_variable (normal) | | +| variables.rs:321:5:321:42 | LetStmt | variables.rs:321:15:321:22 | "apples" | | +| variables.rs:321:9:321:9 | v | variables.rs:324:12:324:12 | v | match, no-match | +| variables.rs:321:13:321:41 | RefExpr | variables.rs:321:9:321:9 | v | | +| variables.rs:321:14:321:41 | ArrayExpr | variables.rs:321:13:321:41 | RefExpr | | +| variables.rs:321:15:321:22 | "apples" | variables.rs:321:25:321:30 | "cake" | | +| variables.rs:321:25:321:30 | "cake" | variables.rs:321:33:321:40 | "coffee" | | +| variables.rs:321:33:321:40 | "coffee" | variables.rs:321:14:321:41 | ArrayExpr | | +| variables.rs:323:5:326:5 | ForExpr | variables.rs:320:19:327:1 | BlockExpr | | +| variables.rs:323:9:323:12 | text | variables.rs:323:5:326:5 | ForExpr | no-match | +| variables.rs:323:9:323:12 | text | variables.rs:325:9:325:24 | ExprStmt | match | +| variables.rs:324:12:324:12 | v | variables.rs:323:9:323:12 | text | | +| variables.rs:324:14:326:5 | BlockExpr | variables.rs:323:9:323:12 | text | | +| variables.rs:325:9:325:17 | PathExpr | variables.rs:325:19:325:22 | text | | +| variables.rs:325:9:325:23 | CallExpr | variables.rs:324:14:326:5 | BlockExpr | | +| variables.rs:325:9:325:24 | ExprStmt | variables.rs:325:9:325:17 | PathExpr | | +| variables.rs:325:19:325:22 | text | variables.rs:325:9:325:23 | CallExpr | | +| variables.rs:329:1:335:1 | enter add_assign | variables.rs:330:5:330:18 | LetStmt | | +| variables.rs:329:1:335:1 | exit add_assign (normal) | variables.rs:329:1:335:1 | exit add_assign | | +| variables.rs:329:17:335:1 | BlockExpr | variables.rs:329:1:335:1 | exit add_assign (normal) | | +| variables.rs:330:5:330:18 | LetStmt | variables.rs:330:17:330:17 | 0 | | +| variables.rs:330:9:330:13 | a | variables.rs:331:5:331:11 | ExprStmt | match, no-match | +| variables.rs:330:17:330:17 | 0 | variables.rs:330:9:330:13 | a | | +| variables.rs:331:5:331:5 | a | variables.rs:331:10:331:10 | 1 | | +| variables.rs:331:5:331:10 | ... += ... | variables.rs:332:5:332:17 | ExprStmt | | +| variables.rs:331:5:331:11 | ExprStmt | variables.rs:331:5:331:5 | a | | +| variables.rs:331:10:331:10 | 1 | variables.rs:331:5:331:10 | ... += ... | | +| variables.rs:332:5:332:13 | PathExpr | variables.rs:332:15:332:15 | a | | +| variables.rs:332:5:332:16 | CallExpr | variables.rs:333:5:333:28 | ExprStmt | | +| variables.rs:332:5:332:17 | ExprStmt | variables.rs:332:5:332:13 | PathExpr | | +| variables.rs:332:15:332:15 | a | variables.rs:332:5:332:16 | CallExpr | | +| variables.rs:333:5:333:27 | MethodCallExpr | variables.rs:334:5:334:17 | ExprStmt | | +| variables.rs:333:5:333:28 | ExprStmt | variables.rs:333:5:333:27 | MethodCallExpr | | +| variables.rs:334:5:334:13 | PathExpr | variables.rs:334:15:334:15 | a | | +| variables.rs:334:5:334:16 | CallExpr | variables.rs:329:17:335:1 | BlockExpr | | +| variables.rs:334:5:334:17 | ExprStmt | variables.rs:334:5:334:13 | PathExpr | | +| variables.rs:334:15:334:15 | a | variables.rs:334:5:334:16 | CallExpr | | +| variables.rs:337:1:343:1 | enter mutate | variables.rs:338:5:338:18 | LetStmt | | +| variables.rs:337:1:343:1 | exit mutate (normal) | variables.rs:337:1:343:1 | exit mutate | | +| variables.rs:337:13:343:1 | BlockExpr | variables.rs:337:1:343:1 | exit mutate (normal) | | +| variables.rs:338:5:338:18 | LetStmt | variables.rs:338:17:338:17 | 1 | | +| variables.rs:338:9:338:13 | i | variables.rs:339:5:340:15 | LetStmt | match, no-match | +| variables.rs:338:17:338:17 | 1 | variables.rs:338:9:338:13 | i | | +| variables.rs:339:5:340:15 | LetStmt | variables.rs:340:14:340:14 | i | | +| variables.rs:339:9:339:13 | ref_i | variables.rs:341:5:341:15 | ExprStmt | match, no-match | +| variables.rs:340:9:340:14 | RefExpr | variables.rs:339:9:339:13 | ref_i | | +| variables.rs:340:14:340:14 | i | variables.rs:340:9:340:14 | RefExpr | | +| variables.rs:341:5:341:10 | * ... | variables.rs:341:14:341:14 | 2 | | +| variables.rs:341:5:341:14 | ... = ... | variables.rs:342:5:342:17 | ExprStmt | | +| variables.rs:341:5:341:15 | ExprStmt | variables.rs:341:6:341:10 | ref_i | | +| variables.rs:341:6:341:10 | ref_i | variables.rs:341:5:341:10 | * ... | | +| variables.rs:341:14:341:14 | 2 | variables.rs:341:5:341:14 | ... = ... | | +| variables.rs:342:5:342:13 | PathExpr | variables.rs:342:15:342:15 | i | | +| variables.rs:342:5:342:16 | CallExpr | variables.rs:337:13:343:1 | BlockExpr | | +| variables.rs:342:5:342:17 | ExprStmt | variables.rs:342:5:342:13 | PathExpr | | +| variables.rs:342:15:342:15 | i | variables.rs:342:5:342:16 | CallExpr | | +| variables.rs:345:1:349:1 | enter mutate_param | variables.rs:346:5:348:11 | ExprStmt | | +| variables.rs:345:1:349:1 | exit mutate_param (normal) | variables.rs:345:1:349:1 | exit mutate_param | | +| variables.rs:345:31:349:1 | BlockExpr | variables.rs:345:1:349:1 | exit mutate_param (normal) | | +| variables.rs:346:5:346:6 | * ... | variables.rs:347:10:347:10 | x | | +| variables.rs:346:5:348:10 | ... = ... | variables.rs:345:31:349:1 | BlockExpr | | +| variables.rs:346:5:348:11 | ExprStmt | variables.rs:346:6:346:6 | x | | +| variables.rs:346:6:346:6 | x | variables.rs:346:5:346:6 | * ... | | +| variables.rs:347:9:347:10 | * ... | variables.rs:348:10:348:10 | x | | +| variables.rs:347:9:348:10 | ... + ... | variables.rs:346:5:348:10 | ... = ... | | +| variables.rs:347:10:347:10 | x | variables.rs:347:9:347:10 | * ... | | +| variables.rs:348:9:348:10 | * ... | variables.rs:347:9:348:10 | ... + ... | | +| variables.rs:348:10:348:10 | x | variables.rs:348:9:348:10 | * ... | | +| variables.rs:351:1:355:1 | enter mutate_arg | variables.rs:352:5:352:18 | LetStmt | | +| variables.rs:351:1:355:1 | exit mutate_arg (normal) | variables.rs:351:1:355:1 | exit mutate_arg | | +| variables.rs:351:17:355:1 | BlockExpr | variables.rs:351:1:355:1 | exit mutate_arg (normal) | | +| variables.rs:352:5:352:18 | LetStmt | variables.rs:352:17:352:17 | 2 | | +| variables.rs:352:9:352:13 | x | variables.rs:353:5:353:25 | ExprStmt | match, no-match | +| variables.rs:352:17:352:17 | 2 | variables.rs:352:9:352:13 | x | | +| variables.rs:353:5:353:16 | PathExpr | variables.rs:353:23:353:23 | x | | +| variables.rs:353:5:353:24 | CallExpr | variables.rs:354:5:354:17 | ExprStmt | | +| variables.rs:353:5:353:25 | ExprStmt | variables.rs:353:5:353:16 | PathExpr | | +| variables.rs:353:18:353:23 | RefExpr | variables.rs:353:5:353:24 | CallExpr | | +| variables.rs:353:23:353:23 | x | variables.rs:353:18:353:23 | RefExpr | | +| variables.rs:354:5:354:13 | PathExpr | variables.rs:354:15:354:15 | x | | +| variables.rs:354:5:354:16 | CallExpr | variables.rs:351:17:355:1 | BlockExpr | | +| variables.rs:354:5:354:17 | ExprStmt | variables.rs:354:5:354:13 | PathExpr | | +| variables.rs:354:15:354:15 | x | variables.rs:354:5:354:16 | CallExpr | | +| variables.rs:357:1:383:1 | enter main | variables.rs:358:5:358:25 | ExprStmt | | +| variables.rs:357:1:383:1 | exit main (normal) | variables.rs:357:1:383:1 | exit main | | +| variables.rs:357:11:383:1 | BlockExpr | variables.rs:357:1:383:1 | exit main (normal) | | +| variables.rs:358:5:358:22 | PathExpr | variables.rs:358:5:358:24 | CallExpr | | +| variables.rs:358:5:358:24 | CallExpr | variables.rs:359:5:359:23 | ExprStmt | | +| variables.rs:358:5:358:25 | ExprStmt | variables.rs:358:5:358:22 | PathExpr | | +| variables.rs:359:5:359:20 | PathExpr | variables.rs:359:5:359:22 | CallExpr | | +| variables.rs:359:5:359:22 | CallExpr | variables.rs:360:5:360:23 | ExprStmt | | +| variables.rs:359:5:359:23 | ExprStmt | variables.rs:359:5:359:20 | PathExpr | | +| variables.rs:360:5:360:20 | PathExpr | variables.rs:360:5:360:22 | CallExpr | | +| variables.rs:360:5:360:22 | CallExpr | variables.rs:361:5:361:23 | ExprStmt | | +| variables.rs:360:5:360:23 | ExprStmt | variables.rs:360:5:360:20 | PathExpr | | +| variables.rs:361:5:361:20 | PathExpr | variables.rs:361:5:361:22 | CallExpr | | +| variables.rs:361:5:361:22 | CallExpr | variables.rs:362:5:362:19 | ExprStmt | | +| variables.rs:361:5:361:23 | ExprStmt | variables.rs:361:5:361:20 | PathExpr | | +| variables.rs:362:5:362:16 | PathExpr | variables.rs:362:5:362:18 | CallExpr | | +| variables.rs:362:5:362:18 | CallExpr | variables.rs:363:5:363:19 | ExprStmt | | +| variables.rs:362:5:362:19 | ExprStmt | variables.rs:362:5:362:16 | PathExpr | | +| variables.rs:363:5:363:16 | PathExpr | variables.rs:363:5:363:18 | CallExpr | | +| variables.rs:363:5:363:18 | CallExpr | variables.rs:364:5:364:19 | ExprStmt | | +| variables.rs:363:5:363:19 | ExprStmt | variables.rs:363:5:363:16 | PathExpr | | +| variables.rs:364:5:364:16 | PathExpr | variables.rs:364:5:364:18 | CallExpr | | +| variables.rs:364:5:364:18 | CallExpr | variables.rs:365:5:365:19 | ExprStmt | | +| variables.rs:364:5:364:19 | ExprStmt | variables.rs:364:5:364:16 | PathExpr | | +| variables.rs:365:5:365:16 | PathExpr | variables.rs:365:5:365:18 | CallExpr | | +| variables.rs:365:5:365:18 | CallExpr | variables.rs:366:5:366:21 | ExprStmt | | +| variables.rs:365:5:365:19 | ExprStmt | variables.rs:365:5:365:16 | PathExpr | | +| variables.rs:366:5:366:18 | PathExpr | variables.rs:366:5:366:20 | CallExpr | | +| variables.rs:366:5:366:20 | CallExpr | variables.rs:367:5:367:21 | ExprStmt | | +| variables.rs:366:5:366:21 | ExprStmt | variables.rs:366:5:366:18 | PathExpr | | +| variables.rs:367:5:367:18 | PathExpr | variables.rs:367:5:367:20 | CallExpr | | +| variables.rs:367:5:367:20 | CallExpr | variables.rs:368:5:368:21 | ExprStmt | | +| variables.rs:367:5:367:21 | ExprStmt | variables.rs:367:5:367:18 | PathExpr | | +| variables.rs:368:5:368:18 | PathExpr | variables.rs:368:5:368:20 | CallExpr | | +| variables.rs:368:5:368:20 | CallExpr | variables.rs:369:5:369:21 | ExprStmt | | +| variables.rs:368:5:368:21 | ExprStmt | variables.rs:368:5:368:18 | PathExpr | | +| variables.rs:369:5:369:18 | PathExpr | variables.rs:369:5:369:20 | CallExpr | | +| variables.rs:369:5:369:20 | CallExpr | variables.rs:370:5:370:21 | ExprStmt | | +| variables.rs:369:5:369:21 | ExprStmt | variables.rs:369:5:369:18 | PathExpr | | +| variables.rs:370:5:370:18 | PathExpr | variables.rs:370:5:370:20 | CallExpr | | +| variables.rs:370:5:370:20 | CallExpr | variables.rs:371:5:371:21 | ExprStmt | | +| variables.rs:370:5:370:21 | ExprStmt | variables.rs:370:5:370:18 | PathExpr | | +| variables.rs:371:5:371:18 | PathExpr | variables.rs:371:5:371:20 | CallExpr | | +| variables.rs:371:5:371:20 | CallExpr | variables.rs:372:5:372:21 | ExprStmt | | +| variables.rs:371:5:371:21 | ExprStmt | variables.rs:371:5:371:18 | PathExpr | | +| variables.rs:372:5:372:18 | PathExpr | variables.rs:372:5:372:20 | CallExpr | | +| variables.rs:372:5:372:20 | CallExpr | variables.rs:373:5:373:21 | ExprStmt | | +| variables.rs:372:5:372:21 | ExprStmt | variables.rs:372:5:372:18 | PathExpr | | +| variables.rs:373:5:373:18 | PathExpr | variables.rs:373:5:373:20 | CallExpr | | +| variables.rs:373:5:373:20 | CallExpr | variables.rs:374:5:374:21 | ExprStmt | | +| variables.rs:373:5:373:21 | ExprStmt | variables.rs:373:5:373:18 | PathExpr | | +| variables.rs:374:5:374:18 | PathExpr | variables.rs:374:5:374:20 | CallExpr | | +| variables.rs:374:5:374:20 | CallExpr | variables.rs:375:5:375:36 | ExprStmt | | +| variables.rs:374:5:374:21 | ExprStmt | variables.rs:374:5:374:18 | PathExpr | | +| variables.rs:375:5:375:18 | PathExpr | variables.rs:375:20:375:22 | "a" | | +| variables.rs:375:5:375:35 | CallExpr | variables.rs:376:5:376:37 | ExprStmt | | +| variables.rs:375:5:375:36 | ExprStmt | variables.rs:375:5:375:18 | PathExpr | | +| variables.rs:375:20:375:22 | "a" | variables.rs:375:26:375:28 | "b" | | +| variables.rs:375:25:375:34 | TupleExpr | variables.rs:375:5:375:35 | CallExpr | | +| variables.rs:375:26:375:28 | "b" | variables.rs:375:31:375:33 | "c" | | +| variables.rs:375:31:375:33 | "c" | variables.rs:375:25:375:34 | TupleExpr | | +| variables.rs:376:5:376:18 | PathExpr | variables.rs:376:20:376:31 | PathExpr | | +| variables.rs:376:5:376:36 | CallExpr | variables.rs:377:5:377:26 | ExprStmt | | +| variables.rs:376:5:376:37 | ExprStmt | variables.rs:376:5:376:18 | PathExpr | | +| variables.rs:376:20:376:31 | PathExpr | variables.rs:376:33:376:34 | 45 | | +| variables.rs:376:20:376:35 | CallExpr | variables.rs:376:5:376:36 | CallExpr | | +| variables.rs:376:33:376:34 | 45 | variables.rs:376:20:376:35 | CallExpr | | +| variables.rs:377:5:377:23 | PathExpr | variables.rs:377:5:377:25 | CallExpr | | +| variables.rs:377:5:377:25 | CallExpr | variables.rs:378:5:378:23 | ExprStmt | | +| variables.rs:377:5:377:26 | ExprStmt | variables.rs:377:5:377:23 | PathExpr | | +| variables.rs:378:5:378:20 | PathExpr | variables.rs:378:5:378:22 | CallExpr | | +| variables.rs:378:5:378:22 | CallExpr | variables.rs:379:5:379:19 | ExprStmt | | +| variables.rs:378:5:378:23 | ExprStmt | variables.rs:378:5:378:20 | PathExpr | | +| variables.rs:379:5:379:16 | PathExpr | variables.rs:379:5:379:18 | CallExpr | | +| variables.rs:379:5:379:18 | CallExpr | variables.rs:380:5:380:17 | ExprStmt | | +| variables.rs:379:5:379:19 | ExprStmt | variables.rs:379:5:379:16 | PathExpr | | +| variables.rs:380:5:380:14 | PathExpr | variables.rs:380:5:380:16 | CallExpr | | +| variables.rs:380:5:380:16 | CallExpr | variables.rs:381:5:381:13 | ExprStmt | | +| variables.rs:380:5:380:17 | ExprStmt | variables.rs:380:5:380:14 | PathExpr | | +| variables.rs:381:5:381:10 | PathExpr | variables.rs:381:5:381:12 | CallExpr | | +| variables.rs:381:5:381:12 | CallExpr | variables.rs:382:5:382:17 | ExprStmt | | +| variables.rs:381:5:381:13 | ExprStmt | variables.rs:381:5:381:10 | PathExpr | | +| variables.rs:382:5:382:14 | PathExpr | variables.rs:382:5:382:16 | CallExpr | | +| variables.rs:382:5:382:16 | CallExpr | variables.rs:357:11:383:1 | BlockExpr | | +| variables.rs:382:5:382:17 | ExprStmt | variables.rs:382:5:382:14 | PathExpr | | breakTarget continueTarget diff --git a/rust/ql/test/library-tests/variables/variables.expected b/rust/ql/test/library-tests/variables/variables.expected index ad85ccfbfcc8..807fc9ff8919 100644 --- a/rust/ql/test/library-tests/variables/variables.expected +++ b/rust/ql/test/library-tests/variables/variables.expected @@ -1,261 +1,308 @@ testFailures +| variables.rs:331:5:331:5 | a | Unexpected result: read_access=a | +| variables.rs:331:5:331:5 | a | Unexpected result: write_access=a | +| variables.rs:331:13:331:25 | Comment | Missing result:access=a | +| variables.rs:333:11:333:11 | a | Unexpected result: read_access=a | +| variables.rs:333:30:333:42 | Comment | Missing result:access=a | +| variables.rs:340:14:340:14 | i | Unexpected result: read_access=i | +| variables.rs:340:17:340:29 | Comment | Missing result:access=i | +| variables.rs:341:6:341:10 | ref_i | Unexpected result: write_access=ref_i | +| variables.rs:341:17:341:38 | Comment | Missing result:read_access=ref_i | +| variables.rs:346:6:346:6 | x | Unexpected result: write_access=x | +| variables.rs:346:10:346:27 | Comment | Missing result:read_access=x | +| variables.rs:353:23:353:23 | x | Unexpected result: read_access=x | +| variables.rs:353:27:353:39 | Comment | Missing result:access=x | failures variable -| variables.rs:1:14:1:14 | s | -| variables.rs:5:14:5:14 | i | -| variables.rs:10:9:10:10 | x1 | -| variables.rs:15:13:15:14 | x2 | -| variables.rs:22:9:22:10 | x3 | +| variables.rs:3:14:3:14 | s | +| variables.rs:7:14:7:14 | i | +| variables.rs:12:9:12:10 | x1 | +| variables.rs:17:13:17:14 | x2 | | variables.rs:24:9:24:10 | x3 | -| variables.rs:30:9:30:10 | x4 | -| variables.rs:33:13:33:14 | x4 | -| variables.rs:47:13:47:14 | a1 | -| variables.rs:48:13:48:14 | b1 | -| variables.rs:51:13:51:13 | x | -| variables.rs:52:13:52:13 | y | -| variables.rs:62:9:62:10 | p1 | -| variables.rs:64:12:64:13 | a2 | -| variables.rs:65:12:65:13 | b2 | -| variables.rs:72:9:72:10 | s1 | -| variables.rs:74:21:74:22 | s2 | -| variables.rs:81:14:81:15 | x5 | -| variables.rs:89:9:89:10 | s1 | -| variables.rs:91:24:91:25 | s2 | -| variables.rs:98:9:98:10 | x6 | -| variables.rs:99:9:99:10 | y1 | -| variables.rs:103:14:103:15 | y1 | -| variables.rs:108:9:108:12 | None | -| variables.rs:115:9:115:15 | numbers | -| variables.rs:119:13:119:17 | first | -| variables.rs:120:13:120:17 | third | -| variables.rs:121:13:121:17 | fifth | -| variables.rs:131:13:131:17 | first | -| variables.rs:133:13:133:16 | last | -| variables.rs:142:9:142:10 | p2 | -| variables.rs:146:16:146:17 | x7 | -| variables.rs:156:9:156:11 | msg | -| variables.rs:160:17:160:27 | id_variable | -| variables.rs:165:26:165:27 | id | -| variables.rs:176:9:176:14 | either | -| variables.rs:178:9:178:44 | a3 | -| variables.rs:190:9:190:10 | tv | -| variables.rs:192:9:192:81 | a4 | -| variables.rs:196:9:196:83 | a5 | -| variables.rs:200:9:200:83 | a6 | -| variables.rs:206:9:206:14 | either | -| variables.rs:208:9:208:44 | a7 | -| variables.rs:216:9:216:14 | either | -| variables.rs:219:13:219:13 | e | -| variables.rs:220:14:220:51 | a11 | -| variables.rs:223:33:223:35 | a12 | -| variables.rs:240:9:240:10 | fv | -| variables.rs:242:9:242:109 | a13 | -| variables.rs:248:5:248:6 | a8 | -| variables.rs:250:9:250:10 | b3 | -| variables.rs:251:9:251:10 | c1 | -| variables.rs:259:6:259:41 | a9 | -| variables.rs:266:13:266:15 | a10 | -| variables.rs:267:13:267:14 | b4 | -| variables.rs:268:13:268:14 | c2 | -| variables.rs:289:13:289:15 | a10 | -| variables.rs:290:13:290:14 | b4 | -| variables.rs:302:9:302:23 | example_closure | -| variables.rs:303:10:303:10 | x | -| variables.rs:305:9:305:10 | n1 | -| variables.rs:310:9:310:26 | immutable_variable | -| variables.rs:311:10:311:10 | x | -| variables.rs:313:9:313:10 | n2 | -| variables.rs:319:9:319:9 | v | -| variables.rs:321:9:321:12 | text | +| variables.rs:26:9:26:10 | x3 | +| variables.rs:32:9:32:10 | x4 | +| variables.rs:35:13:35:14 | x4 | +| variables.rs:49:13:49:14 | a1 | +| variables.rs:50:13:50:14 | b1 | +| variables.rs:53:13:53:13 | x | +| variables.rs:54:13:54:13 | y | +| variables.rs:64:9:64:10 | p1 | +| variables.rs:66:12:66:13 | a2 | +| variables.rs:67:12:67:13 | b2 | +| variables.rs:74:9:74:10 | s1 | +| variables.rs:76:21:76:22 | s2 | +| variables.rs:83:14:83:15 | x5 | +| variables.rs:91:9:91:10 | s1 | +| variables.rs:93:24:93:25 | s2 | +| variables.rs:100:9:100:10 | x6 | +| variables.rs:101:9:101:10 | y1 | +| variables.rs:105:14:105:15 | y1 | +| variables.rs:110:9:110:12 | None | +| variables.rs:117:9:117:15 | numbers | +| variables.rs:121:13:121:17 | first | +| variables.rs:122:13:122:17 | third | +| variables.rs:123:13:123:17 | fifth | +| variables.rs:133:13:133:17 | first | +| variables.rs:135:13:135:16 | last | +| variables.rs:144:9:144:10 | p2 | +| variables.rs:148:16:148:17 | x7 | +| variables.rs:158:9:158:11 | msg | +| variables.rs:162:17:162:27 | id_variable | +| variables.rs:167:26:167:27 | id | +| variables.rs:178:9:178:14 | either | +| variables.rs:180:9:180:44 | a3 | +| variables.rs:192:9:192:10 | tv | +| variables.rs:194:9:194:81 | a4 | +| variables.rs:198:9:198:83 | a5 | +| variables.rs:202:9:202:83 | a6 | +| variables.rs:208:9:208:14 | either | +| variables.rs:210:9:210:44 | a7 | +| variables.rs:218:9:218:14 | either | +| variables.rs:221:13:221:13 | e | +| variables.rs:222:14:222:51 | a11 | +| variables.rs:225:33:225:35 | a12 | +| variables.rs:242:9:242:10 | fv | +| variables.rs:244:9:244:109 | a13 | +| variables.rs:250:5:250:6 | a8 | +| variables.rs:252:9:252:10 | b3 | +| variables.rs:253:9:253:10 | c1 | +| variables.rs:261:6:261:41 | a9 | +| variables.rs:268:13:268:15 | a10 | +| variables.rs:269:13:269:14 | b4 | +| variables.rs:270:13:270:14 | c2 | +| variables.rs:291:13:291:15 | a10 | +| variables.rs:292:13:292:14 | b4 | +| variables.rs:304:9:304:23 | example_closure | +| variables.rs:305:10:305:10 | x | +| variables.rs:307:9:307:10 | n1 | +| variables.rs:312:9:312:26 | immutable_variable | +| variables.rs:313:10:313:10 | x | +| variables.rs:315:9:315:10 | n2 | +| variables.rs:321:9:321:9 | v | +| variables.rs:323:9:323:12 | text | +| variables.rs:330:13:330:13 | a | +| variables.rs:338:13:338:13 | i | +| variables.rs:339:9:339:13 | ref_i | +| variables.rs:345:17:345:17 | x | +| variables.rs:352:13:352:13 | x | variableAccess -| variables.rs:11:15:11:16 | x1 | variables.rs:10:9:10:10 | x1 | -| variables.rs:16:15:16:16 | x2 | variables.rs:15:13:15:14 | x2 | -| variables.rs:17:5:17:6 | x2 | variables.rs:15:13:15:14 | x2 | -| variables.rs:18:15:18:16 | x2 | variables.rs:15:13:15:14 | x2 | -| variables.rs:23:15:23:16 | x3 | variables.rs:22:9:22:10 | x3 | -| variables.rs:25:9:25:10 | x3 | variables.rs:22:9:22:10 | x3 | -| variables.rs:26:15:26:16 | x3 | variables.rs:24:9:24:10 | x3 | -| variables.rs:31:15:31:16 | x4 | variables.rs:30:9:30:10 | x4 | -| variables.rs:34:19:34:20 | x4 | variables.rs:33:13:33:14 | x4 | -| variables.rs:36:15:36:16 | x4 | variables.rs:30:9:30:10 | x4 | -| variables.rs:55:15:55:16 | a1 | variables.rs:47:13:47:14 | a1 | -| variables.rs:56:15:56:16 | b1 | variables.rs:48:13:48:14 | b1 | -| variables.rs:57:15:57:15 | x | variables.rs:51:13:51:13 | x | -| variables.rs:58:15:58:15 | y | variables.rs:52:13:52:13 | y | -| variables.rs:66:9:66:10 | p1 | variables.rs:62:9:62:10 | p1 | -| variables.rs:67:15:67:16 | a2 | variables.rs:64:12:64:13 | a2 | -| variables.rs:68:15:68:16 | b2 | variables.rs:65:12:65:13 | b2 | -| variables.rs:75:11:75:12 | s1 | variables.rs:72:9:72:10 | s1 | -| variables.rs:76:19:76:20 | s2 | variables.rs:74:21:74:22 | s2 | -| variables.rs:85:15:85:16 | x5 | variables.rs:81:14:81:15 | x5 | -| variables.rs:92:11:92:12 | s1 | variables.rs:89:9:89:10 | s1 | -| variables.rs:93:19:93:20 | s2 | variables.rs:91:24:91:25 | s2 | -| variables.rs:101:11:101:12 | x6 | variables.rs:98:9:98:10 | x6 | -| variables.rs:106:23:106:24 | y1 | variables.rs:103:14:103:15 | y1 | -| variables.rs:111:15:111:16 | y1 | variables.rs:99:9:99:10 | y1 | -| variables.rs:117:11:117:17 | numbers | variables.rs:115:9:115:15 | numbers | -| variables.rs:123:23:123:27 | first | variables.rs:119:13:119:17 | first | -| variables.rs:124:23:124:27 | third | variables.rs:120:13:120:17 | third | -| variables.rs:125:23:125:27 | fifth | variables.rs:121:13:121:17 | fifth | -| variables.rs:129:11:129:17 | numbers | variables.rs:115:9:115:15 | numbers | -| variables.rs:135:23:135:27 | first | variables.rs:131:13:131:17 | first | -| variables.rs:136:23:136:26 | last | variables.rs:133:13:133:16 | last | -| variables.rs:144:11:144:12 | p2 | variables.rs:142:9:142:10 | p2 | -| variables.rs:147:24:147:25 | x7 | variables.rs:146:16:146:17 | x7 | -| variables.rs:158:11:158:13 | msg | variables.rs:156:9:156:11 | msg | -| variables.rs:161:24:161:34 | id_variable | variables.rs:160:17:160:27 | id_variable | -| variables.rs:166:23:166:24 | id | variables.rs:165:26:165:27 | id | -| variables.rs:177:11:177:16 | either | variables.rs:176:9:176:14 | either | -| variables.rs:179:26:179:27 | a3 | variables.rs:178:9:178:44 | a3 | -| variables.rs:191:11:191:12 | tv | variables.rs:190:9:190:10 | tv | -| variables.rs:193:26:193:27 | a4 | variables.rs:192:9:192:81 | a4 | -| variables.rs:195:11:195:12 | tv | variables.rs:190:9:190:10 | tv | -| variables.rs:197:26:197:27 | a5 | variables.rs:196:9:196:83 | a5 | -| variables.rs:199:11:199:12 | tv | variables.rs:190:9:190:10 | tv | -| variables.rs:201:26:201:27 | a6 | variables.rs:200:9:200:83 | a6 | -| variables.rs:207:11:207:16 | either | variables.rs:206:9:206:14 | either | -| variables.rs:209:16:209:17 | a7 | variables.rs:208:9:208:44 | a7 | -| variables.rs:210:26:210:27 | a7 | variables.rs:208:9:208:44 | a7 | -| variables.rs:218:11:218:16 | either | variables.rs:216:9:216:14 | either | -| variables.rs:222:23:222:25 | a11 | variables.rs:220:14:220:51 | a11 | -| variables.rs:224:15:224:15 | e | variables.rs:219:13:219:13 | e | -| variables.rs:225:28:225:30 | a12 | variables.rs:223:33:223:35 | a12 | -| variables.rs:241:11:241:12 | fv | variables.rs:240:9:240:10 | fv | -| variables.rs:243:26:243:28 | a13 | variables.rs:242:9:242:109 | a13 | -| variables.rs:253:15:253:16 | a8 | variables.rs:248:5:248:6 | a8 | -| variables.rs:254:15:254:16 | b3 | variables.rs:250:9:250:10 | b3 | -| variables.rs:255:15:255:16 | c1 | variables.rs:251:9:251:10 | c1 | -| variables.rs:261:15:261:16 | a9 | variables.rs:259:6:259:41 | a9 | -| variables.rs:270:15:270:17 | a10 | variables.rs:266:13:266:15 | a10 | -| variables.rs:271:15:271:16 | b4 | variables.rs:267:13:267:14 | b4 | -| variables.rs:272:15:272:16 | c2 | variables.rs:268:13:268:14 | c2 | -| variables.rs:275:9:275:10 | c2 | variables.rs:268:13:268:14 | c2 | -| variables.rs:276:9:276:10 | b4 | variables.rs:267:13:267:14 | b4 | -| variables.rs:277:9:277:11 | a10 | variables.rs:266:13:266:15 | a10 | -| variables.rs:279:9:279:11 | a10 | variables.rs:266:13:266:15 | a10 | -| variables.rs:280:9:280:10 | b4 | variables.rs:267:13:267:14 | b4 | -| variables.rs:281:9:281:10 | c2 | variables.rs:268:13:268:14 | c2 | -| variables.rs:283:15:283:17 | a10 | variables.rs:266:13:266:15 | a10 | -| variables.rs:284:15:284:16 | b4 | variables.rs:267:13:267:14 | b4 | -| variables.rs:285:15:285:16 | c2 | variables.rs:268:13:268:14 | c2 | -| variables.rs:292:23:292:25 | a10 | variables.rs:289:13:289:15 | a10 | -| variables.rs:293:23:293:24 | b4 | variables.rs:290:13:290:14 | b4 | -| variables.rs:297:15:297:17 | a10 | variables.rs:266:13:266:15 | a10 | -| variables.rs:298:15:298:16 | b4 | variables.rs:267:13:267:14 | b4 | -| variables.rs:304:9:304:9 | x | variables.rs:303:10:303:10 | x | -| variables.rs:306:9:306:23 | example_closure | variables.rs:302:9:302:23 | example_closure | -| variables.rs:307:15:307:16 | n1 | variables.rs:305:9:305:10 | n1 | -| variables.rs:312:9:312:9 | x | variables.rs:311:10:311:10 | x | -| variables.rs:314:9:314:26 | immutable_variable | variables.rs:310:9:310:26 | immutable_variable | -| variables.rs:315:15:315:16 | n2 | variables.rs:313:9:313:10 | n2 | -| variables.rs:322:12:322:12 | v | variables.rs:319:9:319:9 | v | -| variables.rs:323:19:323:22 | text | variables.rs:321:9:321:12 | text | +| variables.rs:13:15:13:16 | x1 | variables.rs:12:9:12:10 | x1 | +| variables.rs:18:15:18:16 | x2 | variables.rs:17:13:17:14 | x2 | +| variables.rs:19:5:19:6 | x2 | variables.rs:17:13:17:14 | x2 | +| variables.rs:20:15:20:16 | x2 | variables.rs:17:13:17:14 | x2 | +| variables.rs:25:15:25:16 | x3 | variables.rs:24:9:24:10 | x3 | +| variables.rs:27:9:27:10 | x3 | variables.rs:24:9:24:10 | x3 | +| variables.rs:28:15:28:16 | x3 | variables.rs:26:9:26:10 | x3 | +| variables.rs:33:15:33:16 | x4 | variables.rs:32:9:32:10 | x4 | +| variables.rs:36:19:36:20 | x4 | variables.rs:35:13:35:14 | x4 | +| variables.rs:38:15:38:16 | x4 | variables.rs:32:9:32:10 | x4 | +| variables.rs:57:15:57:16 | a1 | variables.rs:49:13:49:14 | a1 | +| variables.rs:58:15:58:16 | b1 | variables.rs:50:13:50:14 | b1 | +| variables.rs:59:15:59:15 | x | variables.rs:53:13:53:13 | x | +| variables.rs:60:15:60:15 | y | variables.rs:54:13:54:13 | y | +| variables.rs:68:9:68:10 | p1 | variables.rs:64:9:64:10 | p1 | +| variables.rs:69:15:69:16 | a2 | variables.rs:66:12:66:13 | a2 | +| variables.rs:70:15:70:16 | b2 | variables.rs:67:12:67:13 | b2 | +| variables.rs:77:11:77:12 | s1 | variables.rs:74:9:74:10 | s1 | +| variables.rs:78:19:78:20 | s2 | variables.rs:76:21:76:22 | s2 | +| variables.rs:87:15:87:16 | x5 | variables.rs:83:14:83:15 | x5 | +| variables.rs:94:11:94:12 | s1 | variables.rs:91:9:91:10 | s1 | +| variables.rs:95:19:95:20 | s2 | variables.rs:93:24:93:25 | s2 | +| variables.rs:103:11:103:12 | x6 | variables.rs:100:9:100:10 | x6 | +| variables.rs:108:23:108:24 | y1 | variables.rs:105:14:105:15 | y1 | +| variables.rs:113:15:113:16 | y1 | variables.rs:101:9:101:10 | y1 | +| variables.rs:119:11:119:17 | numbers | variables.rs:117:9:117:15 | numbers | +| variables.rs:125:23:125:27 | first | variables.rs:121:13:121:17 | first | +| variables.rs:126:23:126:27 | third | variables.rs:122:13:122:17 | third | +| variables.rs:127:23:127:27 | fifth | variables.rs:123:13:123:17 | fifth | +| variables.rs:131:11:131:17 | numbers | variables.rs:117:9:117:15 | numbers | +| variables.rs:137:23:137:27 | first | variables.rs:133:13:133:17 | first | +| variables.rs:138:23:138:26 | last | variables.rs:135:13:135:16 | last | +| variables.rs:146:11:146:12 | p2 | variables.rs:144:9:144:10 | p2 | +| variables.rs:149:24:149:25 | x7 | variables.rs:148:16:148:17 | x7 | +| variables.rs:160:11:160:13 | msg | variables.rs:158:9:158:11 | msg | +| variables.rs:163:24:163:34 | id_variable | variables.rs:162:17:162:27 | id_variable | +| variables.rs:168:23:168:24 | id | variables.rs:167:26:167:27 | id | +| variables.rs:179:11:179:16 | either | variables.rs:178:9:178:14 | either | +| variables.rs:181:26:181:27 | a3 | variables.rs:180:9:180:44 | a3 | +| variables.rs:193:11:193:12 | tv | variables.rs:192:9:192:10 | tv | +| variables.rs:195:26:195:27 | a4 | variables.rs:194:9:194:81 | a4 | +| variables.rs:197:11:197:12 | tv | variables.rs:192:9:192:10 | tv | +| variables.rs:199:26:199:27 | a5 | variables.rs:198:9:198:83 | a5 | +| variables.rs:201:11:201:12 | tv | variables.rs:192:9:192:10 | tv | +| variables.rs:203:26:203:27 | a6 | variables.rs:202:9:202:83 | a6 | +| variables.rs:209:11:209:16 | either | variables.rs:208:9:208:14 | either | +| variables.rs:211:16:211:17 | a7 | variables.rs:210:9:210:44 | a7 | +| variables.rs:212:26:212:27 | a7 | variables.rs:210:9:210:44 | a7 | +| variables.rs:220:11:220:16 | either | variables.rs:218:9:218:14 | either | +| variables.rs:224:23:224:25 | a11 | variables.rs:222:14:222:51 | a11 | +| variables.rs:226:15:226:15 | e | variables.rs:221:13:221:13 | e | +| variables.rs:227:28:227:30 | a12 | variables.rs:225:33:225:35 | a12 | +| variables.rs:243:11:243:12 | fv | variables.rs:242:9:242:10 | fv | +| variables.rs:245:26:245:28 | a13 | variables.rs:244:9:244:109 | a13 | +| variables.rs:255:15:255:16 | a8 | variables.rs:250:5:250:6 | a8 | +| variables.rs:256:15:256:16 | b3 | variables.rs:252:9:252:10 | b3 | +| variables.rs:257:15:257:16 | c1 | variables.rs:253:9:253:10 | c1 | +| variables.rs:263:15:263:16 | a9 | variables.rs:261:6:261:41 | a9 | +| variables.rs:272:15:272:17 | a10 | variables.rs:268:13:268:15 | a10 | +| variables.rs:273:15:273:16 | b4 | variables.rs:269:13:269:14 | b4 | +| variables.rs:274:15:274:16 | c2 | variables.rs:270:13:270:14 | c2 | +| variables.rs:277:9:277:10 | c2 | variables.rs:270:13:270:14 | c2 | +| variables.rs:278:9:278:10 | b4 | variables.rs:269:13:269:14 | b4 | +| variables.rs:279:9:279:11 | a10 | variables.rs:268:13:268:15 | a10 | +| variables.rs:281:9:281:11 | a10 | variables.rs:268:13:268:15 | a10 | +| variables.rs:282:9:282:10 | b4 | variables.rs:269:13:269:14 | b4 | +| variables.rs:283:9:283:10 | c2 | variables.rs:270:13:270:14 | c2 | +| variables.rs:285:15:285:17 | a10 | variables.rs:268:13:268:15 | a10 | +| variables.rs:286:15:286:16 | b4 | variables.rs:269:13:269:14 | b4 | +| variables.rs:287:15:287:16 | c2 | variables.rs:270:13:270:14 | c2 | +| variables.rs:294:23:294:25 | a10 | variables.rs:291:13:291:15 | a10 | +| variables.rs:295:23:295:24 | b4 | variables.rs:292:13:292:14 | b4 | +| variables.rs:299:15:299:17 | a10 | variables.rs:268:13:268:15 | a10 | +| variables.rs:300:15:300:16 | b4 | variables.rs:269:13:269:14 | b4 | +| variables.rs:306:9:306:9 | x | variables.rs:305:10:305:10 | x | +| variables.rs:308:9:308:23 | example_closure | variables.rs:304:9:304:23 | example_closure | +| variables.rs:309:15:309:16 | n1 | variables.rs:307:9:307:10 | n1 | +| variables.rs:314:9:314:9 | x | variables.rs:313:10:313:10 | x | +| variables.rs:316:9:316:26 | immutable_variable | variables.rs:312:9:312:26 | immutable_variable | +| variables.rs:317:15:317:16 | n2 | variables.rs:315:9:315:10 | n2 | +| variables.rs:324:12:324:12 | v | variables.rs:321:9:321:9 | v | +| variables.rs:325:19:325:22 | text | variables.rs:323:9:323:12 | text | +| variables.rs:331:5:331:5 | a | variables.rs:330:13:330:13 | a | +| variables.rs:332:15:332:15 | a | variables.rs:330:13:330:13 | a | +| variables.rs:333:11:333:11 | a | variables.rs:330:13:330:13 | a | +| variables.rs:334:15:334:15 | a | variables.rs:330:13:330:13 | a | +| variables.rs:340:14:340:14 | i | variables.rs:338:13:338:13 | i | +| variables.rs:341:6:341:10 | ref_i | variables.rs:339:9:339:13 | ref_i | +| variables.rs:342:15:342:15 | i | variables.rs:338:13:338:13 | i | +| variables.rs:346:6:346:6 | x | variables.rs:345:17:345:17 | x | +| variables.rs:347:10:347:10 | x | variables.rs:345:17:345:17 | x | +| variables.rs:348:10:348:10 | x | variables.rs:345:17:345:17 | x | +| variables.rs:353:23:353:23 | x | variables.rs:352:13:352:13 | x | +| variables.rs:354:15:354:15 | x | variables.rs:352:13:352:13 | x | variableWriteAccess -| variables.rs:17:5:17:6 | x2 | variables.rs:15:13:15:14 | x2 | -| variables.rs:275:9:275:10 | c2 | variables.rs:268:13:268:14 | c2 | -| variables.rs:276:9:276:10 | b4 | variables.rs:267:13:267:14 | b4 | -| variables.rs:277:9:277:11 | a10 | variables.rs:266:13:266:15 | a10 | +| variables.rs:19:5:19:6 | x2 | variables.rs:17:13:17:14 | x2 | +| variables.rs:277:9:277:10 | c2 | variables.rs:270:13:270:14 | c2 | +| variables.rs:278:9:278:10 | b4 | variables.rs:269:13:269:14 | b4 | +| variables.rs:279:9:279:11 | a10 | variables.rs:268:13:268:15 | a10 | +| variables.rs:331:5:331:5 | a | variables.rs:330:13:330:13 | a | +| variables.rs:341:6:341:10 | ref_i | variables.rs:339:9:339:13 | ref_i | +| variables.rs:346:6:346:6 | x | variables.rs:345:17:345:17 | x | variableReadAccess -| variables.rs:11:15:11:16 | x1 | variables.rs:10:9:10:10 | x1 | -| variables.rs:16:15:16:16 | x2 | variables.rs:15:13:15:14 | x2 | -| variables.rs:18:15:18:16 | x2 | variables.rs:15:13:15:14 | x2 | -| variables.rs:23:15:23:16 | x3 | variables.rs:22:9:22:10 | x3 | -| variables.rs:25:9:25:10 | x3 | variables.rs:22:9:22:10 | x3 | -| variables.rs:26:15:26:16 | x3 | variables.rs:24:9:24:10 | x3 | -| variables.rs:31:15:31:16 | x4 | variables.rs:30:9:30:10 | x4 | -| variables.rs:34:19:34:20 | x4 | variables.rs:33:13:33:14 | x4 | -| variables.rs:36:15:36:16 | x4 | variables.rs:30:9:30:10 | x4 | -| variables.rs:55:15:55:16 | a1 | variables.rs:47:13:47:14 | a1 | -| variables.rs:56:15:56:16 | b1 | variables.rs:48:13:48:14 | b1 | -| variables.rs:57:15:57:15 | x | variables.rs:51:13:51:13 | x | -| variables.rs:58:15:58:15 | y | variables.rs:52:13:52:13 | y | -| variables.rs:66:9:66:10 | p1 | variables.rs:62:9:62:10 | p1 | -| variables.rs:67:15:67:16 | a2 | variables.rs:64:12:64:13 | a2 | -| variables.rs:68:15:68:16 | b2 | variables.rs:65:12:65:13 | b2 | -| variables.rs:75:11:75:12 | s1 | variables.rs:72:9:72:10 | s1 | -| variables.rs:76:19:76:20 | s2 | variables.rs:74:21:74:22 | s2 | -| variables.rs:85:15:85:16 | x5 | variables.rs:81:14:81:15 | x5 | -| variables.rs:92:11:92:12 | s1 | variables.rs:89:9:89:10 | s1 | -| variables.rs:93:19:93:20 | s2 | variables.rs:91:24:91:25 | s2 | -| variables.rs:101:11:101:12 | x6 | variables.rs:98:9:98:10 | x6 | -| variables.rs:106:23:106:24 | y1 | variables.rs:103:14:103:15 | y1 | -| variables.rs:111:15:111:16 | y1 | variables.rs:99:9:99:10 | y1 | -| variables.rs:117:11:117:17 | numbers | variables.rs:115:9:115:15 | numbers | -| variables.rs:123:23:123:27 | first | variables.rs:119:13:119:17 | first | -| variables.rs:124:23:124:27 | third | variables.rs:120:13:120:17 | third | -| variables.rs:125:23:125:27 | fifth | variables.rs:121:13:121:17 | fifth | -| variables.rs:129:11:129:17 | numbers | variables.rs:115:9:115:15 | numbers | -| variables.rs:135:23:135:27 | first | variables.rs:131:13:131:17 | first | -| variables.rs:136:23:136:26 | last | variables.rs:133:13:133:16 | last | -| variables.rs:144:11:144:12 | p2 | variables.rs:142:9:142:10 | p2 | -| variables.rs:147:24:147:25 | x7 | variables.rs:146:16:146:17 | x7 | -| variables.rs:158:11:158:13 | msg | variables.rs:156:9:156:11 | msg | -| variables.rs:161:24:161:34 | id_variable | variables.rs:160:17:160:27 | id_variable | -| variables.rs:166:23:166:24 | id | variables.rs:165:26:165:27 | id | -| variables.rs:177:11:177:16 | either | variables.rs:176:9:176:14 | either | -| variables.rs:179:26:179:27 | a3 | variables.rs:178:9:178:44 | a3 | -| variables.rs:191:11:191:12 | tv | variables.rs:190:9:190:10 | tv | -| variables.rs:193:26:193:27 | a4 | variables.rs:192:9:192:81 | a4 | -| variables.rs:195:11:195:12 | tv | variables.rs:190:9:190:10 | tv | -| variables.rs:197:26:197:27 | a5 | variables.rs:196:9:196:83 | a5 | -| variables.rs:199:11:199:12 | tv | variables.rs:190:9:190:10 | tv | -| variables.rs:201:26:201:27 | a6 | variables.rs:200:9:200:83 | a6 | -| variables.rs:207:11:207:16 | either | variables.rs:206:9:206:14 | either | -| variables.rs:209:16:209:17 | a7 | variables.rs:208:9:208:44 | a7 | -| variables.rs:210:26:210:27 | a7 | variables.rs:208:9:208:44 | a7 | -| variables.rs:218:11:218:16 | either | variables.rs:216:9:216:14 | either | -| variables.rs:222:23:222:25 | a11 | variables.rs:220:14:220:51 | a11 | -| variables.rs:224:15:224:15 | e | variables.rs:219:13:219:13 | e | -| variables.rs:225:28:225:30 | a12 | variables.rs:223:33:223:35 | a12 | -| variables.rs:241:11:241:12 | fv | variables.rs:240:9:240:10 | fv | -| variables.rs:243:26:243:28 | a13 | variables.rs:242:9:242:109 | a13 | -| variables.rs:253:15:253:16 | a8 | variables.rs:248:5:248:6 | a8 | -| variables.rs:254:15:254:16 | b3 | variables.rs:250:9:250:10 | b3 | -| variables.rs:255:15:255:16 | c1 | variables.rs:251:9:251:10 | c1 | -| variables.rs:261:15:261:16 | a9 | variables.rs:259:6:259:41 | a9 | -| variables.rs:270:15:270:17 | a10 | variables.rs:266:13:266:15 | a10 | -| variables.rs:271:15:271:16 | b4 | variables.rs:267:13:267:14 | b4 | -| variables.rs:272:15:272:16 | c2 | variables.rs:268:13:268:14 | c2 | -| variables.rs:279:9:279:11 | a10 | variables.rs:266:13:266:15 | a10 | -| variables.rs:280:9:280:10 | b4 | variables.rs:267:13:267:14 | b4 | -| variables.rs:281:9:281:10 | c2 | variables.rs:268:13:268:14 | c2 | -| variables.rs:283:15:283:17 | a10 | variables.rs:266:13:266:15 | a10 | -| variables.rs:284:15:284:16 | b4 | variables.rs:267:13:267:14 | b4 | -| variables.rs:285:15:285:16 | c2 | variables.rs:268:13:268:14 | c2 | -| variables.rs:292:23:292:25 | a10 | variables.rs:289:13:289:15 | a10 | -| variables.rs:293:23:293:24 | b4 | variables.rs:290:13:290:14 | b4 | -| variables.rs:297:15:297:17 | a10 | variables.rs:266:13:266:15 | a10 | -| variables.rs:298:15:298:16 | b4 | variables.rs:267:13:267:14 | b4 | -| variables.rs:304:9:304:9 | x | variables.rs:303:10:303:10 | x | -| variables.rs:306:9:306:23 | example_closure | variables.rs:302:9:302:23 | example_closure | -| variables.rs:307:15:307:16 | n1 | variables.rs:305:9:305:10 | n1 | -| variables.rs:312:9:312:9 | x | variables.rs:311:10:311:10 | x | -| variables.rs:314:9:314:26 | immutable_variable | variables.rs:310:9:310:26 | immutable_variable | -| variables.rs:315:15:315:16 | n2 | variables.rs:313:9:313:10 | n2 | -| variables.rs:322:12:322:12 | v | variables.rs:319:9:319:9 | v | -| variables.rs:323:19:323:22 | text | variables.rs:321:9:321:12 | text | +| variables.rs:13:15:13:16 | x1 | variables.rs:12:9:12:10 | x1 | +| variables.rs:18:15:18:16 | x2 | variables.rs:17:13:17:14 | x2 | +| variables.rs:20:15:20:16 | x2 | variables.rs:17:13:17:14 | x2 | +| variables.rs:25:15:25:16 | x3 | variables.rs:24:9:24:10 | x3 | +| variables.rs:27:9:27:10 | x3 | variables.rs:24:9:24:10 | x3 | +| variables.rs:28:15:28:16 | x3 | variables.rs:26:9:26:10 | x3 | +| variables.rs:33:15:33:16 | x4 | variables.rs:32:9:32:10 | x4 | +| variables.rs:36:19:36:20 | x4 | variables.rs:35:13:35:14 | x4 | +| variables.rs:38:15:38:16 | x4 | variables.rs:32:9:32:10 | x4 | +| variables.rs:57:15:57:16 | a1 | variables.rs:49:13:49:14 | a1 | +| variables.rs:58:15:58:16 | b1 | variables.rs:50:13:50:14 | b1 | +| variables.rs:59:15:59:15 | x | variables.rs:53:13:53:13 | x | +| variables.rs:60:15:60:15 | y | variables.rs:54:13:54:13 | y | +| variables.rs:68:9:68:10 | p1 | variables.rs:64:9:64:10 | p1 | +| variables.rs:69:15:69:16 | a2 | variables.rs:66:12:66:13 | a2 | +| variables.rs:70:15:70:16 | b2 | variables.rs:67:12:67:13 | b2 | +| variables.rs:77:11:77:12 | s1 | variables.rs:74:9:74:10 | s1 | +| variables.rs:78:19:78:20 | s2 | variables.rs:76:21:76:22 | s2 | +| variables.rs:87:15:87:16 | x5 | variables.rs:83:14:83:15 | x5 | +| variables.rs:94:11:94:12 | s1 | variables.rs:91:9:91:10 | s1 | +| variables.rs:95:19:95:20 | s2 | variables.rs:93:24:93:25 | s2 | +| variables.rs:103:11:103:12 | x6 | variables.rs:100:9:100:10 | x6 | +| variables.rs:108:23:108:24 | y1 | variables.rs:105:14:105:15 | y1 | +| variables.rs:113:15:113:16 | y1 | variables.rs:101:9:101:10 | y1 | +| variables.rs:119:11:119:17 | numbers | variables.rs:117:9:117:15 | numbers | +| variables.rs:125:23:125:27 | first | variables.rs:121:13:121:17 | first | +| variables.rs:126:23:126:27 | third | variables.rs:122:13:122:17 | third | +| variables.rs:127:23:127:27 | fifth | variables.rs:123:13:123:17 | fifth | +| variables.rs:131:11:131:17 | numbers | variables.rs:117:9:117:15 | numbers | +| variables.rs:137:23:137:27 | first | variables.rs:133:13:133:17 | first | +| variables.rs:138:23:138:26 | last | variables.rs:135:13:135:16 | last | +| variables.rs:146:11:146:12 | p2 | variables.rs:144:9:144:10 | p2 | +| variables.rs:149:24:149:25 | x7 | variables.rs:148:16:148:17 | x7 | +| variables.rs:160:11:160:13 | msg | variables.rs:158:9:158:11 | msg | +| variables.rs:163:24:163:34 | id_variable | variables.rs:162:17:162:27 | id_variable | +| variables.rs:168:23:168:24 | id | variables.rs:167:26:167:27 | id | +| variables.rs:179:11:179:16 | either | variables.rs:178:9:178:14 | either | +| variables.rs:181:26:181:27 | a3 | variables.rs:180:9:180:44 | a3 | +| variables.rs:193:11:193:12 | tv | variables.rs:192:9:192:10 | tv | +| variables.rs:195:26:195:27 | a4 | variables.rs:194:9:194:81 | a4 | +| variables.rs:197:11:197:12 | tv | variables.rs:192:9:192:10 | tv | +| variables.rs:199:26:199:27 | a5 | variables.rs:198:9:198:83 | a5 | +| variables.rs:201:11:201:12 | tv | variables.rs:192:9:192:10 | tv | +| variables.rs:203:26:203:27 | a6 | variables.rs:202:9:202:83 | a6 | +| variables.rs:209:11:209:16 | either | variables.rs:208:9:208:14 | either | +| variables.rs:211:16:211:17 | a7 | variables.rs:210:9:210:44 | a7 | +| variables.rs:212:26:212:27 | a7 | variables.rs:210:9:210:44 | a7 | +| variables.rs:220:11:220:16 | either | variables.rs:218:9:218:14 | either | +| variables.rs:224:23:224:25 | a11 | variables.rs:222:14:222:51 | a11 | +| variables.rs:226:15:226:15 | e | variables.rs:221:13:221:13 | e | +| variables.rs:227:28:227:30 | a12 | variables.rs:225:33:225:35 | a12 | +| variables.rs:243:11:243:12 | fv | variables.rs:242:9:242:10 | fv | +| variables.rs:245:26:245:28 | a13 | variables.rs:244:9:244:109 | a13 | +| variables.rs:255:15:255:16 | a8 | variables.rs:250:5:250:6 | a8 | +| variables.rs:256:15:256:16 | b3 | variables.rs:252:9:252:10 | b3 | +| variables.rs:257:15:257:16 | c1 | variables.rs:253:9:253:10 | c1 | +| variables.rs:263:15:263:16 | a9 | variables.rs:261:6:261:41 | a9 | +| variables.rs:272:15:272:17 | a10 | variables.rs:268:13:268:15 | a10 | +| variables.rs:273:15:273:16 | b4 | variables.rs:269:13:269:14 | b4 | +| variables.rs:274:15:274:16 | c2 | variables.rs:270:13:270:14 | c2 | +| variables.rs:281:9:281:11 | a10 | variables.rs:268:13:268:15 | a10 | +| variables.rs:282:9:282:10 | b4 | variables.rs:269:13:269:14 | b4 | +| variables.rs:283:9:283:10 | c2 | variables.rs:270:13:270:14 | c2 | +| variables.rs:285:15:285:17 | a10 | variables.rs:268:13:268:15 | a10 | +| variables.rs:286:15:286:16 | b4 | variables.rs:269:13:269:14 | b4 | +| variables.rs:287:15:287:16 | c2 | variables.rs:270:13:270:14 | c2 | +| variables.rs:294:23:294:25 | a10 | variables.rs:291:13:291:15 | a10 | +| variables.rs:295:23:295:24 | b4 | variables.rs:292:13:292:14 | b4 | +| variables.rs:299:15:299:17 | a10 | variables.rs:268:13:268:15 | a10 | +| variables.rs:300:15:300:16 | b4 | variables.rs:269:13:269:14 | b4 | +| variables.rs:306:9:306:9 | x | variables.rs:305:10:305:10 | x | +| variables.rs:308:9:308:23 | example_closure | variables.rs:304:9:304:23 | example_closure | +| variables.rs:309:15:309:16 | n1 | variables.rs:307:9:307:10 | n1 | +| variables.rs:314:9:314:9 | x | variables.rs:313:10:313:10 | x | +| variables.rs:316:9:316:26 | immutable_variable | variables.rs:312:9:312:26 | immutable_variable | +| variables.rs:317:15:317:16 | n2 | variables.rs:315:9:315:10 | n2 | +| variables.rs:324:12:324:12 | v | variables.rs:321:9:321:9 | v | +| variables.rs:325:19:325:22 | text | variables.rs:323:9:323:12 | text | +| variables.rs:331:5:331:5 | a | variables.rs:330:13:330:13 | a | +| variables.rs:332:15:332:15 | a | variables.rs:330:13:330:13 | a | +| variables.rs:333:11:333:11 | a | variables.rs:330:13:330:13 | a | +| variables.rs:334:15:334:15 | a | variables.rs:330:13:330:13 | a | +| variables.rs:340:14:340:14 | i | variables.rs:338:13:338:13 | i | +| variables.rs:342:15:342:15 | i | variables.rs:338:13:338:13 | i | +| variables.rs:347:10:347:10 | x | variables.rs:345:17:345:17 | x | +| variables.rs:348:10:348:10 | x | variables.rs:345:17:345:17 | x | +| variables.rs:353:23:353:23 | x | variables.rs:352:13:352:13 | x | +| variables.rs:354:15:354:15 | x | variables.rs:352:13:352:13 | x | variableInitializer -| variables.rs:10:9:10:10 | x1 | variables.rs:10:14:10:16 | "a" | -| variables.rs:15:13:15:14 | x2 | variables.rs:15:18:15:18 | 4 | -| variables.rs:22:9:22:10 | x3 | variables.rs:22:14:22:14 | 1 | -| variables.rs:24:9:24:10 | x3 | variables.rs:25:9:25:14 | ... + ... | -| variables.rs:30:9:30:10 | x4 | variables.rs:30:14:30:16 | "a" | -| variables.rs:33:13:33:14 | x4 | variables.rs:33:18:33:20 | "b" | -| variables.rs:62:9:62:10 | p1 | variables.rs:62:14:62:37 | RecordExpr | -| variables.rs:72:9:72:10 | s1 | variables.rs:72:14:72:41 | CallExpr | -| variables.rs:89:9:89:10 | s1 | variables.rs:89:14:89:41 | CallExpr | -| variables.rs:98:9:98:10 | x6 | variables.rs:98:14:98:20 | CallExpr | -| variables.rs:99:9:99:10 | y1 | variables.rs:99:14:99:15 | 10 | -| variables.rs:115:9:115:15 | numbers | variables.rs:115:19:115:35 | TupleExpr | -| variables.rs:142:9:142:10 | p2 | variables.rs:142:14:142:37 | RecordExpr | -| variables.rs:156:9:156:11 | msg | variables.rs:156:15:156:38 | RecordExpr | -| variables.rs:176:9:176:14 | either | variables.rs:176:18:176:33 | CallExpr | -| variables.rs:190:9:190:10 | tv | variables.rs:190:14:190:36 | CallExpr | -| variables.rs:206:9:206:14 | either | variables.rs:206:18:206:33 | CallExpr | -| variables.rs:216:9:216:14 | either | variables.rs:216:18:216:33 | CallExpr | -| variables.rs:240:9:240:10 | fv | variables.rs:240:14:240:35 | CallExpr | -| variables.rs:302:9:302:23 | example_closure | variables.rs:303:9:304:9 | ClosureExpr | -| variables.rs:305:9:305:10 | n1 | variables.rs:306:9:306:26 | CallExpr | -| variables.rs:310:9:310:26 | immutable_variable | variables.rs:311:9:312:9 | ClosureExpr | -| variables.rs:313:9:313:10 | n2 | variables.rs:314:9:314:29 | CallExpr | -| variables.rs:319:9:319:9 | v | variables.rs:319:13:319:41 | RefExpr | +| variables.rs:12:9:12:10 | x1 | variables.rs:12:14:12:16 | "a" | +| variables.rs:17:13:17:14 | x2 | variables.rs:17:18:17:18 | 4 | +| variables.rs:24:9:24:10 | x3 | variables.rs:24:14:24:14 | 1 | +| variables.rs:26:9:26:10 | x3 | variables.rs:27:9:27:14 | ... + ... | +| variables.rs:32:9:32:10 | x4 | variables.rs:32:14:32:16 | "a" | +| variables.rs:35:13:35:14 | x4 | variables.rs:35:18:35:20 | "b" | +| variables.rs:64:9:64:10 | p1 | variables.rs:64:14:64:37 | RecordExpr | +| variables.rs:74:9:74:10 | s1 | variables.rs:74:14:74:41 | CallExpr | +| variables.rs:91:9:91:10 | s1 | variables.rs:91:14:91:41 | CallExpr | +| variables.rs:100:9:100:10 | x6 | variables.rs:100:14:100:20 | CallExpr | +| variables.rs:101:9:101:10 | y1 | variables.rs:101:14:101:15 | 10 | +| variables.rs:117:9:117:15 | numbers | variables.rs:117:19:117:35 | TupleExpr | +| variables.rs:144:9:144:10 | p2 | variables.rs:144:14:144:37 | RecordExpr | +| variables.rs:158:9:158:11 | msg | variables.rs:158:15:158:38 | RecordExpr | +| variables.rs:178:9:178:14 | either | variables.rs:178:18:178:33 | CallExpr | +| variables.rs:192:9:192:10 | tv | variables.rs:192:14:192:36 | CallExpr | +| variables.rs:208:9:208:14 | either | variables.rs:208:18:208:33 | CallExpr | +| variables.rs:218:9:218:14 | either | variables.rs:218:18:218:33 | CallExpr | +| variables.rs:242:9:242:10 | fv | variables.rs:242:14:242:35 | CallExpr | +| variables.rs:304:9:304:23 | example_closure | variables.rs:305:9:306:9 | ClosureExpr | +| variables.rs:307:9:307:10 | n1 | variables.rs:308:9:308:26 | CallExpr | +| variables.rs:312:9:312:26 | immutable_variable | variables.rs:313:9:314:9 | ClosureExpr | +| variables.rs:315:9:315:10 | n2 | variables.rs:316:9:316:29 | CallExpr | +| variables.rs:321:9:321:9 | v | variables.rs:321:13:321:41 | RefExpr | +| variables.rs:330:13:330:13 | a | variables.rs:330:17:330:17 | 0 | +| variables.rs:338:13:338:13 | i | variables.rs:338:17:338:17 | 1 | +| variables.rs:339:9:339:13 | ref_i | variables.rs:340:9:340:14 | RefExpr | +| variables.rs:352:13:352:13 | x | variables.rs:352:17:352:17 | 2 | diff --git a/rust/ql/test/library-tests/variables/variables.ql b/rust/ql/test/library-tests/variables/variables.ql index dcca73d5cf28..9657c361fd59 100644 --- a/rust/ql/test/library-tests/variables/variables.ql +++ b/rust/ql/test/library-tests/variables/variables.ql @@ -12,7 +12,7 @@ query predicate variableReadAccess(VariableReadAccess va, Variable v) { v = va.g query predicate variableInitializer(Variable v, Expr e) { e = v.getInitializer() } module VariableAccessTest implements TestSig { - string getARelevantTag() { result = "access" } + string getARelevantTag() { result = ["", "write_", "read_"] + "access" } private predicate declAt(Variable v, string filepath, int line) { v.getLocation().hasLocationInfo(filepath, _, _, line, _) @@ -38,8 +38,15 @@ module VariableAccessTest implements TestSig { exists(VariableAccess va | location = va.getLocation() and element = va.toString() and - tag = "access" and decl(va.getVariable(), value) + | + va instanceof VariableWriteAccess and tag = "write_access" + or + va instanceof VariableReadAccess and tag = "read_access" + or + not va instanceof VariableWriteAccess and + not va instanceof VariableReadAccess and + tag = "access" ) } } diff --git a/rust/ql/test/library-tests/variables/variables.rs b/rust/ql/test/library-tests/variables/variables.rs index 85fa052a7aa2..52c5288a6b32 100644 --- a/rust/ql/test/library-tests/variables/variables.rs +++ b/rust/ql/test/library-tests/variables/variables.rs @@ -1,3 +1,5 @@ +use std::ops::AddAssign; + fn print_str(s: &str) { println!("{}", s); } @@ -8,32 +10,32 @@ fn print_i64(i: i64) { fn immutable_variable() { let x1 = "a"; // x1 - print_str(x1); // $ access=x1 + print_str(x1); // $ read_access=x1 } fn mutable_variable() { let mut x2 = 4; // x2 - print_i64(x2); // $ access=x2 - x2 = 5; // $ access=x2 - print_i64(x2); // $ access=x2 + print_i64(x2); // $ read_access=x2 + x2 = 5; // $ write_access=x2 + print_i64(x2); // $ read_access=x2 } fn variable_shadow1() { let x3 = 1; // x3_1 - print_i64(x3); // $ access=x3_1 + print_i64(x3); // $ read_access=x3_1 let x3 = // x3_2 - x3 + 1; // $ access=x3_1 - print_i64(x3); // $ access=x3_2 + x3 + 1; // $ read_access=x3_1 + print_i64(x3); // $ read_access=x3_2 } fn variable_shadow2() { let x4 = "a"; // x4_1 - print_str(x4); // $ access=x4_1 + print_str(x4); // $ read_access=x4_1 { let x4 = "b"; // x4_2 - print_str(x4); // $ access=x4_2 + print_str(x4); // $ read_access=x4_2 } - print_str(x4); // $ access=x4_1 + print_str(x4); // $ read_access=x4_1 } struct Point<'a> { @@ -52,10 +54,10 @@ fn let_pattern1() { y, // y }, ) = (("a", "b"), Point { x: "x", y: "y" }); - print_str(a1); // $ access=a1 - print_str(b1); // $ access=b1 - print_str(x); // $ access=x - print_str(y); // $ access=y + print_str(a1); // $ read_access=a1 + print_str(b1); // $ read_access=b1 + print_str(x); // $ read_access=x + print_str(y); // $ read_access=y } fn let_pattern2() { @@ -63,34 +65,34 @@ fn let_pattern2() { let Point { x: a2, // a2 y: b2, // b2 - } = p1; // $ access=p1 - print_str(a2); // $ access=a2 - print_str(b2); // $ access=b2 + } = p1; // $ read_access=p1 + print_str(a2); // $ read_access=a2 + print_str(b2); // $ read_access=b2 } fn let_pattern3() { let s1 = Some(String::from("Hello!")); // s1 if let Some(ref s2) // s2 - = s1 { // $ access=s1 - print_str(s2); // $ access=s2 + = s1 { // $ read_access=s1 + print_str(s2); // $ read_access=s2 } } fn let_pattern4() { - let Some(x5): Option<&str> = Some("x5") else { - // x5 - todo!() - }; - print_str(x5); // $ access=x5 + let Some(x5): Option<&str> = Some("x5") // x5 + else { + todo!() + }; + print_str(x5); // $ read_access=x5 } fn let_pattern5() { let s1 = Some(String::from("Hello!")); // s1 while let Some(ref s2) // s2 - = s1 { // $ access=s1 - print_str(s2); // $ access=s2 + = s1 { // $ read_access=s1 + print_str(s2); // $ read_access=s2 } } @@ -98,42 +100,42 @@ fn match_pattern1() { let x6 = Some(5); // x6 let y1 = 10; // y1_1 - match x6 { // $ access=x6 + match x6 { // $ read_access=x6 Some(50) => print_str("Got 50"), Some(y1) // y1_2 => { - print_i64(y1)// $ access=y1_2 + print_i64(y1)// $ read_access=y1_2 } None => print_str("NONE"), } - print_i64(y1); // $ access=y1_1 + print_i64(y1); // $ read_access=y1_1 } fn match_pattern2() { let numbers = (2, 4, 8, 16, 32); // numbers - match numbers { // $ access=numbers + match numbers { // $ read_access=numbers ( first, _, // first third, _, // third fifth // fifth ) => { - print_i64(first); // $ access=first - print_i64(third); // $ access=third - print_i64(fifth); // $ access=fifth + print_i64(first); // $ read_access=first + print_i64(third); // $ read_access=third + print_i64(fifth); // $ read_access=fifth } } - match numbers { // $ access=numbers + match numbers { // $ read_access=numbers ( first, // first .., last // last ) => { - print_i64(first); // $ access=first - print_i64(last); // $ access=last + print_i64(first); // $ read_access=first + print_i64(last); // $ read_access=last } } } @@ -141,10 +143,10 @@ fn match_pattern2() { fn match_pattern3() { let p2 = Point { x: "x", y: "y" }; // p2 - match p2 { // $ access=p2 + match p2 { // $ read_access=p2 Point { x: x7, .. // x7 - } => print_str(x7), // $ access=x7 + } => print_str(x7), // $ read_access=x7 } } @@ -155,15 +157,15 @@ enum Message { fn match_pattern4() { let msg = Message::Hello { id: 0 }; // msg - match msg { // $ access=msg + match msg { // $ read_access=msg Message::Hello { id: id_variable @ 3..=7, // id_variable - } => print_i64(id_variable), // $ access=id_variable + } => print_i64(id_variable), // $ read_access=id_variable Message::Hello { id: 10..=12 } => { println!("Found an id in another range") } Message::Hello { id } => // id - print_i64(id), // $ access=id + print_i64(id), // $ read_access=id } } @@ -174,9 +176,9 @@ enum Either { fn match_pattern5() { let either = Either::Left(32); // either - match either { // $ access=either + match either { // $ read_access=either Either::Left(a3) | Either::Right(a3) // a3 - => print_i64(a3), // $ access=a3 + => print_i64(a3), // $ read_access=a3 } } @@ -188,26 +190,26 @@ enum ThreeValued { fn match_pattern6() { let tv = ThreeValued::Second(62); // tv - match tv { // $ access=tv + match tv { // $ read_access=tv ThreeValued::First(a4) | ThreeValued::Second(a4) | ThreeValued::Third(a4) // a4 - => print_i64(a4), // $ access=a4 + => print_i64(a4), // $ read_access=a4 } - match tv { // $ access=tv + match tv { // $ read_access=tv (ThreeValued::First(a5) | ThreeValued::Second(a5)) | ThreeValued::Third(a5) // a5 - => print_i64(a5), // $ access=a5 + => print_i64(a5), // $ read_access=a5 } - match tv { // $ access=tv + match tv { // $ read_access=tv ThreeValued::First(a6) | (ThreeValued::Second(a6) | ThreeValued::Third(a6)) // a6 - => print_i64(a6), // $ access=a6 + => print_i64(a6), // $ read_access=a6 } } fn match_pattern7() { let either = Either::Left(32); // either - match either { // $ access=either + match either { // $ read_access=either Either::Left(a7) | Either::Right(a7) // a7 - if a7 > 0 // $ access=a7 - => print_i64(a7), // $ access=a7 + if a7 > 0 // $ read_access=a7 + => print_i64(a7), // $ read_access=a7 _ => (), } } @@ -215,14 +217,14 @@ fn match_pattern7() { fn match_pattern8() { let either = Either::Left(32); // either - match either { // $ access=either + match either { // $ read_access=either ref e @ // e (Either::Left(a11) | Either::Right(a11)) // a11 => { - print_i64(a11); // $ access=a11 + print_i64(a11); // $ read_access=a11 if let Either::Left(a12) // a12 - = e { // $ access=e - print_i64(*a12); // $ access=a12 + = e { // $ read_access=e + print_i64(*a12); // $ read_access=a12 } } _ => (), @@ -238,9 +240,9 @@ enum FourValued { fn match_pattern9() { let fv = FourValued::Second(62); // tv - match fv { // $ access=tv + match fv { // $ read_access=tv FourValued::First(a13) | (FourValued::Second(a13) | FourValued::Third(a13)) | FourValued::Fourth(a13) // a13 - => print_i64(a13), // $ access=a13 + => print_i64(a13), // $ read_access=a13 } } @@ -250,15 +252,15 @@ fn param_pattern1( b3, // b3 c1, // c1 ): (&str, &str)) -> () { - print_str(a8); // $ access=a8 - print_str(b3); // $ access=b3 - print_str(c1); // $ access=c1 + print_str(a8); // $ read_access=a8 + print_str(b3); // $ read_access=b3 + print_str(c1); // $ read_access=c1 } fn param_pattern2( (Either::Left(a9) | Either::Right(a9)): Either // a9 ) -> () { - print_i64(a9); // $ access=a9 + print_i64(a9); // $ read_access=a9 } fn destruct_assignment() { @@ -267,63 +269,91 @@ fn destruct_assignment() { mut b4, // b4 mut c2 // c2 ) = (1, 2, 3); - print_i64(a10); // $ access=a10 - print_i64(b4); // $ access=b4 - print_i64(c2); // $ access=c2 + print_i64(a10); // $ read_access=a10 + print_i64(b4); // $ read_access=b4 + print_i64(c2); // $ read_access=c2 ( - c2, // $ access=c2 - b4, // $ access=b4 - a10 // $ access=a10 + c2, // $ write_access=c2 + b4, // $ write_access=b4 + a10 // $ write_access=a10 ) = ( - a10, // $ access=a10 - b4, // $ access=b4 - c2 // $ access=c2 + a10, // $ read_access=a10 + b4, // $ read_access=b4 + c2 // $ read_access=c2 ); - print_i64(a10); // $ access=a10 - print_i64(b4); // $ access=b4 - print_i64(c2); // $ access=c2 + print_i64(a10); // $ read_access=a10 + print_i64(b4); // $ read_access=b4 + print_i64(c2); // $ read_access=c2 match (4, 5) { ( a10, // a10_2 b4 // b4 ) => { - print_i64(a10); // $ access=a10_2 - print_i64(b4); // $ access=b4 + print_i64(a10); // $ read_access=a10_2 + print_i64(b4); // $ read_access=b4 } } - print_i64(a10); // $ access=a10 - print_i64(b4); // $ access=b4 + print_i64(a10); // $ read_access=a10 + print_i64(b4); // $ read_access=b4 } fn closure_variable() { let example_closure = // example_closure |x: i64| // x_1 - x; // $ access=x_1 + x; // $ read_access=x_1 let n1 = // n1 - example_closure(5); // $ access=example_closure - print_i64(n1); // $ access=n1 + example_closure(5); // $ read_access=example_closure + print_i64(n1); // $ read_access=n1 immutable_variable(); let immutable_variable = |x: i64| // x_2 - x; // $ access=x_2 + x; // $ read_access=x_2 let n2 = // n2 - immutable_variable(6); // $ access=immutable_variable - print_i64(n2); // $ access=n2 + immutable_variable(6); // $ read_access=immutable_variable + print_i64(n2); // $ read_access=n2 } fn for_variable() { let v = &["apples", "cake", "coffee"]; // v for text // text - in v { // $ access=v - print_str(text); // $ access=text + in v { // $ read_access=v + print_str(text); // $ read_access=text } } +fn add_assign() { + let mut a = 0; // a + a += 1; // $ access=a + print_i64(a); // $ read_access=a + (&mut a).add_assign(10); // $ access=a + print_i64(a); // $ read_access=a +} + +fn mutate() { + let mut i = 1; // i + let ref_i = // ref_i + &mut i; // $ access=i + *ref_i = 2; // $ read_access=ref_i + print_i64(i); // $ read_access=i +} + +fn mutate_param(x : &mut i64) { // x + *x = // $ read_access=x + *x + // $ read_access=x + *x; // $ read_access=x +} + +fn mutate_arg() { + let mut x = 2; // x + mutate_param(&mut x); // $ access=x + print_i64(x); // $ read_access=x +} + fn main() { immutable_variable(); mutable_variable(); @@ -347,4 +377,7 @@ fn main() { destruct_assignment(); closure_variable(); for_variable(); + add_assign(); + mutate(); + mutate_arg(); } From a9cf33ce185aa585936fec173f48275cd188f602 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Thu, 3 Oct 2024 13:33:22 +0200 Subject: [PATCH 69/79] Rust: `&x` is neither a read nor a write --- .../rust/elements/AssignmentOperation.qll | 49 +++++++++++++++++++ .../rust/elements/internal/VariableImpl.qll | 25 ++++------ rust/ql/lib/rust.qll | 1 + .../variables/variables.expected | 22 +-------- 4 files changed, 61 insertions(+), 36 deletions(-) create mode 100644 rust/ql/lib/codeql/rust/elements/AssignmentOperation.qll diff --git a/rust/ql/lib/codeql/rust/elements/AssignmentOperation.qll b/rust/ql/lib/codeql/rust/elements/AssignmentOperation.qll new file mode 100644 index 000000000000..be7b2c82cf47 --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/AssignmentOperation.qll @@ -0,0 +1,49 @@ +/** Provides classes for assignment operations. */ + +private import rust +private import codeql.rust.elements.internal.BinaryExprImpl + +/** An assignment operation. */ +abstract private class AssignmentOperationImpl extends Impl::BinaryExpr { } + +final class AssignmentOperation = AssignmentOperationImpl; + +/** + * An assignment expression, for example + * + * ```rust + * x = y; + * ``` + */ +final class AssignmentExpr extends AssignmentOperationImpl { + AssignmentExpr() { this.getOperatorName() = "=" } + + override string getAPrimaryQlClass() { result = "AssignmentExpr" } +} + +/** + * A compound assignment expression, for example + * + * ```rust + * x += y; + * ``` + * + * Note that compound assignment expressions are syntatic sugar for + * trait invocations, i.e., the above actually means + * + * ```rust + * (&mut x).add_assign(y); + * ``` + */ +final class CompoundAssignmentExpr extends AssignmentOperationImpl { + private string operator; + + CompoundAssignmentExpr() { this.getOperatorName().regexpCapture("(.)=", 1) = operator } + + /** + * Gets the operator of this compound assignment expression. + */ + string getOperator() { result = operator } + + override string getAPrimaryQlClass() { result = "CompoundAssignmentExpr" } +} diff --git a/rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll index 7a77c45fe2ae..b9e9bb7cb48a 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll @@ -395,34 +395,27 @@ module Impl { } /** Holds if `e` occurs in the LHS of an assignment or compound assignment. */ - private predicate assignLhs(Expr e, boolean compound) { - exists(BinaryExpr be, string op | - op = be.getOperatorName().regexpCapture("(.*)=", 1) and - e = be.getLhs() - | - op = "" and compound = false - or - op != "" and compound = true - ) + private predicate assignmentExprDescendant(Expr e) { + e = any(AssignmentExpr ae).getLhs() or exists(Expr mid | - assignLhs(mid, compound) and - getImmediateParent(e) = mid + assignmentExprDescendant(mid) and + getImmediateParent(e) = mid and + not mid.(PrefixExpr).getOperatorName() = "*" ) } /** A variable write. */ class VariableWriteAccess extends VariableAccess { - VariableWriteAccess() { assignLhs(this, _) } + VariableWriteAccess() { assignmentExprDescendant(this) } } /** A variable read. */ class VariableReadAccess extends VariableAccess { VariableReadAccess() { - not this instanceof VariableWriteAccess - or - // consider LHS in compound assignments both reads and writes - assignLhs(this, true) + not this instanceof VariableWriteAccess and + not this = any(RefExpr re).getExpr() and + not this = any(CompoundAssignmentExpr cae).getLhs() } } diff --git a/rust/ql/lib/rust.qll b/rust/ql/lib/rust.qll index 7723400c41b6..58425b6490e8 100644 --- a/rust/ql/lib/rust.qll +++ b/rust/ql/lib/rust.qll @@ -3,5 +3,6 @@ import codeql.rust.elements import codeql.Locations import codeql.files.FileSystem +import codeql.rust.elements.AssignmentOperation import codeql.rust.elements.LogicalOperation import codeql.rust.elements.Variable diff --git a/rust/ql/test/library-tests/variables/variables.expected b/rust/ql/test/library-tests/variables/variables.expected index 807fc9ff8919..ccc1cd6072be 100644 --- a/rust/ql/test/library-tests/variables/variables.expected +++ b/rust/ql/test/library-tests/variables/variables.expected @@ -1,17 +1,4 @@ testFailures -| variables.rs:331:5:331:5 | a | Unexpected result: read_access=a | -| variables.rs:331:5:331:5 | a | Unexpected result: write_access=a | -| variables.rs:331:13:331:25 | Comment | Missing result:access=a | -| variables.rs:333:11:333:11 | a | Unexpected result: read_access=a | -| variables.rs:333:30:333:42 | Comment | Missing result:access=a | -| variables.rs:340:14:340:14 | i | Unexpected result: read_access=i | -| variables.rs:340:17:340:29 | Comment | Missing result:access=i | -| variables.rs:341:6:341:10 | ref_i | Unexpected result: write_access=ref_i | -| variables.rs:341:17:341:38 | Comment | Missing result:read_access=ref_i | -| variables.rs:346:6:346:6 | x | Unexpected result: write_access=x | -| variables.rs:346:10:346:27 | Comment | Missing result:read_access=x | -| variables.rs:353:23:353:23 | x | Unexpected result: read_access=x | -| variables.rs:353:27:353:39 | Comment | Missing result:access=x | failures variable | variables.rs:3:14:3:14 | s | @@ -185,9 +172,6 @@ variableWriteAccess | variables.rs:277:9:277:10 | c2 | variables.rs:270:13:270:14 | c2 | | variables.rs:278:9:278:10 | b4 | variables.rs:269:13:269:14 | b4 | | variables.rs:279:9:279:11 | a10 | variables.rs:268:13:268:15 | a10 | -| variables.rs:331:5:331:5 | a | variables.rs:330:13:330:13 | a | -| variables.rs:341:6:341:10 | ref_i | variables.rs:339:9:339:13 | ref_i | -| variables.rs:346:6:346:6 | x | variables.rs:345:17:345:17 | x | variableReadAccess | variables.rs:13:15:13:16 | x1 | variables.rs:12:9:12:10 | x1 | | variables.rs:18:15:18:16 | x2 | variables.rs:17:13:17:14 | x2 | @@ -267,15 +251,13 @@ variableReadAccess | variables.rs:317:15:317:16 | n2 | variables.rs:315:9:315:10 | n2 | | variables.rs:324:12:324:12 | v | variables.rs:321:9:321:9 | v | | variables.rs:325:19:325:22 | text | variables.rs:323:9:323:12 | text | -| variables.rs:331:5:331:5 | a | variables.rs:330:13:330:13 | a | | variables.rs:332:15:332:15 | a | variables.rs:330:13:330:13 | a | -| variables.rs:333:11:333:11 | a | variables.rs:330:13:330:13 | a | | variables.rs:334:15:334:15 | a | variables.rs:330:13:330:13 | a | -| variables.rs:340:14:340:14 | i | variables.rs:338:13:338:13 | i | +| variables.rs:341:6:341:10 | ref_i | variables.rs:339:9:339:13 | ref_i | | variables.rs:342:15:342:15 | i | variables.rs:338:13:338:13 | i | +| variables.rs:346:6:346:6 | x | variables.rs:345:17:345:17 | x | | variables.rs:347:10:347:10 | x | variables.rs:345:17:345:17 | x | | variables.rs:348:10:348:10 | x | variables.rs:345:17:345:17 | x | -| variables.rs:353:23:353:23 | x | variables.rs:352:13:352:13 | x | | variables.rs:354:15:354:15 | x | variables.rs:352:13:352:13 | x | variableInitializer | variables.rs:12:9:12:10 | x1 | variables.rs:12:14:12:16 | "a" | From 2832318711852c0b0c14d4ca690830cbd7d64e53 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Fri, 20 Sep 2024 14:39:21 +0200 Subject: [PATCH 70/79] Java: Account for top-level `res` folders in `AndroidLayoutXmlFile` --- java/ql/lib/semmle/code/java/frameworks/android/Layout.qll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/ql/lib/semmle/code/java/frameworks/android/Layout.qll b/java/ql/lib/semmle/code/java/frameworks/android/Layout.qll index d7f0b0e2e6cb..ee430b62d577 100644 --- a/java/ql/lib/semmle/code/java/frameworks/android/Layout.qll +++ b/java/ql/lib/semmle/code/java/frameworks/android/Layout.qll @@ -6,7 +6,7 @@ private import semmle.code.java.dataflow.DataFlow /** An Android Layout XML file. */ class AndroidLayoutXmlFile extends XmlFile { - AndroidLayoutXmlFile() { this.getRelativePath().matches("%/res/layout/%.xml") } + AndroidLayoutXmlFile() { this.getRelativePath().regexpMatch("(.*/)?res/layout/.*\\.xml") } } /** A component declared in an Android layout file. */ From bf0675e5bac2f47c3dd385185511e79d35f7924c Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Mon, 23 Sep 2024 10:17:52 +0200 Subject: [PATCH 71/79] Kotlin: Update two tests --- java/ql/test-kotlin1/library-tests/classes/local_anonymous.ql | 4 +--- java/ql/test-kotlin2/library-tests/classes/local_anonymous.ql | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/java/ql/test-kotlin1/library-tests/classes/local_anonymous.ql b/java/ql/test-kotlin1/library-tests/classes/local_anonymous.ql index af8e63e50d8d..479c6111d42e 100644 --- a/java/ql/test-kotlin1/library-tests/classes/local_anonymous.ql +++ b/java/ql/test-kotlin1/library-tests/classes/local_anonymous.ql @@ -1,8 +1,6 @@ import java -private predicate filterFile(Top t) { - t.getFile().getRelativePath().matches("%/local_anonymous.kt") -} +private predicate filterFile(Top t) { t.getFile().getRelativePath().matches("%local_anonymous.kt") } private string isAnonymousType(Type t) { if t instanceof AnonymousClass then result = "anonymous" else result = "not anonymous" diff --git a/java/ql/test-kotlin2/library-tests/classes/local_anonymous.ql b/java/ql/test-kotlin2/library-tests/classes/local_anonymous.ql index af8e63e50d8d..479c6111d42e 100644 --- a/java/ql/test-kotlin2/library-tests/classes/local_anonymous.ql +++ b/java/ql/test-kotlin2/library-tests/classes/local_anonymous.ql @@ -1,8 +1,6 @@ import java -private predicate filterFile(Top t) { - t.getFile().getRelativePath().matches("%/local_anonymous.kt") -} +private predicate filterFile(Top t) { t.getFile().getRelativePath().matches("%local_anonymous.kt") } private string isAnonymousType(Type t) { if t instanceof AnonymousClass then result = "anonymous" else result = "not anonymous" From 953461d1aaf05b63104c61cf31cbbda77f8d0b3a Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Mon, 23 Sep 2024 11:51:00 +0200 Subject: [PATCH 72/79] C++: Update expected test output --- .../test/library-tests/files/Files.expected | 8 ++--- .../query-tests/Diagnostics/Info.expected | 10 +++--- .../DocumentApi/DocumentApi.expected | 32 +++++++++---------- .../ExternalDependencies.expected | 8 ++--- .../ExternalDependenciesSourceLinks.expected | 8 ++--- 5 files changed, 33 insertions(+), 33 deletions(-) diff --git a/cpp/ql/test/library-tests/files/Files.expected b/cpp/ql/test/library-tests/files/Files.expected index 68187793433b..13f3a6b2da17 100644 --- a/cpp/ql/test/library-tests/files/Files.expected +++ b/cpp/ql/test/library-tests/files/Files.expected @@ -1,4 +1,4 @@ -| c.c | library-tests/files/c.c | CFile, MetricFile | C | | | -| files1.cpp | library-tests/files/files1.cpp | CppFile, MetricFile | C++ | swap | t | -| files1.h | library-tests/files/files1.h | HeaderFile, MetricFile | | swap | | -| files2.cpp | library-tests/files/files2.cpp | CppFile, MetricFile | C++ | g | x, y | +| c.c | c.c | CFile, MetricFile | C | | | +| files1.cpp | files1.cpp | CppFile, MetricFile | C++ | swap | t | +| files1.h | files1.h | HeaderFile, MetricFile | | swap | | +| files2.cpp | files2.cpp | CppFile, MetricFile | C++ | g | x, y | diff --git a/cpp/ql/test/query-tests/Diagnostics/Info.expected b/cpp/ql/test/query-tests/Diagnostics/Info.expected index 55e3310fd19b..a32541303609 100644 --- a/cpp/ql/test/query-tests/Diagnostics/Info.expected +++ b/cpp/ql/test/query-tests/Diagnostics/Info.expected @@ -1,6 +1,6 @@ -| containserror.cpp:0:0:0:0 | containserror.cpp | query-tests/Diagnostics/containserror.cpp | fromSource, normalTermination | -| containswarning.cpp:0:0:0:0 | containswarning.cpp | query-tests/Diagnostics/containswarning.cpp | fromSource, normalTermination | -| doesnotcompile.cpp:0:0:0:0 | doesnotcompile.cpp | query-tests/Diagnostics/doesnotcompile.cpp | ExtractionProblem (severity 1), fromSource, normalTermination | +| containserror.cpp:0:0:0:0 | containserror.cpp | containserror.cpp | fromSource, normalTermination | +| containswarning.cpp:0:0:0:0 | containswarning.cpp | containswarning.cpp | fromSource, normalTermination | +| doesnotcompile.cpp:0:0:0:0 | doesnotcompile.cpp | doesnotcompile.cpp | ExtractionProblem (severity 1), fromSource, normalTermination | | file://:0:0:0:0 | | | | -| header.h:0:0:0:0 | header.h | query-tests/Diagnostics/header.h | fromSource | -| successful.cpp:0:0:0:0 | successful.cpp | query-tests/Diagnostics/successful.cpp | fromSource, normalTermination | +| header.h:0:0:0:0 | header.h | header.h | fromSource | +| successful.cpp:0:0:0:0 | successful.cpp | successful.cpp | fromSource, normalTermination | diff --git a/cpp/ql/test/query-tests/Documentation/DocumentApi/DocumentApi.expected b/cpp/ql/test/query-tests/Documentation/DocumentApi/DocumentApi.expected index b19d88acdc28..62d47bc8db0b 100644 --- a/cpp/ql/test/query-tests/Documentation/DocumentApi/DocumentApi.expected +++ b/cpp/ql/test/query-tests/Documentation/DocumentApi/DocumentApi.expected @@ -1,16 +1,16 @@ -| comment_prototypes.c:29:6:29:11 | proto6 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller1.c:9:5:9:10 | call to proto6 | query-tests/Documentation/DocumentApi/comment_prototypes_caller1.c | -| comment_prototypes.c:29:6:29:11 | proto6 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller2.c:9:5:9:10 | call to proto6 | query-tests/Documentation/DocumentApi/comment_prototypes_caller2.c | -| comment_prototypes.c:34:6:34:11 | proto7 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller1.c:10:5:10:10 | call to proto7 | query-tests/Documentation/DocumentApi/comment_prototypes_caller1.c | -| comment_prototypes.c:34:6:34:11 | proto7 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller2.c:10:5:10:10 | call to proto7 | query-tests/Documentation/DocumentApi/comment_prototypes_caller2.c | -| comment_prototypes.c:45:6:45:11 | proto9 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller1.c:12:5:12:10 | call to proto9 | query-tests/Documentation/DocumentApi/comment_prototypes_caller1.c | -| comment_prototypes.c:45:6:45:11 | proto9 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller2.c:12:5:12:10 | call to proto9 | query-tests/Documentation/DocumentApi/comment_prototypes_caller2.c | -| comment_prototypes.c:50:6:50:12 | proto10 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller1.c:13:5:13:11 | call to proto10 | query-tests/Documentation/DocumentApi/comment_prototypes_caller1.c | -| comment_prototypes.c:50:6:50:12 | proto10 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller2.c:13:5:13:11 | call to proto10 | query-tests/Documentation/DocumentApi/comment_prototypes_caller2.c | -| comment_prototypes.c:55:6:55:12 | proto11 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller1.c:14:5:14:11 | call to proto11 | query-tests/Documentation/DocumentApi/comment_prototypes_caller1.c | -| comment_prototypes.c:55:6:55:12 | proto11 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller2.c:14:5:14:11 | call to proto11 | query-tests/Documentation/DocumentApi/comment_prototypes_caller2.c | -| comment_prototypes.c:66:6:66:12 | proto13 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller1.c:16:5:16:11 | call to proto13 | query-tests/Documentation/DocumentApi/comment_prototypes_caller1.c | -| comment_prototypes.c:66:6:66:12 | proto13 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller2.c:16:5:16:11 | call to proto13 | query-tests/Documentation/DocumentApi/comment_prototypes_caller2.c | -| definition.c:2:6:2:7 | f1 | Functions called from other files should be documented (called from $@). | user1.c:9:5:9:6 | call to f1 | query-tests/Documentation/DocumentApi/user1.c | -| definition.c:2:6:2:7 | f1 | Functions called from other files should be documented (called from $@). | user2.c:7:5:7:6 | call to f1 | query-tests/Documentation/DocumentApi/user2.c | -| definition.c:32:6:32:7 | f6 | Functions called from other files should be documented (called from $@). | user1.c:14:5:14:6 | call to f6 | query-tests/Documentation/DocumentApi/user1.c | -| definition.c:32:6:32:7 | f6 | Functions called from other files should be documented (called from $@). | user2.c:10:5:10:6 | call to f6 | query-tests/Documentation/DocumentApi/user2.c | +| comment_prototypes.c:29:6:29:11 | proto6 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller1.c:9:5:9:10 | call to proto6 | comment_prototypes_caller1.c | +| comment_prototypes.c:29:6:29:11 | proto6 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller2.c:9:5:9:10 | call to proto6 | comment_prototypes_caller2.c | +| comment_prototypes.c:34:6:34:11 | proto7 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller1.c:10:5:10:10 | call to proto7 | comment_prototypes_caller1.c | +| comment_prototypes.c:34:6:34:11 | proto7 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller2.c:10:5:10:10 | call to proto7 | comment_prototypes_caller2.c | +| comment_prototypes.c:45:6:45:11 | proto9 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller1.c:12:5:12:10 | call to proto9 | comment_prototypes_caller1.c | +| comment_prototypes.c:45:6:45:11 | proto9 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller2.c:12:5:12:10 | call to proto9 | comment_prototypes_caller2.c | +| comment_prototypes.c:50:6:50:12 | proto10 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller1.c:13:5:13:11 | call to proto10 | comment_prototypes_caller1.c | +| comment_prototypes.c:50:6:50:12 | proto10 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller2.c:13:5:13:11 | call to proto10 | comment_prototypes_caller2.c | +| comment_prototypes.c:55:6:55:12 | proto11 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller1.c:14:5:14:11 | call to proto11 | comment_prototypes_caller1.c | +| comment_prototypes.c:55:6:55:12 | proto11 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller2.c:14:5:14:11 | call to proto11 | comment_prototypes_caller2.c | +| comment_prototypes.c:66:6:66:12 | proto13 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller1.c:16:5:16:11 | call to proto13 | comment_prototypes_caller1.c | +| comment_prototypes.c:66:6:66:12 | proto13 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller2.c:16:5:16:11 | call to proto13 | comment_prototypes_caller2.c | +| definition.c:2:6:2:7 | f1 | Functions called from other files should be documented (called from $@). | user1.c:9:5:9:6 | call to f1 | user1.c | +| definition.c:2:6:2:7 | f1 | Functions called from other files should be documented (called from $@). | user2.c:7:5:7:6 | call to f1 | user2.c | +| definition.c:32:6:32:7 | f6 | Functions called from other files should be documented (called from $@). | user1.c:14:5:14:6 | call to f6 | user1.c | +| definition.c:32:6:32:7 | f6 | Functions called from other files should be documented (called from $@). | user2.c:10:5:10:6 | call to f6 | user2.c | diff --git a/cpp/ql/test/query-tests/Metrics/Dependencies/ExternalDependencies.expected b/cpp/ql/test/query-tests/Metrics/Dependencies/ExternalDependencies.expected index a42506f8be11..795f6dba431a 100644 --- a/cpp/ql/test/query-tests/Metrics/Dependencies/ExternalDependencies.expected +++ b/cpp/ql/test/query-tests/Metrics/Dependencies/ExternalDependencies.expected @@ -1,4 +1,4 @@ -| /query-tests/Metrics/Dependencies/main.cpp<\|>LibC<\|>unknown | 5 | -| /query-tests/Metrics/Dependencies/include.h<\|>LibD<\|>unknown | 1 | -| /query-tests/Metrics/Dependencies/main.cpp<\|>LibA<\|>unknown | 1 | -| /query-tests/Metrics/Dependencies/main.cpp<\|>LibB<\|>unknown | 1 | +| /main.cpp<\|>LibC<\|>unknown | 5 | +| /include.h<\|>LibD<\|>unknown | 1 | +| /main.cpp<\|>LibA<\|>unknown | 1 | +| /main.cpp<\|>LibB<\|>unknown | 1 | diff --git a/cpp/ql/test/query-tests/Metrics/Dependencies/ExternalDependenciesSourceLinks.expected b/cpp/ql/test/query-tests/Metrics/Dependencies/ExternalDependenciesSourceLinks.expected index f5399bf6ac31..b00deb76d7d8 100644 --- a/cpp/ql/test/query-tests/Metrics/Dependencies/ExternalDependenciesSourceLinks.expected +++ b/cpp/ql/test/query-tests/Metrics/Dependencies/ExternalDependenciesSourceLinks.expected @@ -1,4 +1,4 @@ -| /query-tests/Metrics/Dependencies/include.h<\|>LibD<\|>unknown | include.h:0:0:0:0 | include.h | -| /query-tests/Metrics/Dependencies/main.cpp<\|>LibA<\|>unknown | main.cpp:0:0:0:0 | main.cpp | -| /query-tests/Metrics/Dependencies/main.cpp<\|>LibB<\|>unknown | main.cpp:0:0:0:0 | main.cpp | -| /query-tests/Metrics/Dependencies/main.cpp<\|>LibC<\|>unknown | main.cpp:0:0:0:0 | main.cpp | +| /include.h<\|>LibD<\|>unknown | include.h:0:0:0:0 | include.h | +| /main.cpp<\|>LibA<\|>unknown | main.cpp:0:0:0:0 | main.cpp | +| /main.cpp<\|>LibB<\|>unknown | main.cpp:0:0:0:0 | main.cpp | +| /main.cpp<\|>LibC<\|>unknown | main.cpp:0:0:0:0 | main.cpp | From b3b9406e4563c8457670e7bf99279921b54289f3 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Mon, 23 Sep 2024 16:38:10 +0200 Subject: [PATCH 73/79] Python: Update test --- .../experimental/library-tests/CallGraph/InlineCallGraphTest.ql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/ql/test/experimental/library-tests/CallGraph/InlineCallGraphTest.ql b/python/ql/test/experimental/library-tests/CallGraph/InlineCallGraphTest.ql index 1f2b37168b73..e1b14363639b 100644 --- a/python/ql/test/experimental/library-tests/CallGraph/InlineCallGraphTest.ql +++ b/python/ql/test/experimental/library-tests/CallGraph/InlineCallGraphTest.ql @@ -65,7 +65,7 @@ string getCallEdgeValue(CallNode call, Function target) { else exists(string fixedRelativePath | fixedRelativePath = - target.getLocation().getFile().getRelativePath().regexpCapture(".*/CallGraph[^/]*/(.*)", 1) + target.getLocation().getFile().getAbsolutePath().regexpCapture(".*/CallGraph[^/]*/(.*)", 1) | // the value needs to be enclosed in quotes to allow special characters result = "\"" + fixedRelativePath + ":" + betterQualName(target) + "\"" From d0ca39fb03ea11f164023b6b991fd78fad3d91af Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Thu, 26 Sep 2024 12:52:54 +0200 Subject: [PATCH 74/79] JS: Update expected test output --- .../Files/relativePaths.expected | 4 +- .../test/library-tests/Modules/tests.expected | 20 +++---- .../test/library-tests/NodeJS/tests.expected | 6 +- .../TypeScript/EmbeddedInScript/Test.expected | 18 +++--- .../HasQualifiedNameFallback/Test.expected | 2 +- .../TypeScript/PathMapping/Imports.expected | 14 ++--- .../Namespaces.expected | 42 +++++++------- .../ResolveNamespace.expected | 56 +++++++++---------- .../ResolveTypeName.expected | 38 ++++++------- .../RegressionTests/EmptyName/test.expected | 6 +- .../ExportEqualsExpr/test.expected | 4 +- .../SemicolonInName/test.expected | 2 +- .../SyntaxErrors/SyntaxErrors.expected | 2 +- .../TypeScript/Types/tests.expected | 50 ++++++++--------- .../ExternalDependencies.expected | 18 +++--- .../NodeJS/CyclicImport/CyclicImport.expected | 4 +- .../CWE-200/PrivateFileExposure.expected | 8 +-- .../tests.expected | 4 +- 18 files changed, 148 insertions(+), 150 deletions(-) diff --git a/javascript/ql/test/library-tests/Files/relativePaths.expected b/javascript/ql/test/library-tests/Files/relativePaths.expected index d70416666954..16c365fdbb13 100644 --- a/javascript/ql/test/library-tests/Files/relativePaths.expected +++ b/javascript/ql/test/library-tests/Files/relativePaths.expected @@ -1,2 +1,2 @@ -| a.js:0:0:0:0 | a.js | library-tests/Files/a.js | -| b/c.js:0:0:0:0 | b/c.js | library-tests/Files/b/c.js | +| a.js:0:0:0:0 | a.js | a.js | +| b/c.js:0:0:0:0 | b/c.js | b/c.js | diff --git a/javascript/ql/test/library-tests/Modules/tests.expected b/javascript/ql/test/library-tests/Modules/tests.expected index cec0b96049e8..bf0efddba553 100644 --- a/javascript/ql/test/library-tests/Modules/tests.expected +++ b/javascript/ql/test/library-tests/Modules/tests.expected @@ -115,16 +115,16 @@ test_ReExportDeclarations | m/c.js:5:1:5:30 | export ... '../b'; | m/c.js:5:24:5:29 | '../b' | | reExportNamespace.js:1:1:1:26 | export ... "./a"; | reExportNamespace.js:1:21:1:25 | "./a" | test_getAnImportedModule -| library-tests/Modules/b.js | library-tests/Modules/a.js | -| library-tests/Modules/d.js | library-tests/Modules/a.js | -| library-tests/Modules/d.js | library-tests/Modules/b.js | -| library-tests/Modules/es2015_require.js | library-tests/Modules/d.js | -| library-tests/Modules/f.ts | library-tests/Modules/e.js | -| library-tests/Modules/g.ts | library-tests/Modules/f.ts | -| library-tests/Modules/import-indirect-path.js | library-tests/Modules/a.js | -| library-tests/Modules/import-ts-with-js-extension.ts | library-tests/Modules/f.ts | -| library-tests/Modules/m/c.js | library-tests/Modules/b.js | -| library-tests/Modules/reExportNamespaceClient.js | library-tests/Modules/reExportNamespace.js | +| b.js | a.js | +| d.js | a.js | +| d.js | b.js | +| es2015_require.js | d.js | +| f.ts | e.js | +| g.ts | f.ts | +| import-indirect-path.js | a.js | +| import-ts-with-js-extension.ts | f.ts | +| m/c.js | b.js | +| reExportNamespaceClient.js | reExportNamespace.js | test_getExportedName | arbitrarySpecifier.ts:5:10:5:30 | Foo_new ... o::new" | Foo::new | | arbitrarySpecifier.ts:6:13:6:28 | * as "Foo_types" | Foo_types | diff --git a/javascript/ql/test/library-tests/NodeJS/tests.expected b/javascript/ql/test/library-tests/NodeJS/tests.expected index 2f5d09245ec8..b97c6a345e8f 100644 --- a/javascript/ql/test/library-tests/NodeJS/tests.expected +++ b/javascript/ql/test/library-tests/NodeJS/tests.expected @@ -94,12 +94,12 @@ requireImport | a.js:3:6:3:23 | require('./sub/c') | ./sub/c | sub/c.js:1:1:4:0 | | | a.js:4:6:4:29 | require ... /d.js') | ./sub/../d.js | d.js:1:1:7:15 | | | a.js:7:1:7:18 | require('./sub/c') | ./sub/c | sub/c.js:1:1:4:0 | | -| a.js:10:1:10:18 | require(__dirname) | /library-tests/NodeJS | index.js:1:1:3:0 | | -| a.js:11:1:11:25 | require ... + '/e') | /library-tests/NodeJS/e | e.js:1:1:6:0 | | +| a.js:10:1:10:18 | require(__dirname) | | index.js:1:1:3:0 | | +| a.js:11:1:11:25 | require ... + '/e') | /e | e.js:1:1:6:0 | | | a.js:12:1:12:28 | require ... + 'c') | ./sub/c | sub/c.js:1:1:4:0 | | | b.js:1:1:1:18 | require('./sub/c') | ./sub/c | sub/c.js:1:1:4:0 | | | d.js:7:1:7:14 | require('foo') | foo | sub/f.js:1:1:4:17 | | -| index.js:2:1:2:41 | require ... b.js")) | /library-tests/NodeJS/index.js/../b.js | b.js:1:1:8:0 | | +| index.js:2:1:2:41 | require ... b.js")) | /index.js/../b.js | b.js:1:1:8:0 | | | mjs-files/require-from-js.js:1:12:1:36 | require ... on-me') | ./depend-on-me | mjs-files/depend-on-me.mjs:1:1:7:1 | | | mjs-files/require-from-js.js:2:12:2:39 | require ... me.js') | ./depend-on-me.js | mjs-files/depend-on-me.js:1:1:8:0 | | | mjs-files/require-from-js.js:3:12:3:40 | require ... e.mjs') | ./depend-on-me.mjs | mjs-files/depend-on-me.mjs:1:1:7:1 | | diff --git a/javascript/ql/test/library-tests/TypeScript/EmbeddedInScript/Test.expected b/javascript/ql/test/library-tests/TypeScript/EmbeddedInScript/Test.expected index 711e94cfdaa1..2bb7faf59eb9 100644 --- a/javascript/ql/test/library-tests/TypeScript/EmbeddedInScript/Test.expected +++ b/javascript/ql/test/library-tests/TypeScript/EmbeddedInScript/Test.expected @@ -8,27 +8,27 @@ exprType | htmlfile.html:5:26:5:28 | foo | () => void | | htmlfile.html:5:26:5:30 | foo() | void | | htmlfile.html:5:26:5:42 | foo() as number[] | number[] | -| other.ts:1:8:1:16 | Component | typeof default in library-tests/TypeScript/EmbeddedInScript/test.vue | +| other.ts:1:8:1:16 | Component | typeof default in test.vue | | other.ts:1:23:1:34 | "./test.vue" | any | -| other.ts:2:8:2:19 | ComponentTsx | typeof default in library-tests/TypeScript/EmbeddedInScript/test_tsx.vue | +| other.ts:2:8:2:19 | ComponentTsx | typeof default in test_tsx.vue | | other.ts:2:26:2:41 | "./test_tsx.vue" | any | | other.ts:4:1:4:15 | new Component() | MyComponent | -| other.ts:4:5:4:13 | Component | typeof default in library-tests/TypeScript/EmbeddedInScript/test.vue | +| other.ts:4:5:4:13 | Component | typeof default in test.vue | | other.ts:5:1:5:18 | new ComponentTsx() | MyComponentTsx | -| other.ts:5:5:5:16 | ComponentTsx | typeof default in library-tests/TypeScript/EmbeddedInScript/test_tsx.vue | +| other.ts:5:5:5:16 | ComponentTsx | typeof default in test_tsx.vue | | other.ts:7:17:7:19 | foo | () => void | -| test.vue:2:15:2:19 | other | typeof library-tests/TypeScript/EmbeddedInScript/other.ts | +| test.vue:2:15:2:19 | other | typeof other.ts | | test.vue:2:26:2:34 | "./other" | any | | test.vue:3:24:3:34 | MyComponent | MyComponent | | test.vue:4:7:4:7 | x | number | -| test_tsx.vue:2:15:2:19 | other | typeof library-tests/TypeScript/EmbeddedInScript/other.ts | +| test_tsx.vue:2:15:2:19 | other | typeof other.ts | | test_tsx.vue:2:26:2:34 | "./other" | any | | test_tsx.vue:3:24:3:37 | MyComponentTsx | MyComponentTsx | | test_tsx.vue:4:7:4:7 | x | number | symbols -| other.ts:1:1:8:0 | | library-tests/TypeScript/EmbeddedInScript/other.ts | -| test.vue:2:3:6:0 | | library-tests/TypeScript/EmbeddedInScript/test.vue | -| test_tsx.vue:2:3:6:0 | | library-tests/TypeScript/EmbeddedInScript/test_tsx.vue | +| other.ts:1:1:8:0 | | other.ts | +| test.vue:2:3:6:0 | | test.vue | +| test_tsx.vue:2:3:6:0 | | test_tsx.vue | importTarget | htmlfile.html:4:13:4:42 | import ... other"; | other.ts:1:1:8:0 | | | other.ts:1:1:1:35 | import ... t.vue"; | test.vue:2:3:6:0 | | diff --git a/javascript/ql/test/library-tests/TypeScript/HasQualifiedNameFallback/Test.expected b/javascript/ql/test/library-tests/TypeScript/HasQualifiedNameFallback/Test.expected index 5da73c5cfe45..5ee97e2dfb59 100644 --- a/javascript/ql/test/library-tests/TypeScript/HasQualifiedNameFallback/Test.expected +++ b/javascript/ql/test/library-tests/TypeScript/HasQualifiedNameFallback/Test.expected @@ -1,12 +1,12 @@ hasQualifiedNameModule | default-import | default | tst.ts:11:9:11:21 | DefaultImport | | import-assign | Foo | tst.ts:10:9:10:15 | asn.Foo | -| library-tests/TypeScript/HasQualifiedNameFallback/tst.ts | ExportedClass | relative.ts:4:8:4:20 | ExportedClass | | named-import | Name1 | tst.ts:7:9:7:13 | Name1 | | named-import | Name1 | tst.ts:13:9:13:13 | Name1 | | named-import | Name1 | tst.ts:13:9:13:21 | Name1 | | named-import | Name2 | tst.ts:8:9:8:13 | Name2 | | namespace-import | Foo | tst.ts:9:9:9:21 | namespace.Foo | +| tst.ts | ExportedClass | relative.ts:4:8:4:20 | ExportedClass | hasQualifiedNameGlobal | UnresolvedName | tst.ts:12:9:12:22 | UnresolvedName | paramExample diff --git a/javascript/ql/test/library-tests/TypeScript/PathMapping/Imports.expected b/javascript/ql/test/library-tests/TypeScript/PathMapping/Imports.expected index c608ea2c7b61..886391b14552 100644 --- a/javascript/ql/test/library-tests/TypeScript/PathMapping/Imports.expected +++ b/javascript/ql/test/library-tests/TypeScript/PathMapping/Imports.expected @@ -1,11 +1,11 @@ symbols -| src/lib/foo.ts:1:1:4:0 | | library-tests/TypeScript/PathMapping/src/lib/foo.ts | -| src/lib/foo.ts:1:8:3:1 | functio ... 123;\\n} | foo in library-tests/TypeScript/PathMapping/src/lib/foo.ts | -| test/test_foo.ts:1:1:1:28 | import ... @/foo"; | library-tests/TypeScript/PathMapping/src/lib/foo.ts | -| test/test_foo.ts:1:1:7:0 | | library-tests/TypeScript/PathMapping/test/test_foo.ts | -| test/test_foo.ts:2:17:2:32 | require("@/foo") | library-tests/TypeScript/PathMapping/src/lib/foo.ts | -| test/test_foo.ts:4:1:4:5 | foo() | foo in library-tests/TypeScript/PathMapping/src/lib/foo.ts | -| test/test_foo.ts:6:1:6:12 | foolib.foo() | foo in library-tests/TypeScript/PathMapping/src/lib/foo.ts | +| src/lib/foo.ts:1:1:4:0 | | src/lib/foo.ts | +| src/lib/foo.ts:1:8:3:1 | functio ... 123;\\n} | foo in src/lib/foo.ts | +| test/test_foo.ts:1:1:1:28 | import ... @/foo"; | src/lib/foo.ts | +| test/test_foo.ts:1:1:7:0 | | test/test_foo.ts | +| test/test_foo.ts:2:17:2:32 | require("@/foo") | src/lib/foo.ts | +| test/test_foo.ts:4:1:4:5 | foo() | foo in src/lib/foo.ts | +| test/test_foo.ts:6:1:6:12 | foolib.foo() | foo in src/lib/foo.ts | #select | test/test_foo.ts:1:1:1:28 | import ... @/foo"; | src/lib/foo.ts:1:1:4:0 | | | test/test_foo.ts:2:17:2:32 | require("@/foo") | src/lib/foo.ts:1:1:4:0 | | diff --git a/javascript/ql/test/library-tests/TypeScript/QualifiedNameResolution/Namespaces.expected b/javascript/ql/test/library-tests/TypeScript/QualifiedNameResolution/Namespaces.expected index 214b23594e7f..0494011bc70a 100644 --- a/javascript/ql/test/library-tests/TypeScript/QualifiedNameResolution/Namespaces.expected +++ b/javascript/ql/test/library-tests/TypeScript/QualifiedNameResolution/Namespaces.expected @@ -1,33 +1,33 @@ -| A in library-tests/TypeScript/QualifiedNameResolution/enums.ts | -| A in library-tests/TypeScript/QualifiedNameResolution/export-qualified.ts | -| A in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| A.B in library-tests/TypeScript/QualifiedNameResolution/export-qualified.ts | -| A.C in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| A.E in library-tests/TypeScript/QualifiedNameResolution/enums.ts | +| A in enums.ts | +| A in export-qualified.ts | +| A in namespaces.ts | +| A.B in export-qualified.ts | +| A.C in namespaces.ts | +| A.E in enums.ts | | B in namespaces.ts:3 | | B in namespaces.ts:10 | | B.Bx in namespaces.ts:3 | | B.Bx in namespaces.ts:10 | -| D in library-tests/TypeScript/QualifiedNameResolution/export-specifiers.ts | -| D in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| D in library-tests/TypeScript/QualifiedNameResolution/otherlib.ts | -| D.F in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | +| D in export-specifiers.ts | +| D in namespaces.ts | +| D in otherlib.ts | +| D.F in namespaces.ts | | E in namespaces.ts:17 | | E in namespaces.ts:22 | | Foo in global scope | -| G in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| G.J in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | +| G in namespaces.ts | +| G.J in namespaces.ts | | Glob in global scope | | H in namespaces.ts:27 | | H.I in namespaces.ts:27 | -| N in library-tests/TypeScript/QualifiedNameResolution/export-specifiers.ts | +| N in export-specifiers.ts | | X in global scope | -| X in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| X.Y in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| X.Y.Z in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | +| X in namespaces.ts | +| X.Y in namespaces.ts | +| X.Y.Z in namespaces.ts | | Y in global scope | -| library-tests/TypeScript/QualifiedNameResolution/export-class.ts | -| library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| library-tests/TypeScript/QualifiedNameResolution/otherlib.ts | -| library-tests/TypeScript/QualifiedNameResolution/reexport-all.ts | -| library-tests/TypeScript/QualifiedNameResolution/reexport-named.ts | +| export-class.ts | +| namespaces.ts | +| otherlib.ts | +| reexport-all.ts | +| reexport-named.ts | diff --git a/javascript/ql/test/library-tests/TypeScript/QualifiedNameResolution/ResolveNamespace.expected b/javascript/ql/test/library-tests/TypeScript/QualifiedNameResolution/ResolveNamespace.expected index 20df7b95bd9a..7ec8faec19ff 100644 --- a/javascript/ql/test/library-tests/TypeScript/QualifiedNameResolution/ResolveNamespace.expected +++ b/javascript/ql/test/library-tests/TypeScript/QualifiedNameResolution/ResolveNamespace.expected @@ -1,31 +1,31 @@ | ambient.ts:5:16:5:18 | Foo | Foo in global scope | -| enums.ts:9:8:9:8 | A | A in library-tests/TypeScript/QualifiedNameResolution/enums.ts | -| enums.ts:9:8:9:10 | A.E | A.E in library-tests/TypeScript/QualifiedNameResolution/enums.ts | -| enums.ts:10:8:10:8 | A | A in library-tests/TypeScript/QualifiedNameResolution/enums.ts | -| export-qualified-client.ts:3:8:3:9 | AB | A.B in library-tests/TypeScript/QualifiedNameResolution/export-qualified.ts | -| export-specifiers-client.ts:4:8:4:8 | N | N in library-tests/TypeScript/QualifiedNameResolution/export-specifiers.ts | -| export-specifiers-client.ts:5:8:5:8 | D | D in library-tests/TypeScript/QualifiedNameResolution/export-specifiers.ts | +| enums.ts:9:8:9:8 | A | A in enums.ts | +| enums.ts:9:8:9:10 | A.E | A.E in enums.ts | +| enums.ts:10:8:10:8 | A | A in enums.ts | +| export-qualified-client.ts:3:8:3:9 | AB | A.B in export-qualified.ts | +| export-specifiers-client.ts:4:8:4:8 | N | N in export-specifiers.ts | +| export-specifiers-client.ts:5:8:5:8 | D | D in export-specifiers.ts | | global.ts:5:9:5:12 | Glob | Glob in global scope | | import-in-namespace.ts:9:13:9:13 | A | X in global scope | -| namespaces-client.ts:4:9:4:10 | ns | library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| namespaces-client.ts:4:9:4:12 | ns.G | G in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| namespaces-client.ts:5:9:5:9 | G | G in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| namespaces-client.ts:6:9:6:9 | G | G in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| namespaces-client.ts:6:9:6:11 | G.J | G.J in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-all-client.ts:4:9:4:10 | ns | library-tests/TypeScript/QualifiedNameResolution/reexport-all.ts | -| reexport-all-client.ts:4:9:4:12 | ns.G | G in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-all-client.ts:5:9:5:9 | G | G in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-all-client.ts:6:9:6:9 | G | G in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-all-client.ts:6:9:6:11 | G.J | G.J in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-all-client.ts:8:8:8:8 | D | D in library-tests/TypeScript/QualifiedNameResolution/otherlib.ts | -| reexport-all-client.ts:9:8:9:9 | ns | library-tests/TypeScript/QualifiedNameResolution/reexport-all.ts | -| reexport-all-client.ts:9:8:9:11 | ns.D | D in library-tests/TypeScript/QualifiedNameResolution/otherlib.ts | -| reexport-all-client.ts:11:8:11:9 | ns | library-tests/TypeScript/QualifiedNameResolution/reexport-all.ts | -| reexport-named-client.ts:4:9:4:10 | ns | library-tests/TypeScript/QualifiedNameResolution/reexport-named.ts | -| reexport-named-client.ts:4:9:4:12 | ns.G | G in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-named-client.ts:5:9:5:9 | G | G in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-named-client.ts:6:9:6:9 | G | G in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-named-client.ts:6:9:6:11 | G.J | G.J in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-named-client.ts:8:8:8:8 | X | D in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-named-client.ts:9:8:9:9 | ns | library-tests/TypeScript/QualifiedNameResolution/reexport-named.ts | -| reexport-named-client.ts:9:8:9:11 | ns.X | D in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | +| namespaces-client.ts:4:9:4:10 | ns | namespaces.ts | +| namespaces-client.ts:4:9:4:12 | ns.G | G in namespaces.ts | +| namespaces-client.ts:5:9:5:9 | G | G in namespaces.ts | +| namespaces-client.ts:6:9:6:9 | G | G in namespaces.ts | +| namespaces-client.ts:6:9:6:11 | G.J | G.J in namespaces.ts | +| reexport-all-client.ts:4:9:4:10 | ns | reexport-all.ts | +| reexport-all-client.ts:4:9:4:12 | ns.G | G in namespaces.ts | +| reexport-all-client.ts:5:9:5:9 | G | G in namespaces.ts | +| reexport-all-client.ts:6:9:6:9 | G | G in namespaces.ts | +| reexport-all-client.ts:6:9:6:11 | G.J | G.J in namespaces.ts | +| reexport-all-client.ts:8:8:8:8 | D | D in otherlib.ts | +| reexport-all-client.ts:9:8:9:9 | ns | reexport-all.ts | +| reexport-all-client.ts:9:8:9:11 | ns.D | D in otherlib.ts | +| reexport-all-client.ts:11:8:11:9 | ns | reexport-all.ts | +| reexport-named-client.ts:4:9:4:10 | ns | reexport-named.ts | +| reexport-named-client.ts:4:9:4:12 | ns.G | G in namespaces.ts | +| reexport-named-client.ts:5:9:5:9 | G | G in namespaces.ts | +| reexport-named-client.ts:6:9:6:9 | G | G in namespaces.ts | +| reexport-named-client.ts:6:9:6:11 | G.J | G.J in namespaces.ts | +| reexport-named-client.ts:8:8:8:8 | X | D in namespaces.ts | +| reexport-named-client.ts:9:8:9:9 | ns | reexport-named.ts | +| reexport-named-client.ts:9:8:9:11 | ns.X | D in namespaces.ts | diff --git a/javascript/ql/test/library-tests/TypeScript/QualifiedNameResolution/ResolveTypeName.expected b/javascript/ql/test/library-tests/TypeScript/QualifiedNameResolution/ResolveTypeName.expected index 008b2cbbbeb0..1629bdac5b15 100644 --- a/javascript/ql/test/library-tests/TypeScript/QualifiedNameResolution/ResolveTypeName.expected +++ b/javascript/ql/test/library-tests/TypeScript/QualifiedNameResolution/ResolveTypeName.expected @@ -1,27 +1,27 @@ | ambient.ts:5:16:5:20 | Foo.C | Foo.C in global scope | -| enums.ts:9:8:9:12 | A.E.x | A.E.x in library-tests/TypeScript/QualifiedNameResolution/enums.ts | -| enums.ts:10:8:10:10 | A.E | A.E in library-tests/TypeScript/QualifiedNameResolution/enums.ts | -| export-class-client-renamed.ts:3:8:3:8 | X | Banana in library-tests/TypeScript/QualifiedNameResolution/export-class.ts | -| export-class-client.ts:3:8:3:13 | Banana | Banana in library-tests/TypeScript/QualifiedNameResolution/export-class.ts | -| export-qualified-client.ts:3:8:3:11 | AB.C | A.B.C in library-tests/TypeScript/QualifiedNameResolution/export-qualified.ts | -| export-specifiers-client.ts:4:8:4:10 | N.C | N.C in library-tests/TypeScript/QualifiedNameResolution/export-specifiers.ts | -| export-specifiers-client.ts:5:8:5:10 | D.C | D.C in library-tests/TypeScript/QualifiedNameResolution/export-specifiers.ts | -| export-specifiers-client.ts:6:8:6:8 | C | C in library-tests/TypeScript/QualifiedNameResolution/export-specifiers.ts | +| enums.ts:9:8:9:12 | A.E.x | A.E.x in enums.ts | +| enums.ts:10:8:10:10 | A.E | A.E in enums.ts | +| export-class-client-renamed.ts:3:8:3:8 | X | Banana in export-class.ts | +| export-class-client.ts:3:8:3:13 | Banana | Banana in export-class.ts | +| export-qualified-client.ts:3:8:3:11 | AB.C | A.B.C in export-qualified.ts | +| export-specifiers-client.ts:4:8:4:10 | N.C | N.C in export-specifiers.ts | +| export-specifiers-client.ts:5:8:5:10 | D.C | D.C in export-specifiers.ts | +| export-specifiers-client.ts:6:8:6:8 | C | C in export-specifiers.ts | | global.ts:5:9:5:14 | Glob.C | Glob.C in global scope | | import-in-namespace.ts:9:13:9:15 | A.C | X.C in global scope | | import-in-namespace.ts:10:13:10:13 | D | X.C in global scope | -| namespaces-client.ts:4:9:4:14 | ns.G.C | G.C in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| namespaces-client.ts:5:9:5:11 | G.C | G.C in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| namespaces-client.ts:6:9:6:13 | G.J.C | G.J.C in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-all-client.ts:4:9:4:14 | ns.G.C | G.C in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-all-client.ts:5:9:5:11 | G.C | G.C in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-all-client.ts:6:9:6:13 | G.J.C | G.J.C in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | +| namespaces-client.ts:4:9:4:14 | ns.G.C | G.C in namespaces.ts | +| namespaces-client.ts:5:9:5:11 | G.C | G.C in namespaces.ts | +| namespaces-client.ts:6:9:6:13 | G.J.C | G.J.C in namespaces.ts | +| reexport-all-client.ts:4:9:4:14 | ns.G.C | G.C in namespaces.ts | +| reexport-all-client.ts:5:9:5:11 | G.C | G.C in namespaces.ts | +| reexport-all-client.ts:6:9:6:13 | G.J.C | G.J.C in namespaces.ts | | reexport-all-client.ts:8:8:8:10 | D.F | D.F in unknown scope | | reexport-all-client.ts:9:8:9:13 | ns.D.F | ns.D.F in unknown scope | -| reexport-all-client.ts:11:8:11:16 | ns.Banana | Banana in library-tests/TypeScript/QualifiedNameResolution/export-class.ts | -| reexport-named-client.ts:4:9:4:14 | ns.G.C | G.C in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-named-client.ts:5:9:5:11 | G.C | G.C in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-named-client.ts:6:9:6:13 | G.J.C | G.J.C in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | +| reexport-all-client.ts:11:8:11:16 | ns.Banana | Banana in export-class.ts | +| reexport-named-client.ts:4:9:4:14 | ns.G.C | G.C in namespaces.ts | +| reexport-named-client.ts:5:9:5:11 | G.C | G.C in namespaces.ts | +| reexport-named-client.ts:6:9:6:13 | G.J.C | G.J.C in namespaces.ts | | reexport-named-client.ts:8:8:8:10 | X.F | X.F in unknown scope | | reexport-named-client.ts:9:8:9:13 | ns.X.F | ns.X.F in unknown scope | -| reexport-named-client.ts:11:9:11:9 | Y | Banana in library-tests/TypeScript/QualifiedNameResolution/export-class.ts | +| reexport-named-client.ts:11:9:11:9 | Y | Banana in export-class.ts | diff --git a/javascript/ql/test/library-tests/TypeScript/RegressionTests/EmptyName/test.expected b/javascript/ql/test/library-tests/TypeScript/RegressionTests/EmptyName/test.expected index 47317a00a867..85cb86df42a2 100644 --- a/javascript/ql/test/library-tests/TypeScript/RegressionTests/EmptyName/test.expected +++ b/javascript/ql/test/library-tests/TypeScript/RegressionTests/EmptyName/test.expected @@ -1,4 +1,4 @@ | MK in unknown scope | -| Mapped in library-tests/TypeScript/RegressionTests/EmptyName/test.ts | -| fn in library-tests/TypeScript/RegressionTests/EmptyName/test.ts | -| library-tests/TypeScript/RegressionTests/EmptyName/test.ts | +| Mapped in test.ts | +| fn in test.ts | +| test.ts | diff --git a/javascript/ql/test/library-tests/TypeScript/RegressionTests/ExportEqualsExpr/test.expected b/javascript/ql/test/library-tests/TypeScript/RegressionTests/ExportEqualsExpr/test.expected index 3736c602bc32..24fc12058753 100644 --- a/javascript/ql/test/library-tests/TypeScript/RegressionTests/ExportEqualsExpr/test.expected +++ b/javascript/ql/test/library-tests/TypeScript/RegressionTests/ExportEqualsExpr/test.expected @@ -1,7 +1,7 @@ | "bar" in global scope | | C in module 'bar' | | Foo in global scope | -| Foo in library-tests/TypeScript/RegressionTests/ExportEqualsExpr/tst.ts | -| library-tests/TypeScript/RegressionTests/ExportEqualsExpr/tst.ts | +| Foo in tst.ts | | module 'bar' | | module 'foo' | +| tst.ts | diff --git a/javascript/ql/test/library-tests/TypeScript/RegressionTests/SemicolonInName/test.expected b/javascript/ql/test/library-tests/TypeScript/RegressionTests/SemicolonInName/test.expected index 074e6d0c2777..603eaba0d279 100644 --- a/javascript/ql/test/library-tests/TypeScript/RegressionTests/SemicolonInName/test.expected +++ b/javascript/ql/test/library-tests/TypeScript/RegressionTests/SemicolonInName/test.expected @@ -1,2 +1,2 @@ | Bar.Foo in global scope | Bar in global scope | -| fn in library-tests/TypeScript/RegressionTests/SemicolonInName/test.ts | library-tests/TypeScript/RegressionTests/SemicolonInName/test.ts | +| fn in test.ts | test.ts | diff --git a/javascript/ql/test/library-tests/TypeScript/SyntaxErrors/SyntaxErrors.expected b/javascript/ql/test/library-tests/TypeScript/SyntaxErrors/SyntaxErrors.expected index 58e88ed6fe11..cca870438e91 100644 --- a/javascript/ql/test/library-tests/TypeScript/SyntaxErrors/SyntaxErrors.expected +++ b/javascript/ql/test/library-tests/TypeScript/SyntaxErrors/SyntaxErrors.expected @@ -1 +1 @@ -| library-tests/TypeScript/SyntaxErrors/jsdocTypes.ts | This file contains a parse error | +| jsdocTypes.ts | This file contains a parse error | diff --git a/javascript/ql/test/library-tests/TypeScript/Types/tests.expected b/javascript/ql/test/library-tests/TypeScript/Types/tests.expected index 1cf1ca607ae3..b786fae3713e 100644 --- a/javascript/ql/test/library-tests/TypeScript/Types/tests.expected +++ b/javascript/ql/test/library-tests/TypeScript/Types/tests.expected @@ -1,7 +1,7 @@ booleans | boolean | getExprType -| boolean-type.ts:1:13:1:17 | dummy | typeof library-tests/TypeScript/Types/dummy.ts | +| boolean-type.ts:1:13:1:17 | dummy | typeof dummy.ts | | boolean-type.ts:1:24:1:32 | "./dummy" | any | | boolean-type.ts:3:5:3:9 | true1 | true | | boolean-type.ts:4:5:4:9 | true2 | true | @@ -24,7 +24,7 @@ getExprType | middle-rest.ts:3:8:3:11 | true | true | | middle-rest.ts:3:14:3:20 | "hello" | "hello" | | middle-rest.ts:3:23:3:25 | 123 | 123 | -| tst.ts:1:13:1:17 | dummy | typeof library-tests/TypeScript/Types/dummy.ts | +| tst.ts:1:13:1:17 | dummy | typeof dummy.ts | | tst.ts:1:24:1:32 | "./dummy" | any | | tst.ts:3:5:3:10 | numVar | number | | tst.ts:5:5:5:8 | num1 | number | @@ -127,7 +127,7 @@ getExprType | tst.ts:69:24:69:45 | {yetAno ... : true} | MyUnion2 | | tst.ts:69:25:69:38 | yetAnotherType | true | | tst.ts:69:41:69:44 | true | true | -| tst.ts:71:8:71:11 | TS43 | typeof TS43 in library-tests/TypeScript/Types/tst.ts | +| tst.ts:71:8:71:11 | TS43 | typeof TS43 in tst.ts | | tst.ts:74:5:74:22 | get size(): number | number | | tst.ts:74:9:74:12 | size | number | | tst.ts:75:5:75:47 | set siz ... olean); | number | @@ -175,7 +175,7 @@ getExprType | tst.ts:126:7:126:22 | this.#someMethod | () => number | | tst.ts:126:7:126:24 | this.#someMethod() | number | | tst.ts:127:14:127:28 | this.#someValue | number | -| tst.ts:132:8:132:11 | TS44 | typeof TS44 in library-tests/TypeScript/Types/tst.ts | +| tst.ts:132:8:132:11 | TS44 | typeof TS44 in tst.ts | | tst.ts:133:12:133:14 | foo | (arg: unknown) => void | | tst.ts:133:16:133:18 | arg | unknown | | tst.ts:134:11:134:21 | argIsString | boolean | @@ -260,7 +260,7 @@ getExprType | tst.ts:189:11:189:15 | count | number | | tst.ts:189:19:189:21 | Foo | typeof Foo in tst.ts:132 | | tst.ts:189:19:189:28 | Foo.#count | number | -| tst.ts:195:8:195:11 | TS45 | typeof TS45 in library-tests/TypeScript/Types/tst.ts | +| tst.ts:195:8:195:11 | TS45 | typeof TS45 in tst.ts | | tst.ts:207:5:207:8 | body | string | | tst.ts:212:7:212:13 | message | string | | tst.ts:215:19:215:25 | handler | (r: Success \| Error) => void | @@ -301,7 +301,7 @@ getExprType | tst.ts:238:11:238:14 | Foo3 | { foo: string; } | | tst.ts:238:11:238:18 | Foo3.foo | string | | tst.ts:238:16:238:18 | foo | string | -| tst.ts:240:8:240:11 | TS46 | typeof TS46 in library-tests/TypeScript/Types/tst.ts | +| tst.ts:240:8:240:11 | TS46 | typeof TS46 in tst.ts | | tst.ts:241:9:241:12 | Base | Base | | tst.ts:243:9:243:15 | Derived | Derived | | tst.ts:243:25:243:28 | Base | Base | @@ -481,27 +481,27 @@ getExprType | tst.ts:362:9:362:11 | log | (...data: any[]) => void | | tst.ts:362:13:362:24 | tstModuleCJS | () => "a" \| "b" | | tst.ts:362:13:362:26 | tstModuleCJS() | "a" \| "b" | -| tst.ts:368:13:368:13 | A | typeof library-tests/TypeScript/Types/tstSuffixA.ts | +| tst.ts:368:13:368:13 | A | typeof tstSuffixA.ts | | tst.ts:368:20:368:33 | './tstSuffixA' | any | | tst.ts:370:1:370:7 | console | Console | | tst.ts:370:1:370:11 | console.log | (...data: any[]) => void | | tst.ts:370:1:370:29 | console ... File()) | void | | tst.ts:370:9:370:11 | log | (...data: any[]) => void | -| tst.ts:370:13:370:13 | A | typeof library-tests/TypeScript/Types/tstSuffixA.ts | +| tst.ts:370:13:370:13 | A | typeof tstSuffixA.ts | | tst.ts:370:13:370:26 | A.resolvedFile | () => "tstSuffixA.ts" | | tst.ts:370:13:370:28 | A.resolvedFile() | "tstSuffixA.ts" | | tst.ts:370:15:370:26 | resolvedFile | () => "tstSuffixA.ts" | -| tst.ts:372:13:372:13 | B | typeof library-tests/TypeScript/Types/tstSuffixB.ios.ts | +| tst.ts:372:13:372:13 | B | typeof tstSuffixB.ios.ts | | tst.ts:372:20:372:33 | './tstSuffixB' | any | | tst.ts:374:1:374:7 | console | Console | | tst.ts:374:1:374:11 | console.log | (...data: any[]) => void | | tst.ts:374:1:374:29 | console ... File()) | void | | tst.ts:374:9:374:11 | log | (...data: any[]) => void | -| tst.ts:374:13:374:13 | B | typeof library-tests/TypeScript/Types/tstSuffixB.ios.ts | +| tst.ts:374:13:374:13 | B | typeof tstSuffixB.ios.ts | | tst.ts:374:13:374:26 | B.resolvedFile | () => "tstSuffixB.ios.ts" | | tst.ts:374:13:374:28 | B.resolvedFile() | "tstSuffixB.ios.ts" | | tst.ts:374:15:374:26 | resolvedFile | () => "tstSuffixB.ios.ts" | -| tst.ts:379:8:379:11 | TS48 | typeof TS48 in library-tests/TypeScript/Types/tst.ts | +| tst.ts:379:8:379:11 | TS48 | typeof TS48 in tst.ts | | tst.ts:383:22:383:35 | chooseRandomly | (x: T, y: T) => T | | tst.ts:383:40:383:40 | x | T | | tst.ts:383:46:383:46 | y | T | @@ -518,7 +518,7 @@ getExprType | tst.ts:385:56:385:56 | 0 | 0 | | tst.ts:385:59:385:63 | false | false | | tst.ts:385:66:385:71 | "bye!" | "bye!" | -| tst.ts:390:8:390:11 | TS49 | typeof TS49 in library-tests/TypeScript/Types/tst.ts | +| tst.ts:390:8:390:11 | TS49 | typeof TS49 in tst.ts | | tst.ts:395:9:395:15 | palette | { red: [number, number, number]; green: string;... | | tst.ts:395:19:399:3 | {\\n r ... 5],\\n } | Record | | tst.ts:395:19:399:42 | {\\n r ... \| RGB> | { red: [number, number, number]; green: string;... | @@ -559,7 +559,7 @@ getExprType | tst.ts:423:7:423:22 | this.name = name | string | | tst.ts:423:12:423:15 | name | string | | tst.ts:423:19:423:22 | name | string | -| tst.ts:430:8:430:11 | TS50 | typeof TS50 in library-tests/TypeScript/Types/tst.ts | +| tst.ts:430:8:430:11 | TS50 | typeof TS50 in tst.ts | | tst.ts:432:33:432:36 | args | Args | | tst.ts:433:68:433:71 | args | Args | | tst.ts:435:15:435:24 | methodName | string | @@ -632,7 +632,7 @@ getExprType | tst.ts:467:15:467:17 | foo | readonly ["a", "b", "c"] | | tst.ts:467:15:467:20 | foo[1] | "b" | | tst.ts:467:19:467:19 | 1 | 1 | -| tst.ts:472:8:472:11 | TS52 | typeof TS52 in library-tests/TypeScript/Types/tst.ts | +| tst.ts:472:8:472:11 | TS52 | typeof TS52 in tst.ts | | tst.ts:473:11:473:19 | SomeClass | SomeClass | | tst.ts:474:10:474:36 | ((_targ ... => {}) | (_target: undefined, _context: ClassFieldDecora... | | tst.ts:474:11:474:35 | (_targe ... ) => {} | (_target: undefined, _context: ClassFieldDecora... | @@ -657,7 +657,7 @@ getExprType | tst.ts:483:17:483:58 | ["hello ... string> | [first: string, string] | | tst.ts:483:18:483:24 | "hello" | "hello" | | tst.ts:483:27:483:33 | "world" | "world" | -| tst.ts:486:8:486:11 | TS54 | typeof TS54 in library-tests/TypeScript/Types/tst.ts | +| tst.ts:486:8:486:11 | TS54 | typeof TS54 in tst.ts | | tst.ts:487:48:487:53 | colors | C[] | | tst.ts:488:12:488:17 | colors | C[] | | tst.ts:488:12:488:20 | colors[0] | C | @@ -691,7 +691,7 @@ getExprType | tst.ts:494:24:494:24 | 0 | 0 | | tst.ts:494:28:494:33 | "even" | "even" | | tst.ts:494:36:494:40 | "odd" | "odd" | -| tst.ts:498:8:498:11 | TS55 | typeof TS55 in library-tests/TypeScript/Types/tst.ts | +| tst.ts:498:8:498:11 | TS55 | typeof TS55 in tst.ts | | tst.ts:499:9:499:15 | strings | string[] | | tst.ts:499:19:499:32 | (["foo", 123]) | (string \| number)[] | | tst.ts:499:19:500:11 | (["foo" ... .filter | { (predicate: (value... | @@ -779,18 +779,18 @@ getExprType | type_alias.ts:26:19:26:20 | id | string | | type_alias.ts:26:23:26:36 | "second-child" | "second-child" | | type_alias.ts:26:41:26:62 | "I'm th ... child" | "I'm the second child" | -| type_definition_objects.ts:1:13:1:17 | dummy | typeof library-tests/TypeScript/Types/dummy.ts | +| type_definition_objects.ts:1:13:1:17 | dummy | typeof dummy.ts | | type_definition_objects.ts:1:24:1:32 | "./dummy" | any | | type_definition_objects.ts:3:14:3:14 | C | C | -| type_definition_objects.ts:4:5:4:12 | classObj | typeof C in library-tests/TypeScript/Types/type_definition_objects.ts | -| type_definition_objects.ts:4:16:4:16 | C | typeof C in library-tests/TypeScript/Types/type_definition_objects.ts | +| type_definition_objects.ts:4:5:4:12 | classObj | typeof C in type_definition_objects.ts | +| type_definition_objects.ts:4:16:4:16 | C | typeof C in type_definition_objects.ts | | type_definition_objects.ts:6:13:6:13 | E | E | -| type_definition_objects.ts:7:5:7:11 | enumObj | typeof E in library-tests/TypeScript/Types/type_definition_objects.ts | -| type_definition_objects.ts:7:15:7:15 | E | typeof E in library-tests/TypeScript/Types/type_definition_objects.ts | -| type_definition_objects.ts:9:18:9:18 | N | typeof N in library-tests/TypeScript/Types/type_definition_objects.ts | -| type_definition_objects.ts:10:5:10:16 | namespaceObj | typeof N in library-tests/TypeScript/Types/type_definition_objects.ts | -| type_definition_objects.ts:10:20:10:20 | N | typeof N in library-tests/TypeScript/Types/type_definition_objects.ts | -| type_definitions.ts:1:13:1:17 | dummy | typeof library-tests/TypeScript/Types/dummy.ts | +| type_definition_objects.ts:7:5:7:11 | enumObj | typeof E in type_definition_objects.ts | +| type_definition_objects.ts:7:15:7:15 | E | typeof E in type_definition_objects.ts | +| type_definition_objects.ts:9:18:9:18 | N | typeof N in type_definition_objects.ts | +| type_definition_objects.ts:10:5:10:16 | namespaceObj | typeof N in type_definition_objects.ts | +| type_definition_objects.ts:10:20:10:20 | N | typeof N in type_definition_objects.ts | +| type_definitions.ts:1:13:1:17 | dummy | typeof dummy.ts | | type_definitions.ts:1:24:1:32 | "./dummy" | any | | type_definitions.ts:4:3:4:3 | x | S | | type_definitions.ts:6:5:6:5 | i | I | diff --git a/javascript/ql/test/query-tests/Metrics/ExternalDependencies/ExternalDependencies.expected b/javascript/ql/test/query-tests/Metrics/ExternalDependencies/ExternalDependencies.expected index d690d12e11b1..39b6d8ffcad8 100644 --- a/javascript/ql/test/query-tests/Metrics/ExternalDependencies/ExternalDependencies.expected +++ b/javascript/ql/test/query-tests/Metrics/ExternalDependencies/ExternalDependencies.expected @@ -1,9 +1,9 @@ -| /query-tests/Metrics/ExternalDependencies/src/tst.html<\|>jquery<\|>23.0.0 | 4 | -| /query-tests/Metrics/ExternalDependencies/src/a.js<\|>lib3<\|>unknown | 3 | -| /query-tests/Metrics/ExternalDependencies/src/tst.html<\|>jquery<\|>42.0.0 | 3 | -| /query-tests/Metrics/ExternalDependencies/src/a.js<\|>lib1<\|>1.0.2 | 2 | -| /query-tests/Metrics/ExternalDependencies/src/b.js<\|>lib3<\|>unknown | 2 | -| /query-tests/Metrics/ExternalDependencies/src/a.js<\|>lib2<\|>1.0.0 | 1 | -| /query-tests/Metrics/ExternalDependencies/src/b.js<\|>lib2<\|>1.0.0 | 1 | -| /query-tests/Metrics/ExternalDependencies/src/sub/c.js<\|>lib1<\|>1.0.2 | 1 | -| /query-tests/Metrics/ExternalDependencies/src/sub/subsub/d.js<\|>lib1<\|>1.0.3 | 1 | +| /src/tst.html<\|>jquery<\|>23.0.0 | 4 | +| /src/a.js<\|>lib3<\|>unknown | 3 | +| /src/tst.html<\|>jquery<\|>42.0.0 | 3 | +| /src/a.js<\|>lib1<\|>1.0.2 | 2 | +| /src/b.js<\|>lib3<\|>unknown | 2 | +| /src/a.js<\|>lib2<\|>1.0.0 | 1 | +| /src/b.js<\|>lib2<\|>1.0.0 | 1 | +| /src/sub/c.js<\|>lib1<\|>1.0.2 | 1 | +| /src/sub/subsub/d.js<\|>lib1<\|>1.0.3 | 1 | diff --git a/javascript/ql/test/query-tests/NodeJS/CyclicImport/CyclicImport.expected b/javascript/ql/test/query-tests/NodeJS/CyclicImport/CyclicImport.expected index c19bb2303441..2fb5f863389e 100644 --- a/javascript/ql/test/query-tests/NodeJS/CyclicImport/CyclicImport.expected +++ b/javascript/ql/test/query-tests/NodeJS/CyclicImport/CyclicImport.expected @@ -1,7 +1,7 @@ | a.js:4:9:4:25 | require('./b.js') | Module a imports module b, which in turn $@ it. | b.js:4:9:4:25 | require('./a.js') | imports | | b.js:4:9:4:25 | require('./a.js') | Module b imports module a, which in turn $@ it. | a.js:4:9:4:25 | require('./b.js') | imports | | selfimport.js:1:1:1:23 | require ... mport') | Module selfimport directly imports itself. | selfimport.js:1:1:1:24 | | | -| test1/a.js:1:1:1:27 | require ... ner/a') | Module .../test1/a.js imports module .../inner/a.js, which in turn $@ it. | test2/inner/a.js:1:1:1:24 | require ... st1/a') | imports | +| test1/a.js:1:1:1:27 | require ... ner/a') | Module /test1/a.js imports module .../inner/a.js, which in turn $@ it. | test2/inner/a.js:1:1:1:24 | require ... st1/a') | imports | | test1/a.js:2:1:2:14 | require('./b') | Module a imports module b, which in turn $@ it. | test1/b.js:1:1:1:27 | require ... ner/a') | indirectly imports | | test1/b.js:1:1:1:27 | require ... ner/a') | Module b imports module a, which in turn $@ it. | test2/inner/a.js:1:1:1:24 | require ... st1/a') | indirectly imports | -| test2/inner/a.js:1:1:1:24 | require ... st1/a') | Module .../inner/a.js imports module .../test1/a.js, which in turn $@ it. | test1/a.js:1:1:1:27 | require ... ner/a') | imports | +| test2/inner/a.js:1:1:1:24 | require ... st1/a') | Module .../inner/a.js imports module /test1/a.js, which in turn $@ it. | test1/a.js:1:1:1:27 | require ... ner/a') | imports | diff --git a/javascript/ql/test/query-tests/Security/CWE-200/PrivateFileExposure.expected b/javascript/ql/test/query-tests/Security/CWE-200/PrivateFileExposure.expected index 3cf199ce3714..39a5a884af13 100644 --- a/javascript/ql/test/query-tests/Security/CWE-200/PrivateFileExposure.expected +++ b/javascript/ql/test/query-tests/Security/CWE-200/PrivateFileExposure.expected @@ -1,6 +1,6 @@ -| lib/tst.js:7:1:7:45 | app.use ... rname)) | Serves the folder query-tests/Security/CWE-200/lib, which can contain private information. | -| lib/tst.js:9:1:9:43 | app.use ... otDir)) | Serves the folder query-tests/Security/CWE-200/lib, which can contain private information. | -| lib/tst.js:11:1:11:52 | app.use ... + '/')) | Serves the folder query-tests/Security/CWE-200/lib, which can contain private information. | +| lib/tst.js:7:1:7:45 | app.use ... rname)) | Serves the folder lib, which can contain private information. | +| lib/tst.js:9:1:9:43 | app.use ... otDir)) | Serves the folder lib, which can contain private information. | +| lib/tst.js:11:1:11:52 | app.use ... + '/')) | Serves the folder lib, which can contain private information. | | private-file-exposure.js:8:1:8:49 | app.use ... ular')) | Serves the folder "./node_modules/angular", which can contain private information. | | private-file-exposure.js:9:1:9:59 | app.use ... ular')) | Serves the folder "node_modules/angular", which can contain private information. | | private-file-exposure.js:10:1:10:67 | app.use ... mate')) | Serves the folder "node_modules/angular-animate", which can contain private information. | @@ -20,4 +20,4 @@ | private-file-exposure.js:43:1:43:46 | app.use ... )("/")) | Serves the root folder, which can contain private information. | | private-file-exposure.js:51:5:51:88 | app.use ... les'))) | Serves the folder "../node_modules", which can contain private information. | | private-file-exposure.js:70:5:70:71 | serveHa ... ular"}) | Serves the folder "./node_modules/angular", which can contain private information. | -| subfolder/private-file-exposure-2.js:6:1:6:34 | app.use ... rname)) | Serves the folder query-tests/Security/CWE-200/subfolder, which can contain private information. | +| subfolder/private-file-exposure-2.js:6:1:6:34 | app.use ... rname)) | Serves the folder subfolder, which can contain private information. | diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/tests.expected b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/tests.expected index d9f7f8005021..bd22abd7c823 100644 --- a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/tests.expected +++ b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/tests.expected @@ -1,7 +1,5 @@ test_query1 -| | 0 | -| tutorials | 0 | -| tutorials/Introducing the JavaScript libraries | 2 | +| | 2 | test_query3 | tst.js:27:1:27:4 |