From b4af5a61d12c8b4e9c45bfbcc4a0ae33716fcf31 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Wed, 20 Nov 2024 16:21:23 +0100 Subject: [PATCH] Rust: more advanced `toString` --- rust/extractor/src/generated/.generated.list | 2 +- rust/extractor/src/generated/top.rs | 826 +++++++++++------- rust/ql/.generated.list | 38 +- rust/ql/.gitattributes | 6 + rust/ql/lib/codeql/rust/elements.qll | 2 + .../ql/lib/codeql/rust/elements/BlockExpr.qll | 3 +- rust/ql/lib/codeql/rust/elements/ForExpr.qll | 3 +- .../codeql/rust/elements/LabelableExpr.qll | 13 + rust/ql/lib/codeql/rust/elements/LoopExpr.qll | 4 +- .../lib/codeql/rust/elements/LoopingExpr.qll | 13 + .../ql/lib/codeql/rust/elements/WhileExpr.qll | 3 +- .../rust/elements/internal/AwaitExprImpl.qll | 2 +- .../rust/elements/internal/BecomeExprImpl.qll | 2 +- .../rust/elements/internal/BlockExprImpl.qll | 6 +- .../rust/elements/internal/BoxPatImpl.qll | 2 +- .../rust/elements/internal/BreakExprImpl.qll | 19 +- .../rust/elements/internal/CallExprImpl.qll | 11 +- .../rust/elements/internal/CastExprImpl.qll | 4 +- .../elements/internal/ClosureExprImpl.qll | 2 +- .../elements/internal/ContinueExprImpl.qll | 17 +- .../rust/elements/internal/ElementImpl.qll | 8 + .../rust/elements/internal/FieldExprImpl.qll | 8 +- .../rust/elements/internal/ForExprImpl.qll | 4 +- .../rust/elements/internal/IfExprImpl.qll | 15 +- .../rust/elements/internal/IndexExprImpl.qll | 5 +- .../elements/internal/LabelableExprImpl.qll | 30 + .../rust/elements/internal/LetExprImpl.qll | 13 +- .../rust/elements/internal/LetStmtImpl.qll | 16 +- .../elements/internal/LiteralExprImpl.qll | 2 + .../rust/elements/internal/LiteralPatImpl.qll | 4 +- .../rust/elements/internal/LoopExprImpl.qll | 2 +- .../elements/internal/LoopingExprImpl.qll | 19 + .../rust/elements/internal/MatchArmImpl.qll | 15 +- .../rust/elements/internal/MatchExprImpl.qll | 4 +- .../rust/elements/internal/NeverTypeImpl.qll | 4 +- .../rust/elements/internal/OrPatImpl.qll | 4 +- .../rust/elements/internal/ParamImpl.qll | 15 +- .../rust/elements/internal/ParenExprImpl.qll | 2 +- .../rust/elements/internal/ParenPatImpl.qll | 2 +- .../rust/elements/internal/ParenTypeImpl.qll | 2 +- .../rust/elements/internal/PathExprImpl.qll | 4 +- .../rust/elements/internal/PathImpl.qll | 10 +- .../rust/elements/internal/PathPatImpl.qll | 4 +- .../elements/internal/PathSegmentImpl.qll | 4 +- .../rust/elements/internal/PathTypeImpl.qll | 4 +- .../rust/elements/internal/RangeExprImpl.qll | 24 +- .../elements/internal/RecordExprFieldImpl.qll | 11 +- .../rust/elements/internal/RefExprImpl.qll | 17 +- .../rust/elements/internal/RefPatImpl.qll | 11 +- .../rust/elements/internal/RestPatImpl.qll | 4 +- .../rust/elements/internal/ReturnExprImpl.qll | 8 +- .../elements/internal/UnderscoreExprImpl.qll | 4 +- .../rust/elements/internal/WhileExprImpl.qll | 4 +- .../elements/internal/WildcardPatImpl.qll | 4 +- .../elements/internal/generated/BlockExpr.qll | 18 +- .../elements/internal/generated/ForExpr.qll | 32 +- .../internal/generated/LabelableExpr.qll | 38 + .../elements/internal/generated/LoopExpr.qll | 34 +- .../internal/generated/LoopingExpr.qll | 38 + .../internal/generated/ParentChild.qll | 238 ++--- .../rust/elements/internal/generated/Raw.qll | 337 ++++--- .../elements/internal/generated/Synth.qll | 86 +- .../elements/internal/generated/WhileExpr.qll | 34 +- rust/ql/lib/rust.dbscheme | 266 +++--- .../generated/BlockExpr/BlockExpr.ql | 10 +- .../generated/ForExpr/ForExpr.ql | 10 +- .../generated/LoopExpr/LoopExpr.ql | 8 +- .../generated/WhileExpr/WhileExpr.ql | 12 +- .../library-tests/controlflow/Cfg.expected | 680 +++++++------- .../dataflow/barrier/inline-flow.expected | 16 +- .../dataflow/global/viableCallable.expected | 42 +- .../dataflow/local/DataFlowStep.expected | 38 +- .../dataflow/local/inline-flow.expected | 28 +- rust/schema/annotations.py | 28 +- 74 files changed, 1805 insertions(+), 1453 deletions(-) create mode 100644 rust/ql/lib/codeql/rust/elements/LabelableExpr.qll create mode 100644 rust/ql/lib/codeql/rust/elements/LoopingExpr.qll create mode 100644 rust/ql/lib/codeql/rust/elements/internal/LabelableExprImpl.qll create mode 100644 rust/ql/lib/codeql/rust/elements/internal/LoopingExprImpl.qll create mode 100644 rust/ql/lib/codeql/rust/elements/internal/generated/LabelableExpr.qll create mode 100644 rust/ql/lib/codeql/rust/elements/internal/generated/LoopingExpr.qll diff --git a/rust/extractor/src/generated/.generated.list b/rust/extractor/src/generated/.generated.list index 7335c95f7b8c..0f781aae8dab 100644 --- a/rust/extractor/src/generated/.generated.list +++ b/rust/extractor/src/generated/.generated.list @@ -1,2 +1,2 @@ mod.rs 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7 -top.rs cdfb9890318d847e6db320abd8b9e9939524ecc47bcdc8491b9c8253bd3178c2 cdfb9890318d847e6db320abd8b9e9939524ecc47bcdc8491b9c8253bd3178c2 +top.rs 7a5bbe75eae6069f4f255db13787a3575e706742af1f57122c02d46895de9a1b 7a5bbe75eae6069f4f255db13787a3575e706742af1f57122c02d46895de9a1b diff --git a/rust/extractor/src/generated/top.rs b/rust/extractor/src/generated/top.rs index 13a0adecbca4..eb1f16f8cc66 100644 --- a/rust/extractor/src/generated/top.rs +++ b/rust/extractor/src/generated/top.rs @@ -3568,97 +3568,6 @@ impl From> for trap::Label { } } -#[derive(Debug)] -pub struct BlockExpr { - pub id: trap::TrapId, - pub attrs: Vec>, - pub is_async: bool, - pub is_const: bool, - pub is_gen: bool, - pub is_move: bool, - pub is_try: bool, - pub is_unsafe: bool, - pub label: Option>, - pub stmt_list: Option>, -} - -impl trap::TrapEntry for BlockExpr { - fn extract_id(&mut self) -> trap::TrapId { - std::mem::replace(&mut self.id, trap::TrapId::Star) - } - - fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("block_exprs", vec![id.into()]); - for (i, v) in self.attrs.into_iter().enumerate() { - out.add_tuple("block_expr_attrs", vec![id.into(), i.into(), v.into()]); - } - if self.is_async { - out.add_tuple("block_expr_is_async", vec![id.into()]); - } - if self.is_const { - out.add_tuple("block_expr_is_const", vec![id.into()]); - } - if self.is_gen { - out.add_tuple("block_expr_is_gen", vec![id.into()]); - } - if self.is_move { - out.add_tuple("block_expr_is_move", vec![id.into()]); - } - if self.is_try { - out.add_tuple("block_expr_is_try", vec![id.into()]); - } - if self.is_unsafe { - out.add_tuple("block_expr_is_unsafe", vec![id.into()]); - } - if let Some(v) = self.label { - out.add_tuple("block_expr_labels", vec![id.into(), v.into()]); - } - if let Some(v) = self.stmt_list { - out.add_tuple("block_expr_stmt_lists", vec![id.into(), v.into()]); - } - } -} - -impl trap::TrapClass for BlockExpr { - fn class_name() -> &'static str { "BlockExpr" } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme BlockExpr is a subclass of AstNode - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme BlockExpr is a subclass of Element - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme BlockExpr is a subclass of Expr - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme BlockExpr is a subclass of Locatable - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - #[derive(Debug)] pub struct BoxPat { pub id: trap::TrapId, @@ -4582,81 +4491,6 @@ impl From> for trap::Label { } } -#[derive(Debug)] -pub struct ForExpr { - pub id: trap::TrapId, - pub attrs: Vec>, - pub iterable: Option>, - pub label: Option>, - pub loop_body: Option>, - pub pat: Option>, -} - -impl trap::TrapEntry for ForExpr { - fn extract_id(&mut self) -> trap::TrapId { - std::mem::replace(&mut self.id, trap::TrapId::Star) - } - - fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("for_exprs", vec![id.into()]); - for (i, v) in self.attrs.into_iter().enumerate() { - out.add_tuple("for_expr_attrs", vec![id.into(), i.into(), v.into()]); - } - if let Some(v) = self.iterable { - out.add_tuple("for_expr_iterables", vec![id.into(), v.into()]); - } - if let Some(v) = self.label { - out.add_tuple("for_expr_labels", vec![id.into(), v.into()]); - } - if let Some(v) = self.loop_body { - out.add_tuple("for_expr_loop_bodies", vec![id.into(), v.into()]); - } - if let Some(v) = self.pat { - out.add_tuple("for_expr_pats", vec![id.into(), v.into()]); - } - } -} - -impl trap::TrapClass for ForExpr { - fn class_name() -> &'static str { "ForExpr" } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme ForExpr is a subclass of AstNode - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme ForExpr is a subclass of Element - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme ForExpr is a subclass of Expr - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme ForExpr is a subclass of Locatable - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - #[derive(Debug)] pub struct ForType { pub id: trap::TrapId, @@ -5168,6 +5002,51 @@ impl From> for trap::Label { } } +#[derive(Debug)] +pub struct LabelableExpr { + _unused: () +} + +impl trap::TrapClass for LabelableExpr { + fn class_name() -> &'static str { "LabelableExpr" } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme LabelableExpr is a subclass of AstNode + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme LabelableExpr is a subclass of Element + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme LabelableExpr is a subclass of Expr + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme LabelableExpr is a subclass of Locatable + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + #[derive(Debug)] pub struct LetExpr { pub id: trap::TrapId, @@ -5559,66 +5438,58 @@ impl From> for trap::Label { } #[derive(Debug)] -pub struct LoopExpr { - pub id: trap::TrapId, - pub attrs: Vec>, - pub label: Option>, - pub loop_body: Option>, +pub struct MacroExpr { + pub id: trap::TrapId, + pub macro_call: Option>, } -impl trap::TrapEntry for LoopExpr { +impl trap::TrapEntry for MacroExpr { fn extract_id(&mut self) -> trap::TrapId { std::mem::replace(&mut self.id, trap::TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("loop_exprs", vec![id.into()]); - for (i, v) in self.attrs.into_iter().enumerate() { - out.add_tuple("loop_expr_attrs", vec![id.into(), i.into(), v.into()]); - } - if let Some(v) = self.label { - out.add_tuple("loop_expr_labels", vec![id.into(), v.into()]); - } - if let Some(v) = self.loop_body { - out.add_tuple("loop_expr_loop_bodies", vec![id.into(), v.into()]); + out.add_tuple("macro_exprs", vec![id.into()]); + if let Some(v) = self.macro_call { + out.add_tuple("macro_expr_macro_calls", vec![id.into(), v.into()]); } } } -impl trap::TrapClass for LoopExpr { - fn class_name() -> &'static str { "LoopExpr" } +impl trap::TrapClass for MacroExpr { + fn class_name() -> &'static str { "MacroExpr" } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme LoopExpr is a subclass of AstNode +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme MacroExpr is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme LoopExpr is a subclass of Element +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme MacroExpr is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme LoopExpr is a subclass of Expr +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme MacroExpr is a subclass of Expr unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme LoopExpr is a subclass of Locatable +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme MacroExpr is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } @@ -5626,85 +5497,26 @@ impl From> for trap::Label { } #[derive(Debug)] -pub struct MacroExpr { - pub id: trap::TrapId, +pub struct MacroPat { + pub id: trap::TrapId, pub macro_call: Option>, } -impl trap::TrapEntry for MacroExpr { +impl trap::TrapEntry for MacroPat { fn extract_id(&mut self) -> trap::TrapId { std::mem::replace(&mut self.id, trap::TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("macro_exprs", vec![id.into()]); + out.add_tuple("macro_pats", vec![id.into()]); if let Some(v) = self.macro_call { - out.add_tuple("macro_expr_macro_calls", vec![id.into(), v.into()]); + out.add_tuple("macro_pat_macro_calls", vec![id.into(), v.into()]); } } } -impl trap::TrapClass for MacroExpr { - fn class_name() -> &'static str { "MacroExpr" } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme MacroExpr is a subclass of AstNode - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme MacroExpr is a subclass of Element - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme MacroExpr is a subclass of Expr - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme MacroExpr is a subclass of Locatable - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -#[derive(Debug)] -pub struct MacroPat { - pub id: trap::TrapId, - pub macro_call: Option>, -} - -impl trap::TrapEntry for MacroPat { - fn extract_id(&mut self) -> trap::TrapId { - std::mem::replace(&mut self.id, trap::TrapId::Star) - } - - fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("macro_pats", vec![id.into()]); - if let Some(v) = self.macro_call { - out.add_tuple("macro_pat_macro_calls", vec![id.into(), v.into()]); - } - } -} - -impl trap::TrapClass for MacroPat { - fn class_name() -> &'static str { "MacroPat" } +impl trap::TrapClass for MacroPat { + fn class_name() -> &'static str { "MacroPat" } } impl From> for trap::Label { @@ -7914,77 +7726,6 @@ impl From> for trap::Label { } } -#[derive(Debug)] -pub struct WhileExpr { - pub id: trap::TrapId, - pub attrs: Vec>, - pub condition: Option>, - pub label: Option>, - pub loop_body: Option>, -} - -impl trap::TrapEntry for WhileExpr { - fn extract_id(&mut self) -> trap::TrapId { - std::mem::replace(&mut self.id, trap::TrapId::Star) - } - - fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("while_exprs", vec![id.into()]); - for (i, v) in self.attrs.into_iter().enumerate() { - out.add_tuple("while_expr_attrs", vec![id.into(), i.into(), v.into()]); - } - if let Some(v) = self.condition { - out.add_tuple("while_expr_conditions", vec![id.into(), v.into()]); - } - if let Some(v) = self.label { - out.add_tuple("while_expr_labels", vec![id.into(), v.into()]); - } - if let Some(v) = self.loop_body { - out.add_tuple("while_expr_loop_bodies", vec![id.into(), v.into()]); - } - } -} - -impl trap::TrapClass for WhileExpr { - fn class_name() -> &'static str { "WhileExpr" } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme WhileExpr is a subclass of AstNode - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme WhileExpr is a subclass of Element - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme WhileExpr is a subclass of Expr - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme WhileExpr is a subclass of Locatable - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - #[derive(Debug)] pub struct WildcardPat { pub id: trap::TrapId, @@ -8166,6 +7907,106 @@ impl From> for trap::Label { } } +#[derive(Debug)] +pub struct BlockExpr { + pub id: trap::TrapId, + pub label: Option>, + pub attrs: Vec>, + pub is_async: bool, + pub is_const: bool, + pub is_gen: bool, + pub is_move: bool, + pub is_try: bool, + pub is_unsafe: bool, + pub stmt_list: Option>, +} + +impl trap::TrapEntry for BlockExpr { + fn extract_id(&mut self) -> trap::TrapId { + std::mem::replace(&mut self.id, trap::TrapId::Star) + } + + fn emit(self, id: trap::Label, out: &mut trap::Writer) { + out.add_tuple("block_exprs", vec![id.into()]); + if let Some(v) = self.label { + out.add_tuple("labelable_expr_labels", vec![id.into(), v.into()]); + } + for (i, v) in self.attrs.into_iter().enumerate() { + out.add_tuple("block_expr_attrs", vec![id.into(), i.into(), v.into()]); + } + if self.is_async { + out.add_tuple("block_expr_is_async", vec![id.into()]); + } + if self.is_const { + out.add_tuple("block_expr_is_const", vec![id.into()]); + } + if self.is_gen { + out.add_tuple("block_expr_is_gen", vec![id.into()]); + } + if self.is_move { + out.add_tuple("block_expr_is_move", vec![id.into()]); + } + if self.is_try { + out.add_tuple("block_expr_is_try", vec![id.into()]); + } + if self.is_unsafe { + out.add_tuple("block_expr_is_unsafe", vec![id.into()]); + } + if let Some(v) = self.stmt_list { + out.add_tuple("block_expr_stmt_lists", vec![id.into(), v.into()]); + } + } +} + +impl trap::TrapClass for BlockExpr { + fn class_name() -> &'static str { "BlockExpr" } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme BlockExpr is a subclass of AstNode + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme BlockExpr is a subclass of Element + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme BlockExpr is a subclass of Expr + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme BlockExpr is a subclass of LabelableExpr + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme BlockExpr is a subclass of Locatable + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + #[derive(Debug)] pub struct CallExpr { pub id: trap::TrapId, @@ -8842,6 +8683,60 @@ impl From> for trap::Label { } } +#[derive(Debug)] +pub struct LoopingExpr { + _unused: () +} + +impl trap::TrapClass for LoopingExpr { + fn class_name() -> &'static str { "LoopingExpr" } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme LoopingExpr is a subclass of AstNode + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme LoopingExpr is a subclass of Element + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme LoopingExpr is a subclass of Expr + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme LoopingExpr is a subclass of LabelableExpr + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme LoopingExpr is a subclass of Locatable + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + #[derive(Debug)] pub struct MacroCall { pub id: trap::TrapId, @@ -10005,3 +9900,270 @@ impl From> for trap::Label { } } } + +#[derive(Debug)] +pub struct ForExpr { + pub id: trap::TrapId, + pub label: Option>, + pub loop_body: Option>, + pub attrs: Vec>, + pub iterable: Option>, + pub pat: Option>, +} + +impl trap::TrapEntry for ForExpr { + fn extract_id(&mut self) -> trap::TrapId { + std::mem::replace(&mut self.id, trap::TrapId::Star) + } + + fn emit(self, id: trap::Label, out: &mut trap::Writer) { + out.add_tuple("for_exprs", vec![id.into()]); + if let Some(v) = self.label { + out.add_tuple("labelable_expr_labels", vec![id.into(), v.into()]); + } + if let Some(v) = self.loop_body { + out.add_tuple("looping_expr_loop_bodies", vec![id.into(), v.into()]); + } + for (i, v) in self.attrs.into_iter().enumerate() { + out.add_tuple("for_expr_attrs", vec![id.into(), i.into(), v.into()]); + } + if let Some(v) = self.iterable { + out.add_tuple("for_expr_iterables", vec![id.into(), v.into()]); + } + if let Some(v) = self.pat { + out.add_tuple("for_expr_pats", vec![id.into(), v.into()]); + } + } +} + +impl trap::TrapClass for ForExpr { + fn class_name() -> &'static str { "ForExpr" } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme ForExpr is a subclass of AstNode + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme ForExpr is a subclass of Element + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme ForExpr is a subclass of Expr + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme ForExpr is a subclass of LabelableExpr + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme ForExpr is a subclass of Locatable + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme ForExpr is a subclass of LoopingExpr + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +#[derive(Debug)] +pub struct LoopExpr { + pub id: trap::TrapId, + pub label: Option>, + pub loop_body: Option>, + pub attrs: Vec>, +} + +impl trap::TrapEntry for LoopExpr { + fn extract_id(&mut self) -> trap::TrapId { + std::mem::replace(&mut self.id, trap::TrapId::Star) + } + + fn emit(self, id: trap::Label, out: &mut trap::Writer) { + out.add_tuple("loop_exprs", vec![id.into()]); + if let Some(v) = self.label { + out.add_tuple("labelable_expr_labels", vec![id.into(), v.into()]); + } + if let Some(v) = self.loop_body { + out.add_tuple("looping_expr_loop_bodies", vec![id.into(), v.into()]); + } + for (i, v) in self.attrs.into_iter().enumerate() { + out.add_tuple("loop_expr_attrs", vec![id.into(), i.into(), v.into()]); + } + } +} + +impl trap::TrapClass for LoopExpr { + fn class_name() -> &'static str { "LoopExpr" } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme LoopExpr is a subclass of AstNode + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme LoopExpr is a subclass of Element + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme LoopExpr is a subclass of Expr + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme LoopExpr is a subclass of LabelableExpr + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme LoopExpr is a subclass of Locatable + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme LoopExpr is a subclass of LoopingExpr + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +#[derive(Debug)] +pub struct WhileExpr { + pub id: trap::TrapId, + pub label: Option>, + pub loop_body: Option>, + pub attrs: Vec>, + pub condition: Option>, +} + +impl trap::TrapEntry for WhileExpr { + fn extract_id(&mut self) -> trap::TrapId { + std::mem::replace(&mut self.id, trap::TrapId::Star) + } + + fn emit(self, id: trap::Label, out: &mut trap::Writer) { + out.add_tuple("while_exprs", vec![id.into()]); + if let Some(v) = self.label { + out.add_tuple("labelable_expr_labels", vec![id.into(), v.into()]); + } + if let Some(v) = self.loop_body { + out.add_tuple("looping_expr_loop_bodies", vec![id.into(), v.into()]); + } + for (i, v) in self.attrs.into_iter().enumerate() { + out.add_tuple("while_expr_attrs", vec![id.into(), i.into(), v.into()]); + } + if let Some(v) = self.condition { + out.add_tuple("while_expr_conditions", vec![id.into(), v.into()]); + } + } +} + +impl trap::TrapClass for WhileExpr { + fn class_name() -> &'static str { "WhileExpr" } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme WhileExpr is a subclass of AstNode + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme WhileExpr is a subclass of Element + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme WhileExpr is a subclass of Expr + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme WhileExpr is a subclass of LabelableExpr + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme WhileExpr is a subclass of Locatable + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme WhileExpr is a subclass of LoopingExpr + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} diff --git a/rust/ql/.generated.list b/rust/ql/.generated.list index 1c56649d4761..3e240b0b61d7 100644 --- a/rust/ql/.generated.list +++ b/rust/ql/.generated.list @@ -11,7 +11,7 @@ lib/codeql/rust/elements/Attr.qll 53887a49513b95e38344b57d824a7474331467561f1edf lib/codeql/rust/elements/AwaitExpr.qll d8b37c01f7d27f0ec40d92a533a8f09a06af7ece1ae832b4ea8f2450c1762511 92cdb7ff0efddf26bed2b7b2729fddd197e26c1a11c8fec0c747aab642710c21 lib/codeql/rust/elements/BecomeExpr.qll 7a3cfc4894feb6be1cde664f675b18936434e68ccea52e55314c33d01491e34f 49666eca509b30d44bb02702bda67239c76bf8d9f231022c9cf6ecca123f8616 lib/codeql/rust/elements/BinaryExpr.qll 394522da3bc3a716fc7bc40c3560143ca840f5d210cfcba2a752c3026dd0f725 fbbd6fb79bf16a7d9820613654c584cd7ff3e7a29988f3920b6cfbe746acfd8d -lib/codeql/rust/elements/BlockExpr.qll b952fd44b89de248931d4089834d2c9406f6f2fc1a3f5c2365156be4e55157cf daccc07ab11ac696679b9fadc99f40b1bf579c90bf6c7cca6e82eaa313932ede +lib/codeql/rust/elements/BlockExpr.qll b5cf57119b15f27d0bc258dfa375b0ef2730c157870ff543f0dc7a8cfe514182 f6a01999606b010c81ef9c6ff1385e6640632b6f5ce067ffeb0ef0af0a0aeb92 lib/codeql/rust/elements/BoxPat.qll 1b2c3fff171aa6aa238c9460b122f26c79e04577cea67fa856de99842ba873d4 0caf8d23ed6e0997a6b8751def27641582151fba6e24fccf798712a4690b42f1 lib/codeql/rust/elements/BreakExpr.qll 7ca3807a20e9a9a988d1fd7abebf240325ed422fcb45c719ba46272f031f94db dffb7379d3f3ba220acfbd05eb7bb6cfd9cfda211e9c8b1f5240ca5fa61be3fc lib/codeql/rust/elements/CallExpr.qll f336500ca7a611b164d48b90e80edb0c0d3816792b0ececce659ac1ff1ffeb3e f99a9c55466418ef53860c44d9f2d6161af4b492178ddd9e5870dff742b70ae5 @@ -38,7 +38,7 @@ lib/codeql/rust/elements/ExternItemList.qll bc96f188970e8dc0cd1e77dea3e49b715edf lib/codeql/rust/elements/FieldExpr.qll 8102cd659f9059cf6af2a22033cfcd2aae9c35204b86f7d219a05f1f8de54b3b f818169dddf5102095ae1410583615f80031376a08b5307d0c464e79953c3975 lib/codeql/rust/elements/FieldList.qll bd243adc4696c60f636055a1c2da28039fe2028476c9247eb6a68003b849b757 ab63cdf410afd1e515f873b49f46bb5c2bf27e6c78fd206ccbdba064c4c0a4b2 lib/codeql/rust/elements/FnPtrType.qll c4a90dc660cf620972dc23b95494f5caf9f050eabd4bdb52fdc061f8797ba9a1 f8defc91582fa503607664668f9e2e6c2cd8b320c7c449610f21e52e332a129f -lib/codeql/rust/elements/ForExpr.qll 312804d53dd9236a2f2a15c9d6ec348b46e139a54eb5893e7e12487725df7444 fa5e20099b1179033bc209bad3548e3d1d4019c7fe0e455cec8ca1a9d48692ab +lib/codeql/rust/elements/ForExpr.qll 0cc8bfe10b8baf62a1ff65c8463cfb17ab64b41c30c9e1edb962a227df2036d9 b1be73294e6da0f49fd32177ad0b05fecf26081d5ce424f288be99a4bd59cc84 lib/codeql/rust/elements/ForType.qll 0036bed8749358c356d78c4a0eef40d73e2796284293cde5604ae70ddd6d0470 4edcaf8f7c67d42ebe3ebb1be6a7643758717d4fe88f5f648b6a1c5ff4ee4de7 lib/codeql/rust/elements/Format.qll 506172d176f4b965f428585c032464f4abe07a0e47c574f8e011d8641ec45370 653e81bf233b8729649064de64f4a7a8533f8864ac6d2ea913f347088c924c60 lib/codeql/rust/elements/FormatArgsArg.qll 5bc9b4cd1bac7131165836e93838c45452a08ea6011741cbddace3cbf9c69440 f825140e98dc9800d5c045402186793c7b21511448e2f6bf6402d1e06305219c @@ -59,6 +59,7 @@ lib/codeql/rust/elements/InferType.qll c71184ae6aa181be94e299882503350e057493e17 lib/codeql/rust/elements/Item.qll 5c9148ff0eaeb4404c2d8156e7df0ef5753fd44ead972da05a49659ddaa25480 78446f788617e40525d4d4b489848e75f2143a90e18d40974c3bff7b1e7c825c lib/codeql/rust/elements/ItemList.qll c33e46a9ee45ccb194a0fe5b30a6ad3bcecb0f51486c94e0191a943710a17a7d 5a69c4e7712b4529681c4406d23dc1b6b9e5b3c03552688c55addab271912ed5 lib/codeql/rust/elements/Label.qll a31d41db351af7f99a55b26cdbbc7f13b4e96b660a74e2f1cc90c17ee8df8d73 689f87cb056c8a2aefe1a0bfc2486a32feb44eb3175803c61961a6aeee53d66e +lib/codeql/rust/elements/LabelableExpr.qll 598be487cd051b004ab95cbbc3029100069dc9955851c492029d80f230e56f0d 92c49b3cfdaba07982f950e18a8d62dae4e96f5d9ae0d7d2f4292628361f0ddc lib/codeql/rust/elements/LetElse.qll 85d16cb9cb2162493a9bacfe4b9e6a3b325d9466175b6d1a8e649bdf2191b864 c268d0878e9f82e8ede930b3825745c39ab8cd4db818eb9be6dc5ca49bee7579 lib/codeql/rust/elements/LetExpr.qll 435f233890799a9f52972a023e381bc6fe2e0b3df1e696dc98b21682a3c1d88e b34da72dd222a381e098f160551ec614ebb98eb46af35c6e1d337e173d8ec4b9 lib/codeql/rust/elements/LetStmt.qll e589d750ff87c25e28e15dab61e1a3555a45ced42158b05c991c6f5873abd86a 383484181b825cd7bc20e014fc4d5888f66e1f257502e1893f3d55aed2cdef3d @@ -68,7 +69,8 @@ lib/codeql/rust/elements/LifetimeParam.qll db9f2c7bb32d49808993b400875e79560ac54 lib/codeql/rust/elements/LiteralExpr.qll 40b67404b7c2b81e5afabc53a2a93e0a503f687bb31a2b4bfa4e07b2d764eb8d 67ab1be2286e769fba7a50ca16748e3c141760ccaefaebae99faa71f523a43d5 lib/codeql/rust/elements/LiteralPat.qll daffb5f380a47543669c8cc92628b0e0de478c3ac82685802c63e8d75a206bed adfe9796598cf6ca4a9170c89ffd871e117f1cea6dd7dd80ecbbb947327a1a5d lib/codeql/rust/elements/Locatable.qll 2855efa4a469b54e0ca85daa89309a8b991cded6f3f10db361010831ba1e11d3 00c3406d14603f90abea11bf074eaf2c0b623a30e29cf6afc3a247cb58b92f0f -lib/codeql/rust/elements/LoopExpr.qll 58ade0bc4a01a1cc361363682fde3ea56f4c5fbb4b28f5723ceff52ebaf897d7 fa299162c742bcf3b2211dc20821b312e3c133350c288a050eb26e6f8b5a5c78 +lib/codeql/rust/elements/LoopExpr.qll ee171177650fa23eef102a9580765f4b6073a1cc41bab1ec31ad4f84ffe6c2c9 bfcf0cca4dc944270d9748a202829a38c64dfae167c0d3a4202788ceb9daf5f6 +lib/codeql/rust/elements/LoopingExpr.qll 7ad7d4bbfd05adc0bb9b4ca90ff3377b8298121ca5360ffb45d5a7a1e20fe37a 964168b2045ee9bad827bba53f10a64d649b3513f2d1e3c17a1b1f11d0fc7f3a lib/codeql/rust/elements/MacroCall.qll a39a11d387355f59af3007dcbab3282e2b9e3289c1f8f4c6b96154ddb802f8c3 88d4575e462af2aa780219ba1338a790547fdfc1d267c4b84f1b929f4bc08d05 lib/codeql/rust/elements/MacroDef.qll acb39275a1a3257084314a46ad4d8477946130f57e401c70c5949ad6aafc5c5f 6a8a8db12a3ec345fede51ca36e8c6acbdce58c5144388bb94f0706416fa152a lib/codeql/rust/elements/MacroExpr.qll ea9fed13f610bab1a2c4541c994510e0cb806530b60beef0d0c36b23e3b620f0 ad11a6bbd3a229ad97a16049cc6b0f3c8740f9f75ea61bbf4eebb072db9b12d2 @@ -160,7 +162,7 @@ lib/codeql/rust/elements/VariantList.qll 07adfe5750b2d5b50c8629f36feba24edd84f75 lib/codeql/rust/elements/Visibility.qll d2cf0727efaf8df6b3808cb4a6b2e26d18e42db766d92e97ad3ef046d91cb9e5 8947a1e2d48b532c6455ddf143fa5b1dff28c40da1f1c6a72769fc9db7ecbaf6 lib/codeql/rust/elements/WhereClause.qll da51212766700e40713fff968078a0172a4f73eebc5425d8e0d60b03c2fe59fa 0ec036aea729b8f4af0eb8118911dce715e2eb4640ae7b5e40a007a48da03899 lib/codeql/rust/elements/WherePred.qll 4815cd8f2a536c895e1f6831bef2ee6b9ea42c4fea12df1f164de1c965795bc1 3b46806767d81218d2e21656afe39c957c364ff7067c9af3ae8bacbf7f93858b -lib/codeql/rust/elements/WhileExpr.qll 9c12c26f953163c70020669327bd8c931493ef7fb4b75e6711202c0bab1d2697 2e2c96425bcd4414c65d9069a71a5123a3a10dd1449cafc121ac08f91ea49728 +lib/codeql/rust/elements/WhileExpr.qll 9e0c23057bf3fa3e050d5f6de0650f554ce576861783ea7d1e4c7d35db129ad3 b294c4f6e4dea922a4274779287edcb484409b2654a553298626ded9d1e8c5a4 lib/codeql/rust/elements/WildcardPat.qll 4f941afc5f9f8d319719312399a8f787c75a0dbb709ec7cf488f019339635aab a9140a86da752f9126e586ddb9424b23b3fb4841a5420bac48108c38bb218930 lib/codeql/rust/elements/YeetExpr.qll 4172bf70de31cab17639da6eed4a12a7afcefd7aa9182216c3811c822d3d6b17 88223aab1bef696f508e0605615d6b83e1eaef755314e6a651ae977edd3757c3 lib/codeql/rust/elements/YieldExpr.qll de2dc096a077f6c57bba9d1c2b2dcdbecce501333753b866d77c3ffbe06aa516 1f3e8949689c09ed356ff4777394fe39f2ed2b1e6c381fd391790da4f5d5c76a @@ -184,6 +186,7 @@ lib/codeql/rust/elements/internal/AwaitExprConstructor.qll 44ff1653e73d5b9f6885c lib/codeql/rust/elements/internal/BecomeExprConstructor.qll ba073aaa256cb8827a0307c3128d50f62b11aac0b1f324e48c95f30351a9b942 3a787ded505c3158fa4f4923f66e8ecdcb7b5f86f27f64c5412dc32dca031f18 lib/codeql/rust/elements/internal/BinaryExprConstructor.qll 7f9b17757f78b9fb7c46e21d2040a77fa50083bef4911c8464991c3d1ad91d87 a59390cd8e896c0bfbdc9ba0674e06d980ffcefa710fbc9886be52ed427e9717 lib/codeql/rust/elements/internal/BlockExprConstructor.qll 438337c807645e98a01440f3f4610d68b0567ba15c8f51dc43bf5a30c9af3696 48ce7a546910c884619762349b8ada9836284f8008298fdb0070a38f7ddf25a0 +lib/codeql/rust/elements/internal/BlockExprImpl.qll 36ac09e4a6eeeec22919b62b1d004bdb5bb2527e67932c308aec383a770768d6 3b4b2a2014f6fe075c63a2d633b297566b548ef2e4343cadf067a9edbcadc876 lib/codeql/rust/elements/internal/BoxPatConstructor.qll 153f110ba25fd6c889092bfd16f73bb610fa60d6e0c8965d5f44d2446fcd48a2 9324cf0d8aa29945551bf8ab64801d598f57aab8cd4e19bcd4e9ef8a4a4e06eb lib/codeql/rust/elements/internal/BreakExprConstructor.qll 356be043c28e0b34fdf925a119c945632ee883c6f5ebb9a27003c6a8d250afd9 bb77e66b04bb9489340e7506931559b94285c6904b6f9d2f83b214cba4f3cfd5 lib/codeql/rust/elements/internal/CallExprBaseImpl.qll d2749cc1a9d7ee8bf7f34b6c3e0238a576a68e439a8c10a503c164ff45ffcbeb ffc7b0a8841945fe6736b0e1aed7d9ed69185db03dee2b16da121325b39397c7 @@ -256,6 +259,7 @@ lib/codeql/rust/elements/internal/LifetimeParamImpl.qll 8909288801bff8d3e87096df lib/codeql/rust/elements/internal/LiteralExprConstructor.qll 8ea3569bd50704ce7d57be790d2dfd38f4c40cb0b12e0dd60d6830e8145a686f 88d07ad3298003f314f74bd8e3d64a3094de32080ad42a7e6741c416c3856095 lib/codeql/rust/elements/internal/LiteralPatConstructor.qll b660cb428a0cba0b713fc7b07d5d2921de4a2f65a805535fb6387684c40620de 2dbc9fbc56e9de53d24265d6b13738ef5b9ced33cc3c4c1c270e04dc2fc1330f lib/codeql/rust/elements/internal/LoopExprConstructor.qll 45f3f8f7441fcab6adc58831421679ee07bac68ac0417f3cbc90c97426cc805b f7ab3361b4a11e898126378ea277d76949466946762cd6cb5e9e9b4bb9860420 +lib/codeql/rust/elements/internal/LoopingExprImpl.qll 17885c1bcf7b5a3f9c7bbad3d4d55e24372af0dedd5e7fc0efcfc0a8b2cdad70 104dc45ca399b9f6e8227ad561679f728d60170398a52b31fc90cb2a2dd3c33c lib/codeql/rust/elements/internal/MacroCallConstructor.qll 707fee4fba1fd632cd00128f493e8919eaaea552ad653af4c1b7a138e362907d b49e7e36bf9306199f2326af042740ff858871b5c79f6aeddf3d5037044dbf1f lib/codeql/rust/elements/internal/MacroDefConstructor.qll 382a3bdf46905d112ee491620cc94f87d584d72f49e01eb1483f749e4709c055 eb61b90d8d8d655c2b00ff576ae20c8da9709eeef754212bc64d8e1558ad05ce lib/codeql/rust/elements/internal/MacroDefImpl.qll f26e787ffd43e8cb079db01eba04412dbf32c338938acf1bc09a2f094bbdfdfe 044f43bc94fe4b6df22afae32e9f039d1d0d9e85ad9f24b6388be71211c37ce5 @@ -420,7 +424,7 @@ lib/codeql/rust/elements/internal/generated/Attr.qll 2e7983b2c462750065ed58cc10c lib/codeql/rust/elements/internal/generated/AwaitExpr.qll 1d71af702a1f397fb231fae3e0642b3deeba0cd5a43c1d8fabdff29cac979340 e0bfa007bdecc5a09a266d449d723ae35f5a24fbdfc11e4e48aeea3ec0c5147c lib/codeql/rust/elements/internal/generated/BecomeExpr.qll 7a211b785a4a2f961242d1d73fd031d381aad809f7b600ce7f7f864518bb7242 17a0388680007871748cfdc6621f700a7c2817b9601e1bd817fb48561e7c63ad lib/codeql/rust/elements/internal/generated/BinaryExpr.qll 64e9bd9c571edd6e5f3e7662b956b1d87fa0354ce6fe95da9caf25ac16b66c68 3fca09fdbe879db2ca3293618896a462e96376a2963d15cce3d5b1baac552fcb -lib/codeql/rust/elements/internal/generated/BlockExpr.qll ccfbdc7bd268735a0424ff08dcf37d0e1fed61d5fe0520593c23f2490d400438 0facad59f6aba13ee0c069b691c99f52c04b723a2bfad4da226190c3c42dcabf +lib/codeql/rust/elements/internal/generated/BlockExpr.qll 5a5ddbe34bc478a7bd9b0d07d3b6f017c2d1f20581d859251a963314e6514d1f 9804c30b8b279038b864c52557535f854bd012bacdfe8e5840f1f777c74e52df lib/codeql/rust/elements/internal/generated/BoxPat.qll ec946a3e671ab7417e04b0207967adad004df512c570c4f0780ca5816d12d75f b0e64860855c4e85914042b1a51034899ff7cd1b2c6857188de89310a2726ea3 lib/codeql/rust/elements/internal/generated/BreakExpr.qll 0f428a8b2f4209b134c2ffc3e1c93c30bc6b0e9c9172f140cefa88c1f77d8690 957b39f38ff6befe9061f55bc0b403c2f1c366dd0cf63b874bae6f8216576d76 lib/codeql/rust/elements/internal/generated/CallExpr.qll 23ee64e3bf643cd5e6ff705181d2bb31e1aeaffecb5bdce73836172dbf15f12f 34b280139b1f8f70d78e1432392f03c971be392e8cb68d014eb325d0c101bddd @@ -447,7 +451,7 @@ lib/codeql/rust/elements/internal/generated/ExternItemList.qll 6bc97fdae6c411cab lib/codeql/rust/elements/internal/generated/FieldExpr.qll 3e506b5cb93793ec30f56bb637a600db869fcba6181b068516a671d55c362739 7bbf953696d763ad6b210f378f487ba85b875fa115b22c0c0508599a63633502 lib/codeql/rust/elements/internal/generated/FieldList.qll 43c13c6e3c9ba75a7a4cb870fc4f18752001584d48b9df0734055a6ebb789331 7c51b0b13eb02f1286d3365e53a976ba2655c4dbd8e735bc11c8b205c829e1ee lib/codeql/rust/elements/internal/generated/FnPtrType.qll 748d766dbefd19a7d644734c57885eeede66897029bbfe1b87919517f43bfde2 5a7d80acc00e56594ed85026a8ea4923104d2e98c2e42db8c5bcd32ddd164e48 -lib/codeql/rust/elements/internal/generated/ForExpr.qll 541b62b48911d4999f9ed64ab6c8b9910073ac4add0225761f319677328cf120 976c3a91c9eedfb1e2d9ea76ac501348643b3d23c723d7a777042258d416d091 +lib/codeql/rust/elements/internal/generated/ForExpr.qll d81751e9599874a1292a0aace80b2de60ab36fc43f74ec08fbdfe044fc19e5c1 34a64586f8ffbadd44d0e747f69ab550a16149b658a9c92d9593689cb9a4f6fc lib/codeql/rust/elements/internal/generated/ForType.qll 3d43d044a1189281f09c55caafb6c8020a836f49e2866077086101925a573cf2 646b59bfd1b428aaf7211f574c49f79cb4c6a79ca151aa0663b2b31480298721 lib/codeql/rust/elements/internal/generated/Format.qll 37ad20cf2bf363b4027a8913d095292c8a4eb8ccdf2a9965f2fb7d41930f9bfe 329b89cdd75ce951269273dd18897e32ff5cfcc94f451001c64143386c1e48dd lib/codeql/rust/elements/internal/generated/FormatArgsArg.qll e07a1ae310f590003f1b88fada7dcf4847c99adb9d4c838d1c88e66e1da85c5f 0ef7342451fe2cb06e765fb4b33bb8c4a9b927f5edbc8feb5c6ba3655697f447 @@ -468,6 +472,7 @@ lib/codeql/rust/elements/internal/generated/InferType.qll 23ee25135c59ea5578cdf7 lib/codeql/rust/elements/internal/generated/Item.qll 25e645cb41222c21065798fb6cb0488bfef007aeb9b89717f58913f9b29d5559 3146941e55db2ff7c51ec030b4414e20d66d154cf6854b1a3fa42e74a09dfb77 lib/codeql/rust/elements/internal/generated/ItemList.qll 73c8398a96d4caa47a2dc114d76c657bd3fcc59e4c63cb397ffac4a85b8cf8ab 540a13ca68d414e3727c3d53c6b1cc97687994d572bc74b3df99ecc8b7d8e791 lib/codeql/rust/elements/internal/generated/Label.qll 6630fe16e9d2de6c759ff2684f5b9950bc8566a1525c835c131ebb26f3eea63e 671143775e811fd88ec90961837a6c0ee4db96e54f42efd80c5ae2571661f108 +lib/codeql/rust/elements/internal/generated/LabelableExpr.qll 896fd165b438b60d7169e8f30fa2a94946490c4d284e1bbadfec4253b909ee6c 5c6b029ea0b22cf096df2b15fe6f9384ad3e65b50b253cae7f19a2e5ffb04a58 lib/codeql/rust/elements/internal/generated/LetElse.qll 7ca556118b5446bfc85abba8f0edd4970e029b30d414ea824a1b5f568310a76c a403540881336f9d0269cbcdb4b87107a17ab234a985247dc52a380f150a1641 lib/codeql/rust/elements/internal/generated/LetExpr.qll 9af0f89b294c8a0a751317e7074fe370339563d36c1df4911d1ea082a4df77fd 68272593d1feb88990bfbd0b8c222776f085e49694894384fc6d96e9464ba734 lib/codeql/rust/elements/internal/generated/LetStmt.qll aa1852db86ec29f857a90677f0c6b4a07f0fd965fc193d4141be95ce15862fca 40f32a37c0cc161b099fe0b4c7d713da928781d3e2c3de90db991df1d9062647 @@ -477,7 +482,8 @@ lib/codeql/rust/elements/internal/generated/LifetimeParam.qll bcbde38bfb99034e47 lib/codeql/rust/elements/internal/generated/LiteralExpr.qll f3a564d0a3ed0d915f5ab48e12246777e4972ad987cd9deaafeb94cf407b2877 2337c3d5f60361bd10f6aeca301e88255f5dffb85301cf36cbbfa1a65bfad1cd lib/codeql/rust/elements/internal/generated/LiteralPat.qll ecc2bfe559abfce1be873fbf7b61b5728897c9afc3bb3f69551d8320d273da71 42196fb6a4a0ff9b570fd0bdbc920f24744b3f46772efbb46648af7fbfe1fbda lib/codeql/rust/elements/internal/generated/Locatable.qll c897dc1bdd4dfcb6ded83a4a93332ca3d8f421bae02493ea2a0555023071775e b32d242f8c9480dc9b53c1e13a5cb8dcfce575b0373991c082c1db460a3e37b8 -lib/codeql/rust/elements/internal/generated/LoopExpr.qll 22b755dfaf238ecea722c0c94c399992014e23481ec6fdd61f803bbec012b6f9 08731630c2dc05aa1e0ada222a6057752d9ce737329c62076708828247a358be +lib/codeql/rust/elements/internal/generated/LoopExpr.qll db6bc87e795c9852426ec661fa2c2c54106805897408b43a67f5b82fb4657afd 1492866ccf8213469be85bbdbcae0142f4e2a39df305d4c0d664229ecd1ebdb9 +lib/codeql/rust/elements/internal/generated/LoopingExpr.qll 0792c38d84b8c68114da2bbdfef32ef803b696cb0fd06e10e101756d5c46976c 111fe961fad512722006323c3f2a075fddf59bd3eb5c7afc349835fcec8eb102 lib/codeql/rust/elements/internal/generated/MacroCall.qll fc8988696493992cc4fdce8c0e5610c54ee92ea52ebb05262338f8b612353f50 188a2d7a484bd402a521787371e64f6e00e928306c8d437e6b19bf890a7aa14e lib/codeql/rust/elements/internal/generated/MacroDef.qll e9b3f07ba41aa12a8e0bd6ec1437b26a6c363065ce134b6d059478e96c2273a6 87470dea99da1a6afb3a19565291f9382e851ba864b50a995ac6f29589efbd70 lib/codeql/rust/elements/internal/generated/MacroExpr.qll 03a1daa41866f51e479ac20f51f8406d04e9946b24f3875e3cf75a6b172c3d35 1ae8ca0ee96bd2be32575d87c07cc999a6ff7770151b66c0e3406f9454153786 @@ -504,7 +510,7 @@ lib/codeql/rust/elements/internal/generated/ParamList.qll c808c9d84dd7800573832b lib/codeql/rust/elements/internal/generated/ParenExpr.qll bc0731505bfe88516205ec360582a4222d2681d11342c93e15258590ddee82f2 d4bd6e0c80cf1d63746c88d4bcb3a01d4c75732e5da09e3ebd9437ced227fb60 lib/codeql/rust/elements/internal/generated/ParenPat.qll ce24b8f8ecbf0f204af200317405724063887257460c80cf250c39b2fdf37185 e7c87d37e1a0ca7ea03840017e1aa9ddb7f927f1f3b6396c0305b46aeee33db6 lib/codeql/rust/elements/internal/generated/ParenType.qll 9cc954d73f8330dcac7b475f97748b63af5c8766dee9d2f2872c0a7e4c903537 c07534c8a9c683c4a9b11d490095647e420de0a0bfc23273eaf6f31b00244273 -lib/codeql/rust/elements/internal/generated/ParentChild.qll b4d25c43ed44715053255c3c2f8aeb8d21826adc365f24026b2123a4f25cba86 1bc4bb0380a1a8b69055ffeac203b11b2a1b94e5ad88d1b32ff659e8feb26016 +lib/codeql/rust/elements/internal/generated/ParentChild.qll 2237ba700c7d790cbbf7ad4d86889d22c6d210af62474ad8d363d79abb574722 36f9d47b002a241f0f793816ca9e6327fbbefb02268665553c56ded6012f82ec lib/codeql/rust/elements/internal/generated/Pat.qll 3605ac062be2f294ee73336e9669027b8b655f4ad55660e1eab35266275154ee 7f9400db2884d336dd1d21df2a8093759c2a110be9bf6482ce8e80ae0fd74ed4 lib/codeql/rust/elements/internal/generated/Path.qll f2b1be2f8f44001a6533533c978c4a9a8b7d64838d6f39eef5f0c0e7890611b8 d724a00a38f42429ffa8fb3bffbb5ec69e16a32ceeeb1d1f026fc7adf87424a8 lib/codeql/rust/elements/internal/generated/PathExpr.qll 2096e3c1db22ee488a761690adabfc9cfdea501c99f7c5d96c0019cb113fc506 54245ce0449c4e263173213df01e079d5168a758503a5dbd61b25ad35a311140 @@ -517,7 +523,7 @@ lib/codeql/rust/elements/internal/generated/PtrType.qll 40099c5a4041314b66932dfd lib/codeql/rust/elements/internal/generated/PureSynthConstructors.qll ea294a3ba33fd1bc632046c4fedbcb84dcb961a8e4599969d65893b19d90e590 ea294a3ba33fd1bc632046c4fedbcb84dcb961a8e4599969d65893b19d90e590 lib/codeql/rust/elements/internal/generated/RangeExpr.qll 23cca03bf43535f33b22a38894f70d669787be4e4f5b8fe5c8f7b964d30e9027 18624cef6c6b679eeace2a98737e472432e0ead354cca02192b4d45330f047c9 lib/codeql/rust/elements/internal/generated/RangePat.qll efd93730de217cf50dcba5875595263a5eadf9f7e4e1272401342a094d158614 229b251b3d118932e31e78ac4dfb75f48b766f240f20d436062785606d44467b -lib/codeql/rust/elements/internal/generated/Raw.qll 5f83209cda8319c5c6c932631b60c6f2163d2d9cf7be63f63523e2206c01d004 3581039746e86365f37644e86ac2c89d67e2123aa1b039d9e0afdffc7156c96d +lib/codeql/rust/elements/internal/generated/Raw.qll 462d87edee9e0fc463f789a765e19d94c4c027a73db876ad306f918dd87e9511 33a6782598a6ba0e02e6b772b5b74ebbe609b0bc3a92180f85db7472e00aa8d9 lib/codeql/rust/elements/internal/generated/RecordExpr.qll eb6cb662e463f9260efae1a6ce874fa781172063b916ef1963f861e9942d308d 1a21cbccc8f3799ff13281e822818ebfb21d81591720a427cac3625512cb9d40 lib/codeql/rust/elements/internal/generated/RecordExprField.qll 7e9f8663d3b74ebbc9603b10c9912f082febba6bd73d344b100bbd3edf837802 fbe6b578e7fd5d5a6f21bbb8c388957ab7210a6a249ec71510a50fb35b319ea1 lib/codeql/rust/elements/internal/generated/RecordExprFieldList.qll 179a97211fe7aa6265085d4d54115cdbc0e1cd7c9b2135591e8f36d6432f13d3 dd44bbbc1e83a1ed3a587afb729d7debf7aeb7b63245de181726af13090e50c0 @@ -543,7 +549,7 @@ lib/codeql/rust/elements/internal/generated/Static.qll 5fbd6879858cf356d4bdaa6da lib/codeql/rust/elements/internal/generated/Stmt.qll 8473ff532dd5cc9d7decaddcd174b94d610f6ca0aec8e473cc051dad9f3db917 6ef7d2b5237c2dbdcacbf7d8b39109d4dc100229f2b28b5c9e3e4fbf673ba72b lib/codeql/rust/elements/internal/generated/StmtList.qll a667193e32341e17400867c6e359878c4e645ef9f5f4d97676afc0283a33a026 a320ed678ee359302e2fc1b70a9476705cd616fcfa44a499d32f0c7715627f73 lib/codeql/rust/elements/internal/generated/Struct.qll 4d57f0db12dc7ad3e31e750a24172ef1505406b4dab16386af0674bd18bf8f4b 1a73c83df926b996f629316f74c61ea775be04532ab61b56af904223354f033e -lib/codeql/rust/elements/internal/generated/Synth.qll 1ba88215c3f0640558a644534b954e4b93acb15a0f51a1e4887230f451718aa9 747eb3bec1c7245e59ea2b500604f5b4e614e4f061473d1a22fa398ee48ba080 +lib/codeql/rust/elements/internal/generated/Synth.qll 0e5767568fd119df13928adf00950586f5f9f355dae520059b2d6daa7a2bda56 219b40f6458fec2cc436dc2cf80bb1dbfb34dfdbe8576606b5e25f78d36d6210 lib/codeql/rust/elements/internal/generated/SynthConstructors.qll e929c49ea60810a2bbc19ad38110b8bbaf21db54dae90393b21a3459a54abf6f e929c49ea60810a2bbc19ad38110b8bbaf21db54dae90393b21a3459a54abf6f lib/codeql/rust/elements/internal/generated/Token.qll 77a91a25ca5669703cf3a4353b591cef4d72caa6b0b9db07bb9e005d69c848d1 2fdffc4882ed3a6ca9ac6d1fb5f1ac5a471ca703e2ffdc642885fa558d6e373b lib/codeql/rust/elements/internal/generated/TokenTree.qll 8577c2b097c1be2f0f7daa5acfcf146f78674a424d99563e08a84dd3e6d91b46 d2f30764e84dbfc0a6a5d3d8a5f935cd432413688cb32da9c94e420fbc10665c @@ -574,11 +580,11 @@ lib/codeql/rust/elements/internal/generated/VariantList.qll 4eb923ca341033c256ca lib/codeql/rust/elements/internal/generated/Visibility.qll aba81820f30bed0fd2cd06831f7256af15ae32525b2a437896420b4cc067ea38 d6aed90b27124b812daf2ddd14b4e181277cbe638b4ccaab74e27681ac30e4ab lib/codeql/rust/elements/internal/generated/WhereClause.qll d6c8f72bbec5d71c024f0d365c1c5e474f4d24ded0d34c56c1f66b1e4a384e9d ed14311d140eee00d3b26a4972f53e20d5af1bddf88fb5618e7e2d3ae1d816f3 lib/codeql/rust/elements/internal/generated/WherePred.qll 342050e824ca6eb6116488d46cfc03efa79193b4de6049e1f5d4a9fe527b3036 ed07a81de7d63f853c93cbb7291eea3d7169953e34c2f2f98b570028dd1f8cd9 -lib/codeql/rust/elements/internal/generated/WhileExpr.qll fec8a9211b82a80601bf731db17409c5de6bf145295623bd86e28f96452fd91d 3916cf0c0e3b82b834727fc37809dd3e158f395bdf39971abe40b98e5f95a4d2 +lib/codeql/rust/elements/internal/generated/WhileExpr.qll 7edf1f23fbf953a2baabcdbf753a20dff9cf2bc645dcf935f1e68f412971a8f7 d2fa7ada1f48f6b4566c75747584068e925be925d39d6e6ebf61d21bde3b6522 lib/codeql/rust/elements/internal/generated/WildcardPat.qll d74b70b57a0a66bfae017a329352a5b27a6b9e73dd5521d627f680e810c6c59e 4b913b548ba27ff3c82fcd32cf996ff329cb57d176d3bebd0fcef394486ea499 lib/codeql/rust/elements/internal/generated/YeetExpr.qll cac328200872a35337b4bcb15c851afb4743f82c080f9738d295571eb01d7392 94af734eea08129b587fed849b643e7572800e8330c0b57d727d41abda47930b lib/codeql/rust/elements/internal/generated/YieldExpr.qll 37e5f0c1e373a22bbc53d8b7f2c0e1f476e5be5080b8437c5e964f4e83fad79a 4a9a68643401637bf48e5c2b2f74a6bf0ddcb4ff76f6bffb61d436b685621e85 -lib/codeql/rust/elements.qll 173d5ffbcc2874757033caab37559e84dbcbfed319730f8e41a4e9e10b146835 173d5ffbcc2874757033caab37559e84dbcbfed319730f8e41a4e9e10b146835 +lib/codeql/rust/elements.qll 76fe494d20d2665777bcb5c5ced016a262789a0e6aa874c1a77ce4cb134422b6 76fe494d20d2665777bcb5c5ced016a262789a0e6aa874c1a77ce4cb134422b6 test/extractor-tests/generated/Abi/Abi.ql 7f6e7dc4af86eca3ebdc79b10373988cd0871bd78b51997d3cffd969105e5fdd 2f936b6ca005c6157c755121584410c03e4a3949c23bee302fbe05ee10ce118f test/extractor-tests/generated/Abi/Abi_getAbiString.ql a496762fcec5a0887b87023bbf93e9b650f02e20113e25c44d6e4281ae8f5335 14109c7ce11ba25e3cd6e7f1b3fcb4cb00622f2a4eac91bfe43145c5f366bc52 test/extractor-tests/generated/ArgList/ArgList.ql e412927756e72165d0e7c5c9bd3fca89d08197bbf760db8fb7683c64bb2229bc 043dba8506946fbb87753e22c387987d7eded6ddb963aa067f9e60ef9024d684 @@ -614,7 +620,7 @@ test/extractor-tests/generated/BinaryExpr/BinaryExpr_getAttr.ql 26d985ac4b668d78 test/extractor-tests/generated/BinaryExpr/BinaryExpr_getLhs.ql c3f19d8a60066ad6b1810291a669473c75b659cd2f6ac3ab9ed3db2203d4145c c05c5e0226e30f923155669ffc79cfe63af1ca464e8dfc85888dda5f7049711b test/extractor-tests/generated/BinaryExpr/BinaryExpr_getOperatorName.ql 33612159be1c111e3306009d0b04579450fc962a81119b6ea4e255d3c409b401 1a0995b298f50242217cfef81dca8ac978e19e06f90a5f4caadcb6f84460fec2 test/extractor-tests/generated/BinaryExpr/BinaryExpr_getRhs.ql 3bcd36b678e87d5c29a43b69c54c80468a89aefa7e69481b48158ae794a53160 a629dc1472b3f6fd7c608ff760e83d8e1363db81dfe9a4b2968690c2ba4925ca -test/extractor-tests/generated/BlockExpr/BlockExpr.ql 0ab66b190d4e2aa784e61088c4779ef4d08cb4453677ea087c4f9aa369494bc2 1c3b5794008114d1297695d82590220929e3974e27836b2c6062d14b73379a40 +test/extractor-tests/generated/BlockExpr/BlockExpr.ql 19caa39aaa39356219dda740b7152f85e43a4f8d6295841e2c535c7e3bda7a5a bd668574ba41021e758e391d4790b871439badb2486ccf6a5aaf788ad6ae4142 test/extractor-tests/generated/BlockExpr/BlockExpr_getAttr.ql 15d4d9853d3262ce6ec629c075c60a76eb112dcafe34b71df0e09b39282223cf 792c498bc7079bb5b93034b8a87db3b275a591d78954e844821aeacffe4258ea test/extractor-tests/generated/BlockExpr/BlockExpr_getLabel.ql de3c28a2677ed71ebd95207aa43ce270765f7f556283f095f1f6296622b80cbc 414ebbb2bfbe4350f933fc3d3636b49a6bb8242e200180780caf95ab8523adb0 test/extractor-tests/generated/BlockExpr/BlockExpr_getStmtList.ql 8c391dfeb69bd92c547a2417bf231cc960a8f34845802722214294728772316a f3e847fa594e9d9cf25d09a0396a10176aad1100c1977a24756ff6287a79e69e @@ -698,7 +704,7 @@ test/extractor-tests/generated/FnPtrType/FnPtrType.ql 50b76d678582cd0b8d7cc4a765 test/extractor-tests/generated/FnPtrType/FnPtrType_getAbi.ql de1706382c2980c02dbdd295e0a2320c992afa3f19af0c2378b9980a7cd0c481 a3fa36711949d9d5ac53cc5dd39cb19b397c3f2e47c1d457df470c6e5142f9be test/extractor-tests/generated/FnPtrType/FnPtrType_getParamList.ql 9ea393acf37919e2fd1bbc16e738440e00a56552bf80baef9bfd2a9a405afb93 3b4237b22eea569cef0081eb3ea16b2d0f01f8f070f21e16390267e9cbe0cf57 test/extractor-tests/generated/FnPtrType/FnPtrType_getRetType.ql 57f662e4778e1bf4103f061bb8085def0708528f94045c9ff4a95ce802fff13d 924b924c7d766458e956afa0963e6eb1bfc083e5f9aeae64cf2d08929f79612c -test/extractor-tests/generated/ForExpr/ForExpr.ql eff335a301b9a71292bb6da0dffdf901c7a51df9960e9250f9eb980aaaa0c7ae ce7ab100c21c6fc334a4445b2ee311ae6c67992ef659ca32c94d60ac884936e3 +test/extractor-tests/generated/ForExpr/ForExpr.ql 1f8b7a9bbe7a8c077864be64dc51d91ec267c4f34f1cad80fc79902cc0af04ff ae999fb206b04ed81fa08bdd7617cbfe932c5e4109285e10108613cdebba8f7a test/extractor-tests/generated/ForExpr/ForExpr_getAttr.ql d3399b7453e10ff48efc79ec38dd9b6e06bb472b9c39f559242d003e7f63b1d9 ba37e6bf129e1c2f9094e093bbfbf41864f2cb7725a64334f9443270dafdbfdc test/extractor-tests/generated/ForExpr/ForExpr_getIterable.ql 90a6540f8a91cfe3ed1bdde1e680786ce5a00edbb797a8fe70bcc0507c438fcc 65c67ad5890aa502628ee73efd26bcbd4597a8bdfc9839233ede9e26393638f8 test/extractor-tests/generated/ForExpr/ForExpr_getLabel.ql ce90da75e040f448d524187357f3ceededba72407a84c1dc8e1498ed9788044d 0e23d43e0b3412fe90c6a5a4331f8da85eebe19e05b8c7d9710056857280797b @@ -786,7 +792,7 @@ test/extractor-tests/generated/LiteralExpr/LiteralExpr_getAttr.ql 6e76da2bb7858f test/extractor-tests/generated/LiteralExpr/LiteralExpr_getTextValue.ql 7049fec0bbbf0e048af1ff318f42f43d0f8a7354a5638dc21174c4ea725b54ce 2edc94cc0a7f58ec9808b63ddb4d20a3907c88e50bd9ffb14f0281b433f5621b test/extractor-tests/generated/LiteralPat/LiteralPat.ql 3d3db6cad0eb13f84b69efa24a9f9a32d35c62582274d2751cc3ac54dca3b538 7feb64af87546ea64c139c61ac20176a99ad40b9949b361742a424b164fe6d54 test/extractor-tests/generated/LiteralPat/LiteralPat_getLiteral.ql 2cb03a22220e99237d4f3cd94d5090757cd6e57df708d32e80bca3964507651f 4dd9a6c1e23ad9851d9aa8c42c79535f7a2c7224bbaaff286eac7fd04b39c6f0 -test/extractor-tests/generated/LoopExpr/LoopExpr.ql 636c28bff5f8c1ca0fb834f614b3215e02bdb00826fd8be26f9c4fa22c68a79a 1694c27850419d4edf366fe3f1d60fff578094adc3aeeb9691a3d6a8ec0100e1 +test/extractor-tests/generated/LoopExpr/LoopExpr.ql 37b320acefa3734331f87414de270c98ab3309fe069d428550738197e3498a8c e744c25640b5c46aab53ce5114b789e13319572b0c99d0f2bc3c177849e61541 test/extractor-tests/generated/LoopExpr/LoopExpr_getAttr.ql d557c1a34ae8762b32702d6b50e79c25bc506275c33a896b6b94bbbe73d04c49 34846c9eefa0219f4a16e28b518b2afa23f372d0aa03b08d042c5a35375e0cd6 test/extractor-tests/generated/LoopExpr/LoopExpr_getLabel.ql 0b77b9d9fb5903d37bce5a2c0d6b276e6269da56fcb37b83cd931872fb88490f c7f09c526e59dcadec13ec9719980d68b8619d630caab2c26b8368b06c1f2cc0 test/extractor-tests/generated/LoopExpr/LoopExpr_getLoopBody.ql 0267f54077640f3dfeb38524577e4a1229115eeb1c839398d0c5f460c1d65129 96ec876635b8c561f7add19e57574444f630eae3df9ab9bc33ac180e61f3a7b8 @@ -1100,7 +1106,7 @@ test/extractor-tests/generated/WherePred/WherePred_getGenericParamList.ql 21c3aa test/extractor-tests/generated/WherePred/WherePred_getLifetime.ql e08d9d6cccf634746f42a6ee583bbb3e7e9a9edbb63242e73b2bff4463df55d8 139543750c18f88d9c1ad2cdbcf1699d597cf2264bbb6b02a7e5792444e277ef test/extractor-tests/generated/WherePred/WherePred_getTy.ql 34cee0335bbaf8946fe15e3c32449150d07a730fcca56b4faed554fbb8689e21 883976c8c27c276c402d591ebd89d076c2c4d8da4d4f738f3c860c34d4a03b97 test/extractor-tests/generated/WherePred/WherePred_getTypeBoundList.ql c78e31ff4d1822a6b76f403e5ccb8f5529b4f784e14e618833df0378adca55fc 8bb1c9b5a1cfca0f5e8335464f7439aa098063176fbd3edbaf3407169f1899e6 -test/extractor-tests/generated/WhileExpr/WhileExpr.ql e061fac7584adf999d31ed0785041e2cc14b26a1c9901281f90c859335d8f614 fb1e597e28841e3b2d275d697aa6de7158db51b70a348d634291a75b25e4e80a +test/extractor-tests/generated/WhileExpr/WhileExpr.ql 61c49414f2ed786a68b79bd9a77093e4086457edb6c136cf8a94f2ac830c2f5b 7737f724a297d011c12143e009a63926812c63c08a1067b03e8677697ab00f83 test/extractor-tests/generated/WhileExpr/WhileExpr_getAttr.ql f8527130eb2492743c0e629c97db291abcefe3d35302c840fee327ab0d8f10fd b41bedd429e5566fd68a50140ff1f50b51e2c7c351cbc8253fbc126527073f7e test/extractor-tests/generated/WhileExpr/WhileExpr_getCondition.ql 84a021806423425b24eaeb9fb9967a6aadabe823c24e77a0dfefcb3509041597 147aa8bbe4dbf9b90be2467db8207dc96aed281e722eb6b9c998442a90911a6c test/extractor-tests/generated/WhileExpr/WhileExpr_getLabel.ql 60ef4de57d85c7df23c0518b944b3839a9b2478044326829b5bf709a8c8d7240 3916e9ff50733c58afdc09837339b72a555a043f92f1c4e09e1652866029b017 diff --git a/rust/ql/.gitattributes b/rust/ql/.gitattributes index 7411c9cba352..91644fc94afa 100644 --- a/rust/ql/.gitattributes +++ b/rust/ql/.gitattributes @@ -61,6 +61,7 @@ /lib/codeql/rust/elements/Item.qll linguist-generated /lib/codeql/rust/elements/ItemList.qll linguist-generated /lib/codeql/rust/elements/Label.qll linguist-generated +/lib/codeql/rust/elements/LabelableExpr.qll linguist-generated /lib/codeql/rust/elements/LetElse.qll linguist-generated /lib/codeql/rust/elements/LetExpr.qll linguist-generated /lib/codeql/rust/elements/LetStmt.qll linguist-generated @@ -71,6 +72,7 @@ /lib/codeql/rust/elements/LiteralPat.qll linguist-generated /lib/codeql/rust/elements/Locatable.qll linguist-generated /lib/codeql/rust/elements/LoopExpr.qll linguist-generated +/lib/codeql/rust/elements/LoopingExpr.qll linguist-generated /lib/codeql/rust/elements/MacroCall.qll linguist-generated /lib/codeql/rust/elements/MacroDef.qll linguist-generated /lib/codeql/rust/elements/MacroExpr.qll linguist-generated @@ -186,6 +188,7 @@ /lib/codeql/rust/elements/internal/BecomeExprConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/BinaryExprConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/BlockExprConstructor.qll linguist-generated +/lib/codeql/rust/elements/internal/BlockExprImpl.qll linguist-generated /lib/codeql/rust/elements/internal/BoxPatConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/BreakExprConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/CallExprBaseImpl.qll linguist-generated @@ -258,6 +261,7 @@ /lib/codeql/rust/elements/internal/LiteralExprConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/LiteralPatConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/LoopExprConstructor.qll linguist-generated +/lib/codeql/rust/elements/internal/LoopingExprImpl.qll linguist-generated /lib/codeql/rust/elements/internal/MacroCallConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/MacroDefConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/MacroDefImpl.qll linguist-generated @@ -470,6 +474,7 @@ /lib/codeql/rust/elements/internal/generated/Item.qll linguist-generated /lib/codeql/rust/elements/internal/generated/ItemList.qll linguist-generated /lib/codeql/rust/elements/internal/generated/Label.qll linguist-generated +/lib/codeql/rust/elements/internal/generated/LabelableExpr.qll linguist-generated /lib/codeql/rust/elements/internal/generated/LetElse.qll linguist-generated /lib/codeql/rust/elements/internal/generated/LetExpr.qll linguist-generated /lib/codeql/rust/elements/internal/generated/LetStmt.qll linguist-generated @@ -480,6 +485,7 @@ /lib/codeql/rust/elements/internal/generated/LiteralPat.qll linguist-generated /lib/codeql/rust/elements/internal/generated/Locatable.qll linguist-generated /lib/codeql/rust/elements/internal/generated/LoopExpr.qll linguist-generated +/lib/codeql/rust/elements/internal/generated/LoopingExpr.qll linguist-generated /lib/codeql/rust/elements/internal/generated/MacroCall.qll linguist-generated /lib/codeql/rust/elements/internal/generated/MacroDef.qll linguist-generated /lib/codeql/rust/elements/internal/generated/MacroExpr.qll linguist-generated diff --git a/rust/ql/lib/codeql/rust/elements.qll b/rust/ql/lib/codeql/rust/elements.qll index b516d8a9d185..6bb59b428824 100644 --- a/rust/ql/lib/codeql/rust/elements.qll +++ b/rust/ql/lib/codeql/rust/elements.qll @@ -64,6 +64,7 @@ import codeql.rust.elements.InferType import codeql.rust.elements.Item import codeql.rust.elements.ItemList import codeql.rust.elements.Label +import codeql.rust.elements.LabelableExpr import codeql.rust.elements.LetElse import codeql.rust.elements.LetExpr import codeql.rust.elements.LetStmt @@ -74,6 +75,7 @@ import codeql.rust.elements.LiteralExpr import codeql.rust.elements.LiteralPat import codeql.rust.elements.Locatable import codeql.rust.elements.LoopExpr +import codeql.rust.elements.LoopingExpr import codeql.rust.elements.MacroCall import codeql.rust.elements.MacroDef import codeql.rust.elements.MacroExpr diff --git a/rust/ql/lib/codeql/rust/elements/BlockExpr.qll b/rust/ql/lib/codeql/rust/elements/BlockExpr.qll index a87bbe472528..9e87d381525d 100644 --- a/rust/ql/lib/codeql/rust/elements/BlockExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/BlockExpr.qll @@ -5,8 +5,7 @@ private import internal.BlockExprImpl import codeql.rust.elements.Attr -import codeql.rust.elements.Expr -import codeql.rust.elements.Label +import codeql.rust.elements.LabelableExpr import codeql.rust.elements.StmtList /** diff --git a/rust/ql/lib/codeql/rust/elements/ForExpr.qll b/rust/ql/lib/codeql/rust/elements/ForExpr.qll index c4ef6f9faffc..cfb2586202ed 100644 --- a/rust/ql/lib/codeql/rust/elements/ForExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/ForExpr.qll @@ -5,9 +5,8 @@ private import internal.ForExprImpl import codeql.rust.elements.Attr -import codeql.rust.elements.BlockExpr import codeql.rust.elements.Expr -import codeql.rust.elements.Label +import codeql.rust.elements.LoopingExpr import codeql.rust.elements.Pat /** diff --git a/rust/ql/lib/codeql/rust/elements/LabelableExpr.qll b/rust/ql/lib/codeql/rust/elements/LabelableExpr.qll new file mode 100644 index 000000000000..c2a042595a19 --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/LabelableExpr.qll @@ -0,0 +1,13 @@ +// generated by codegen, do not edit +/** + * This module provides the public class `LabelableExpr`. + */ + +private import internal.LabelableExprImpl +import codeql.rust.elements.Expr +import codeql.rust.elements.Label + +/** + * The base class for expressions that can be labeled (`LoopExpr`, `ForExpr`, `WhileExpr` or `BlockExpr`). + */ +final class LabelableExpr = Impl::LabelableExpr; diff --git a/rust/ql/lib/codeql/rust/elements/LoopExpr.qll b/rust/ql/lib/codeql/rust/elements/LoopExpr.qll index 6abc449c6261..cdb6d743b50f 100644 --- a/rust/ql/lib/codeql/rust/elements/LoopExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/LoopExpr.qll @@ -5,9 +5,7 @@ private import internal.LoopExprImpl import codeql.rust.elements.Attr -import codeql.rust.elements.BlockExpr -import codeql.rust.elements.Expr -import codeql.rust.elements.Label +import codeql.rust.elements.LoopingExpr /** * A loop expression. For example: diff --git a/rust/ql/lib/codeql/rust/elements/LoopingExpr.qll b/rust/ql/lib/codeql/rust/elements/LoopingExpr.qll new file mode 100644 index 000000000000..6078afdf762c --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/LoopingExpr.qll @@ -0,0 +1,13 @@ +// generated by codegen, do not edit +/** + * This module provides the public class `LoopingExpr`. + */ + +private import internal.LoopingExprImpl +import codeql.rust.elements.BlockExpr +import codeql.rust.elements.LabelableExpr + +/** + * The base class for expressions that loop (`LoopExpr`, `ForExpr` or `WhileExpr`). + */ +final class LoopingExpr = Impl::LoopingExpr; diff --git a/rust/ql/lib/codeql/rust/elements/WhileExpr.qll b/rust/ql/lib/codeql/rust/elements/WhileExpr.qll index 9dcbe9c6346f..fc704d35095a 100644 --- a/rust/ql/lib/codeql/rust/elements/WhileExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/WhileExpr.qll @@ -5,9 +5,8 @@ private import internal.WhileExprImpl import codeql.rust.elements.Attr -import codeql.rust.elements.BlockExpr import codeql.rust.elements.Expr -import codeql.rust.elements.Label +import codeql.rust.elements.LoopingExpr /** * A WhileExpr. For example: diff --git a/rust/ql/lib/codeql/rust/elements/internal/AwaitExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/AwaitExprImpl.qll index 17abcfdaaba0..d9aa0f8bf448 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/AwaitExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/AwaitExprImpl.qll @@ -22,6 +22,6 @@ module Impl { * ``` */ class AwaitExpr extends Generated::AwaitExpr { - override string toString() { result = "await ..." } + override string toString() { result = "await " + this.getExpr().toAbbreviatedString() } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/BecomeExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/BecomeExprImpl.qll index 806e1d7506dc..ded01ec4ef83 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/BecomeExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/BecomeExprImpl.qll @@ -25,6 +25,6 @@ module Impl { * ``` */ class BecomeExpr extends Generated::BecomeExpr { - override string toString() { result = "become ..." } + override string toString() { result = "become " + this.getExpr().toAbbreviatedString() } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/BlockExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/BlockExprImpl.qll index bdfc8a56d7d3..9011109b194e 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/BlockExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/BlockExprImpl.qll @@ -1,3 +1,4 @@ +// generated by codegen, remove this comment if you wish to edit this file /** * This module provides a hand-modifiable wrapper around the generated class `BlockExpr`. * @@ -11,7 +12,6 @@ private import codeql.rust.elements.internal.generated.BlockExpr * be referenced directly. */ module Impl { - // the following QLdoc is generated: if you need to edit it, do it in the schema file /** * A block expression. For example: * ```rust @@ -26,7 +26,5 @@ module Impl { * } * ``` */ - class BlockExpr extends Generated::BlockExpr { - override string toString() { result = "{ ... }" } - } + class BlockExpr extends Generated::BlockExpr { } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/BoxPatImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/BoxPatImpl.qll index 5c6ffe229eb3..45870d14297b 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/BoxPatImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/BoxPatImpl.qll @@ -22,6 +22,6 @@ module Impl { * ``` */ class BoxPat extends Generated::BoxPat { - override string toString() { result = "box ..." } + override string toString() { result = "box " + this.getPat().toAbbreviatedString() } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/BreakExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/BreakExprImpl.qll index 6cfba6978287..9104a07a5474 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/BreakExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/BreakExprImpl.qll @@ -5,6 +5,7 @@ */ private import codeql.rust.elements.internal.generated.BreakExpr +import codeql.rust.elements.LabelableExpr /** * INTERNAL: This module contains the customizable definition of `BreakExpr` and should not @@ -103,16 +104,14 @@ module Impl { ) } - override string toString() { - exists(string label, string expr | - ( - label = " " + this.getLifetime().toString() - or - not this.hasLifetime() and label = "" - ) and - (if this.hasExpr() then expr = " ..." else expr = "") and - result = "break" + label + expr - ) + override string toString() { result = concat(int i | | this.toStringPart(i), " " order by i) } + + private string toStringPart(int index) { + index = 0 and result = "break" + or + index = 1 and result = this.getLifetime().toString() + or + index = 2 and result = this.getExpr().toAbbreviatedString() } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/CallExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/CallExprImpl.qll index 4cf0272c0088..3da29db7df1c 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/CallExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/CallExprImpl.qll @@ -23,15 +23,6 @@ module Impl { * ``` */ class CallExpr extends Generated::CallExpr { - override string toString() { - exists(string callee | - ( - callee = this.getExpr().(PathExpr).toString() - or - not this.getExpr() instanceof PathExpr and callee = "..." - ) and - result = callee + "(...)" - ) - } + override string toString() { result = this.getExpr().toAbbreviatedString() + "(...)" } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/CastExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/CastExprImpl.qll index 3d021e4955d3..59cc960a67bd 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/CastExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/CastExprImpl.qll @@ -19,6 +19,8 @@ module Impl { * ``` */ class CastExpr extends Generated::CastExpr { - override string toString() { result = "... as " + this.getTy().toString() } + override string toString() { + result = this.getExpr().toAbbreviatedString() + " as " + this.getTy().toString() + } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/ClosureExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/ClosureExprImpl.qll index 861a258ec8e3..17e373290b50 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/ClosureExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/ClosureExprImpl.qll @@ -25,6 +25,6 @@ module Impl { * ``` */ class ClosureExpr extends Generated::ClosureExpr { - override string toString() { result = "|...| ..." } + override string toString() { result = "|...| " + this.getBody().toAbbreviatedString() } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/ContinueExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/ContinueExprImpl.qll index 8c67382498c8..957574d409a5 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/ContinueExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/ContinueExprImpl.qll @@ -49,15 +49,12 @@ module Impl { * ``` */ class ContinueExpr extends Generated::ContinueExpr { - override string toString() { - exists(string label | - ( - label = " " + this.getLifetime().getText() - or - not this.hasLifetime() and label = "" - ) and - result = "continue" + label - ) + override string toString() { result = concat(int i | | this.toStringPart(i), " " order by i) } + + private string toStringPart(int index) { + index = 0 and result = "continue" + or + index = 1 and result = this.getLifetime().toString() } /** @@ -66,7 +63,7 @@ module Impl { * The target is either a `LoopExpr`, a `ForExpr`, or a `WhileExpr`. */ pragma[nomagic] - Expr getTarget() { + LoopingExpr getTarget() { exists(string label | result = getAContinueAncestor(this, label) and BreakExprImpl::isLabelledLoop(result, label) diff --git a/rust/ql/lib/codeql/rust/elements/internal/ElementImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/ElementImpl.qll index 6f342c00fd3c..9307a567b6e1 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/ElementImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/ElementImpl.qll @@ -14,6 +14,14 @@ module Impl { class Element extends Generated::Element { override string toString() { result = this.getAPrimaryQlClass() } + /** + * Returns a string suitable to be inserted into the name of the parent. Typically `"..."`, + * but may be overridden by subclasses. + * + * INTERNAL: Do not use. + */ + string toAbbreviatedString() { result = "..." } + predicate isUnknown() { none() } // compatibility with test generation, to be fixed } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/FieldExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/FieldExprImpl.qll index ccfcc4fd7b71..922de73c65d9 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/FieldExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/FieldExprImpl.qll @@ -19,6 +19,12 @@ module Impl { * ``` */ class FieldExpr extends Generated::FieldExpr { - override string toString() { result = "... ." + this.getNameRef().toString() } + override string toString() { + exists(string abbr, string name | + abbr = this.getExpr().toAbbreviatedString() and + name = this.getNameRef().toString() and + if abbr = "..." then result = "... ." + name else result = abbr + "." + name + ) + } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/ForExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/ForExprImpl.qll index da62b58732b0..b333702c9415 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/ForExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/ForExprImpl.qll @@ -19,6 +19,8 @@ module Impl { * ``` */ class ForExpr extends Generated::ForExpr { - override string toString() { result = "for " + this.getPat().toString() + " in ... { ... }" } + override string toStringPrefix() { + result = "for " + this.getPat().toAbbreviatedString() + " in ..." + } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/IfExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/IfExprImpl.qll index 59c0638c42ed..c90ee6ccdc06 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/IfExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/IfExprImpl.qll @@ -28,11 +28,16 @@ module Impl { * ``` */ class IfExpr extends Generated::IfExpr { - override string toString() { - exists(string elseString | - (if this.hasElse() then elseString = " else { ... }" else elseString = "") and - result = "if ... { ... }" + elseString - ) + override string toString() { result = concat(int i | | this.toStringPart(i), " " order by i) } + + private string toStringPart(int index) { + index = 0 and result = "if" + or + index = 1 and result = this.getCondition().toAbbreviatedString() + or + index = 2 and result = "{...}" + or + index = 3 and this.hasElse() and result = "else {...}" } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/IndexExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/IndexExprImpl.qll index 28db84aa873b..2ace04fe3899 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/IndexExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/IndexExprImpl.qll @@ -20,6 +20,9 @@ module Impl { * ``` */ class IndexExpr extends Generated::IndexExpr { - override string toString() { result = "...[...]" } + override string toString() { + result = + this.getBase().toAbbreviatedString() + "[" + this.getIndex().toAbbreviatedString() + "]" + } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/LabelableExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/LabelableExprImpl.qll new file mode 100644 index 000000000000..1b354658a2ed --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/internal/LabelableExprImpl.qll @@ -0,0 +1,30 @@ +/** + * This module provides a hand-modifiable wrapper around the generated class `LabelableExpr`. + * + * INTERNAL: Do not use. + */ + +private import codeql.rust.elements.internal.generated.LabelableExpr + +/** + * INTERNAL: This module contains the customizable definition of `LabelableExpr` and should not + * be referenced directly. + */ +module Impl { + // the following QLdoc is generated: if you need to edit it, do it in the schema file + /** + * The base class for expressions that can be labeled (`LoopExpr`, `ForExpr`, `WhileExpr` or `BlockExpr`). + */ + class LabelableExpr extends Generated::LabelableExpr { + override string toString() { + result = concat([this.getLabel().toString() + ":", this.toStringPrefix(), "{ ... }"], " ") + } + + /** + * Get the prefix for the string representation of this element. + * + * INTERNAL: Do not use. + */ + string toStringPrefix() { none() } + } +} diff --git a/rust/ql/lib/codeql/rust/elements/internal/LetExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/LetExprImpl.qll index 8a54a005cf58..5b8bd7ec963f 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/LetExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/LetExprImpl.qll @@ -21,11 +21,14 @@ module Impl { * ``` */ class LetExpr extends Generated::LetExpr { - override string toString() { - exists(string expr | - (if this.hasExpr() then expr = " = ..." else expr = "") and - result = "let " + this.getPat().toString() + expr - ) + override string toString() { result = concat(int i | | this.toStringPart(i), " " order by i) } + + private string toStringPart(int index) { + index = 0 and result = "let" + or + index = 1 and result = this.getPat().toAbbreviatedString() + or + index = 2 and result = "= " + this.getExpr().toAbbreviatedString() } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/LetStmtImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/LetStmtImpl.qll index fce6aa3de44c..1205836c2306 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/LetStmtImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/LetStmtImpl.qll @@ -26,12 +26,16 @@ module Impl { * ``` */ class LetStmt extends Generated::LetStmt { - override string toString() { - exists(string expr, string elseStr | - (if this.hasInitializer() then expr = " = ..." else expr = "") and - (if this.hasLetElse() then elseStr = " else { ... }" else elseStr = "") and - result = "let " + this.getPat().toString() + expr + elseStr - ) + override string toString() { result = concat(int i | | this.toStringPart(i), " " order by i) } + + private string toStringPart(int index) { + index = 0 and result = "let" + or + index = 1 and result = this.getPat().toAbbreviatedString() + or + index = 2 and result = "= " + this.getInitializer().toAbbreviatedString() + or + index = 3 and result = this.getLetElse().toString() } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/LiteralExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/LiteralExprImpl.qll index 1b660b134c43..efcc4bf073e9 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/LiteralExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/LiteralExprImpl.qll @@ -27,5 +27,7 @@ module Impl { */ class LiteralExpr extends Generated::LiteralExpr { override string toString() { result = this.getTextValue() } + + override string toAbbreviatedString() { result = this.getTextValue() } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/LiteralPatImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/LiteralPatImpl.qll index 5bf0c13576a6..65074603796a 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/LiteralPatImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/LiteralPatImpl.qll @@ -22,6 +22,8 @@ module Impl { * ``` */ class LiteralPat extends Generated::LiteralPat { - override string toString() { result = this.getLiteral().toString() } + override string toString() { result = this.toAbbreviatedString() } + + override string toAbbreviatedString() { result = this.getLiteral().toString() } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/LoopExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/LoopExprImpl.qll index f91a14489c5c..732148717054 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/LoopExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/LoopExprImpl.qll @@ -37,6 +37,6 @@ module Impl { * ``` */ class LoopExpr extends Generated::LoopExpr { - override string toString() { result = "loop {...}" } + override string toStringPrefix() { result = "loop" } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/LoopingExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/LoopingExprImpl.qll new file mode 100644 index 000000000000..45aa8f42e74b --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/internal/LoopingExprImpl.qll @@ -0,0 +1,19 @@ +// generated by codegen, remove this comment if you wish to edit this file +/** + * This module provides a hand-modifiable wrapper around the generated class `LoopingExpr`. + * + * INTERNAL: Do not use. + */ + +private import codeql.rust.elements.internal.generated.LoopingExpr + +/** + * INTERNAL: This module contains the customizable definition of `LoopingExpr` and should not + * be referenced directly. + */ +module Impl { + /** + * The base class for expressions that loop (`LoopExpr`, `ForExpr` or `WhileExpr`). + */ + class LoopingExpr extends Generated::LoopingExpr { } +} diff --git a/rust/ql/lib/codeql/rust/elements/internal/MatchArmImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/MatchArmImpl.qll index 280eb4ea7c87..23ad2551bffc 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/MatchArmImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/MatchArmImpl.qll @@ -28,11 +28,16 @@ module Impl { * ``` */ class MatchArm extends Generated::MatchArm { - override string toString() { - exists(string guard | - (if this.hasGuard() then guard = "if ... " else guard = "") and - result = this.getPat().toString() + guard + " => ..." - ) + override string toString() { result = concat(int i | | this.toStringPart(i), " " order by i) } + + private string toStringPart(int index) { + index = 0 and result = this.getPat().toAbbreviatedString() + or + index = 1 and result = "if " + this.getGuard().toAbbreviatedString() + or + index = 2 and result = "=>" + or + index = 3 and result = this.getExpr().toAbbreviatedString() } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/MatchExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/MatchExprImpl.qll index 530e9cc50a76..3ce9aa773107 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/MatchExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/MatchExprImpl.qll @@ -28,7 +28,9 @@ module Impl { * ``` */ class MatchExpr extends Generated::MatchExpr { - override string toString() { result = "match ... { ... }" } + override string toString() { + result = "match " + this.getExpr().toAbbreviatedString() + " { ... }" + } /** * Gets the `index`th arm of this match expression. diff --git a/rust/ql/lib/codeql/rust/elements/internal/NeverTypeImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/NeverTypeImpl.qll index 985ec81cdeb7..c1858fc9421a 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/NeverTypeImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/NeverTypeImpl.qll @@ -19,6 +19,8 @@ module Impl { * ``` */ class NeverType extends Generated::NeverType { - override string toString() { result = "!" } + override string toString() { result = this.toAbbreviatedString() } + + override string toAbbreviatedString() { result = "!" } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/OrPatImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/OrPatImpl.qll index ffc3fb3d5b83..20ee0f688522 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/OrPatImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/OrPatImpl.qll @@ -21,7 +21,9 @@ module Impl { * ``` */ class OrPat extends Generated::OrPat { - override string toString() { result = "... | ..." } + override string toString() { + result = concat(int i | | this.getPat(i).toAbbreviatedString() order by i, " | ") + } /** Gets the last pattern in this or pattern. */ pragma[nomagic] diff --git a/rust/ql/lib/codeql/rust/elements/internal/ParamImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/ParamImpl.qll index 5f135cc94ca7..33e4f5fee59b 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/ParamImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/ParamImpl.qll @@ -19,15 +19,12 @@ module Impl { * ``` */ class Param extends Generated::Param { - override string toString() { - exists(string ty | - ( - ty = ": " + this.getTy().toString() - or - not this.hasTy() and ty = "" - ) and - result = this.getPat().toString() + ty - ) + override string toString() { result = concat(int i | | this.toStringPart(i) order by i) } + + private string toStringPart(int index) { + index = 0 and result = this.getPat().toAbbreviatedString() + or + index = 1 and result = ": " + this.getTy().toAbbreviatedString() } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/ParenExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/ParenExprImpl.qll index 5dce46343400..db9d19f5650b 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/ParenExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/ParenExprImpl.qll @@ -19,6 +19,6 @@ module Impl { * ``` */ class ParenExpr extends Generated::ParenExpr { - override string toString() { result = "(...)" } + override string toString() { result = "(" + this.getExpr().toAbbreviatedString() + ")" } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/ParenPatImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/ParenPatImpl.qll index 5eb8a4860307..9d9016cff98e 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/ParenPatImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/ParenPatImpl.qll @@ -19,6 +19,6 @@ module Impl { * ``` */ class ParenPat extends Generated::ParenPat { - override string toString() { result = "(...)" } + override string toString() { result = "(" + this.getPat().toAbbreviatedString() + ")" } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/ParenTypeImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/ParenTypeImpl.qll index 95c022d651a3..916758b91333 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/ParenTypeImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/ParenTypeImpl.qll @@ -19,6 +19,6 @@ module Impl { * ``` */ class ParenType extends Generated::ParenType { - override string toString() { result = "(...)" } + override string toString() { result = "(" + this.getTy().toAbbreviatedString() + ")" } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/PathExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/PathExprImpl.qll index c8a2af3de33b..19445493c889 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/PathExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/PathExprImpl.qll @@ -22,6 +22,8 @@ module Impl { * ``` */ class PathExpr extends Generated::PathExpr { - override string toString() { result = this.getPath().toString() } + override string toString() { result = this.toAbbreviatedString() } + + override string toAbbreviatedString() { result = this.getPath().toString() } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/PathImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/PathImpl.qll index b53c86559f0c..8d0a2ab0ecf1 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/PathImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/PathImpl.qll @@ -19,10 +19,14 @@ module Impl { * ``` */ class Path extends Generated::Path { - override string toString() { + override string toString() { result = this.toAbbreviatedString() } + + override string toAbbreviatedString() { if this.hasQualifier() - then result = this.getQualifier().toString() + "::" + this.getPart().toString() - else result = this.getPart().toString() + then + result = + this.getQualifier().toAbbreviatedString() + "::" + this.getPart().toAbbreviatedString() + else result = this.getPart().toAbbreviatedString() } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/PathPatImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/PathPatImpl.qll index 2c6d94cbccea..a78d0dd7ab9b 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/PathPatImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/PathPatImpl.qll @@ -22,6 +22,8 @@ module Impl { * ``` */ class PathPat extends Generated::PathPat { - override string toString() { result = this.getPath().toString() } + override string toString() { result = this.toAbbreviatedString() } + + override string toAbbreviatedString() { result = this.getPath().toString() } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/PathSegmentImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/PathSegmentImpl.qll index 300a6c7d4a0c..90d7cee66392 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/PathSegmentImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/PathSegmentImpl.qll @@ -19,7 +19,9 @@ module Impl { * ``` */ class PathSegment extends Generated::PathSegment { - override string toString() { + override string toString() { result = this.toAbbreviatedString() } + + override string toAbbreviatedString() { // TODO: this does not cover everything if this.hasGenericArgList() then result = this.getNameRef().toString() + "::<...>" diff --git a/rust/ql/lib/codeql/rust/elements/internal/PathTypeImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/PathTypeImpl.qll index 9c2f4e50052a..3f88c50fa6a2 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/PathTypeImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/PathTypeImpl.qll @@ -19,6 +19,8 @@ module Impl { * ``` */ class PathType extends Generated::PathType { - override string toString() { result = this.getPath().toString() } + override string toString() { result = this.toAbbreviatedString() } + + override string toAbbreviatedString() { result = this.getPath().toString() } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/RangeExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/RangeExprImpl.qll index 53dccb24fbd5..3b8989af7821 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/RangeExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/RangeExprImpl.qll @@ -24,6 +24,28 @@ module Impl { * ``` */ class RangeExpr extends Generated::RangeExpr { - override string toString() { result = "... " + this.getOperatorName().toString() + " ..." } + override string toString() { result = concat(int i | | this.toStringPart(i) order by i) } + + private string toStringPart(int index) { + index = 0 and result = this.getStartAbbreviation() + or + index = 1 and result = this.getOperatorName() + or + index = 2 and result = this.getEndAbbreviation() + } + + private string getStartAbbreviation() { + exists(string abbr | + abbr = this.getStart().toAbbreviatedString() and + if abbr = "..." then result = "... " else result = abbr + ) + } + + private string getEndAbbreviation() { + exists(string abbr | + abbr = this.getEnd().toAbbreviatedString() and + if abbr = "..." then result = " ..." else result = abbr + ) + } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/RecordExprFieldImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/RecordExprFieldImpl.qll index f5462ab29c3d..6e24c31d5524 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/RecordExprFieldImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/RecordExprFieldImpl.qll @@ -19,11 +19,12 @@ module Impl { * ``` */ class RecordExprField extends Generated::RecordExprField { - override string toString() { - exists(string init | - (if this.hasExpr() then init = ": ..." else init = "") and - result = this.getNameRef().toString() + init - ) + override string toString() { result = concat(int i | | this.toStringPart(i) order by i) } + + private string toStringPart(int index) { + index = 0 and result = this.getNameRef().toString() + or + index = 1 and result = ": " + this.getExpr().toAbbreviatedString() } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/RefExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/RefExprImpl.qll index cf3ade0ad148..4ec593362d95 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/RefExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/RefExprImpl.qll @@ -23,12 +23,17 @@ module Impl { */ class RefExpr extends Generated::RefExpr { override string toString() { - exists(string raw, string const, string mut | - (if this.isRaw() then raw = "raw " else raw = "") and - (if this.isConst() then const = "const " else const = "") and - (if this.isMut() then mut = "mut " else mut = "") and - result = "&" + raw + const + mut + "..." - ) + result = "&" + concat(int i | | this.getSpecPart(i), " " order by i) + } + + private string getSpecPart(int index) { + index = 0 and this.isRaw() and result = "raw" + or + index = 1 and this.isConst() and result = "const" + or + index = 2 and this.isMut() and result = "mut" + or + index = 3 and result = this.getExpr().toAbbreviatedString() } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/RefPatImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/RefPatImpl.qll index a28574c1c071..d6b1f4c27092 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/RefPatImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/RefPatImpl.qll @@ -23,10 +23,13 @@ module Impl { */ class RefPat extends Generated::RefPat { override string toString() { - exists(string mut | - (if this.isMut() then mut = "mut " else mut = "") and - result = "&" + mut + "..." - ) + result = "&" + concat(int i | | this.getSpecPart(i), " " order by i) + } + + private string getSpecPart(int index) { + index = 0 and this.isMut() and result = "mut" + or + index = 1 and result = this.getPat().toAbbreviatedString() } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/RestPatImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/RestPatImpl.qll index a4ae812b72b0..ec7d48a4d9d7 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/RestPatImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/RestPatImpl.qll @@ -19,6 +19,8 @@ module Impl { * ``` */ class RestPat extends Generated::RestPat { - override string toString() { result = ".." } + override string toString() { result = this.toAbbreviatedString() } + + override string toAbbreviatedString() { result = ".." } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/ReturnExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/ReturnExprImpl.qll index 245f7e873acb..1b632587867e 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/ReturnExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/ReturnExprImpl.qll @@ -26,8 +26,12 @@ module Impl { * ``` */ class ReturnExpr extends Generated::ReturnExpr { - override string toString() { - if this.hasExpr() then result = "return ..." else result = "return" + override string toString() { result = concat(int i | | this.toStringPart(i), " " order by i) } + + private string toStringPart(int index) { + index = 0 and result = "return" + or + index = 1 and result = this.getExpr().toAbbreviatedString() } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/UnderscoreExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/UnderscoreExprImpl.qll index 26487fbfe4fa..620a09e8c3d9 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/UnderscoreExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/UnderscoreExprImpl.qll @@ -19,6 +19,8 @@ module Impl { * ``` */ class UnderscoreExpr extends Generated::UnderscoreExpr { - override string toString() { result = "_" } + override string toString() { result = this.toAbbreviatedString() } + + override string toAbbreviatedString() { result = "_" } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/WhileExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/WhileExprImpl.qll index 43f9510be1ba..e41b6a684a1e 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/WhileExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/WhileExprImpl.qll @@ -19,6 +19,8 @@ module Impl { * ``` */ class WhileExpr extends Generated::WhileExpr { - override string toString() { result = "while ... { ... }" } + override string toStringPrefix() { + result = "while " + this.getCondition().toAbbreviatedString() + } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/WildcardPatImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/WildcardPatImpl.qll index d7973866d912..f1a8fa1a72ee 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/WildcardPatImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/WildcardPatImpl.qll @@ -19,6 +19,8 @@ module Impl { * ``` */ class WildcardPat extends Generated::WildcardPat { - override string toString() { result = "_" } + override string toString() { result = this.toAbbreviatedString() } + + override string toAbbreviatedString() { result = "_" } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/BlockExpr.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/BlockExpr.qll index c4f11fdd90c5..6a01a0c45880 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/BlockExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/BlockExpr.qll @@ -7,8 +7,7 @@ private import codeql.rust.elements.internal.generated.Synth private import codeql.rust.elements.internal.generated.Raw import codeql.rust.elements.Attr -import codeql.rust.elements.internal.ExprImpl::Impl as ExprImpl -import codeql.rust.elements.Label +import codeql.rust.elements.internal.LabelableExprImpl::Impl as LabelableExprImpl import codeql.rust.elements.StmtList /** @@ -32,7 +31,7 @@ module Generated { * INTERNAL: Do not reference the `Generated::BlockExpr` class directly. * Use the subclass `BlockExpr`, where the following predicates are available. */ - class BlockExpr extends Synth::TBlockExpr, ExprImpl::Expr { + class BlockExpr extends Synth::TBlockExpr, LabelableExprImpl::LabelableExpr { override string getAPrimaryQlClass() { result = "BlockExpr" } /** @@ -83,19 +82,6 @@ module Generated { */ predicate isUnsafe() { Synth::convertBlockExprToRaw(this).(Raw::BlockExpr).isUnsafe() } - /** - * Gets the label of this block expression, if it exists. - */ - Label getLabel() { - result = - Synth::convertLabelFromRaw(Synth::convertBlockExprToRaw(this).(Raw::BlockExpr).getLabel()) - } - - /** - * Holds if `getLabel()` exists. - */ - final predicate hasLabel() { exists(this.getLabel()) } - /** * Gets the statement list of this block expression, if it exists. */ diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/ForExpr.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/ForExpr.qll index dc5f2d34d3ee..202b1736fc49 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/ForExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/ForExpr.qll @@ -7,10 +7,8 @@ private import codeql.rust.elements.internal.generated.Synth private import codeql.rust.elements.internal.generated.Raw import codeql.rust.elements.Attr -import codeql.rust.elements.BlockExpr import codeql.rust.elements.Expr -import codeql.rust.elements.internal.ExprImpl::Impl as ExprImpl -import codeql.rust.elements.Label +import codeql.rust.elements.internal.LoopingExprImpl::Impl as LoopingExprImpl import codeql.rust.elements.Pat /** @@ -26,7 +24,7 @@ module Generated { * INTERNAL: Do not reference the `Generated::ForExpr` class directly. * Use the subclass `ForExpr`, where the following predicates are available. */ - class ForExpr extends Synth::TForExpr, ExprImpl::Expr { + class ForExpr extends Synth::TForExpr, LoopingExprImpl::LoopingExpr { override string getAPrimaryQlClass() { result = "ForExpr" } /** @@ -60,32 +58,6 @@ module Generated { */ final predicate hasIterable() { exists(this.getIterable()) } - /** - * Gets the label of this for expression, if it exists. - */ - Label getLabel() { - result = - Synth::convertLabelFromRaw(Synth::convertForExprToRaw(this).(Raw::ForExpr).getLabel()) - } - - /** - * Holds if `getLabel()` exists. - */ - final predicate hasLabel() { exists(this.getLabel()) } - - /** - * Gets the loop body of this for expression, if it exists. - */ - BlockExpr getLoopBody() { - result = - Synth::convertBlockExprFromRaw(Synth::convertForExprToRaw(this).(Raw::ForExpr).getLoopBody()) - } - - /** - * Holds if `getLoopBody()` exists. - */ - final predicate hasLoopBody() { exists(this.getLoopBody()) } - /** * Gets the pat of this for expression, if it exists. */ diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/LabelableExpr.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/LabelableExpr.qll new file mode 100644 index 000000000000..a0dfd03fb400 --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/LabelableExpr.qll @@ -0,0 +1,38 @@ +// generated by codegen, do not edit +/** + * This module provides the generated definition of `LabelableExpr`. + * INTERNAL: Do not import directly. + */ + +private import codeql.rust.elements.internal.generated.Synth +private import codeql.rust.elements.internal.generated.Raw +import codeql.rust.elements.internal.ExprImpl::Impl as ExprImpl +import codeql.rust.elements.Label + +/** + * INTERNAL: This module contains the fully generated definition of `LabelableExpr` and should not + * be referenced directly. + */ +module Generated { + /** + * The base class for expressions that can be labeled (`LoopExpr`, `ForExpr`, `WhileExpr` or `BlockExpr`). + * INTERNAL: Do not reference the `Generated::LabelableExpr` class directly. + * Use the subclass `LabelableExpr`, where the following predicates are available. + */ + class LabelableExpr extends Synth::TLabelableExpr, ExprImpl::Expr { + /** + * Gets the label of this labelable expression, if it exists. + */ + Label getLabel() { + result = + Synth::convertLabelFromRaw(Synth::convertLabelableExprToRaw(this) + .(Raw::LabelableExpr) + .getLabel()) + } + + /** + * Holds if `getLabel()` exists. + */ + final predicate hasLabel() { exists(this.getLabel()) } + } +} diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/LoopExpr.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/LoopExpr.qll index eb943bf746aa..510c3dedb683 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/LoopExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/LoopExpr.qll @@ -7,9 +7,7 @@ private import codeql.rust.elements.internal.generated.Synth private import codeql.rust.elements.internal.generated.Raw import codeql.rust.elements.Attr -import codeql.rust.elements.BlockExpr -import codeql.rust.elements.internal.ExprImpl::Impl as ExprImpl -import codeql.rust.elements.Label +import codeql.rust.elements.internal.LoopingExprImpl::Impl as LoopingExprImpl /** * INTERNAL: This module contains the fully generated definition of `LoopExpr` and should not @@ -42,7 +40,7 @@ module Generated { * INTERNAL: Do not reference the `Generated::LoopExpr` class directly. * Use the subclass `LoopExpr`, where the following predicates are available. */ - class LoopExpr extends Synth::TLoopExpr, ExprImpl::Expr { + class LoopExpr extends Synth::TLoopExpr, LoopingExprImpl::LoopingExpr { override string getAPrimaryQlClass() { result = "LoopExpr" } /** @@ -62,33 +60,5 @@ module Generated { * Gets the number of attrs of this loop expression. */ final int getNumberOfAttrs() { result = count(int i | exists(this.getAttr(i))) } - - /** - * Gets the label of this loop expression, if it exists. - */ - Label getLabel() { - result = - Synth::convertLabelFromRaw(Synth::convertLoopExprToRaw(this).(Raw::LoopExpr).getLabel()) - } - - /** - * Holds if `getLabel()` exists. - */ - final predicate hasLabel() { exists(this.getLabel()) } - - /** - * Gets the loop body of this loop expression, if it exists. - */ - BlockExpr getLoopBody() { - result = - Synth::convertBlockExprFromRaw(Synth::convertLoopExprToRaw(this) - .(Raw::LoopExpr) - .getLoopBody()) - } - - /** - * Holds if `getLoopBody()` exists. - */ - final predicate hasLoopBody() { exists(this.getLoopBody()) } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/LoopingExpr.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/LoopingExpr.qll new file mode 100644 index 000000000000..427ef05c2aba --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/LoopingExpr.qll @@ -0,0 +1,38 @@ +// generated by codegen, do not edit +/** + * This module provides the generated definition of `LoopingExpr`. + * INTERNAL: Do not import directly. + */ + +private import codeql.rust.elements.internal.generated.Synth +private import codeql.rust.elements.internal.generated.Raw +import codeql.rust.elements.BlockExpr +import codeql.rust.elements.internal.LabelableExprImpl::Impl as LabelableExprImpl + +/** + * INTERNAL: This module contains the fully generated definition of `LoopingExpr` and should not + * be referenced directly. + */ +module Generated { + /** + * The base class for expressions that loop (`LoopExpr`, `ForExpr` or `WhileExpr`). + * INTERNAL: Do not reference the `Generated::LoopingExpr` class directly. + * Use the subclass `LoopingExpr`, where the following predicates are available. + */ + class LoopingExpr extends Synth::TLoopingExpr, LabelableExprImpl::LabelableExpr { + /** + * Gets the loop body of this looping expression, if it exists. + */ + BlockExpr getLoopBody() { + result = + Synth::convertBlockExprFromRaw(Synth::convertLoopingExprToRaw(this) + .(Raw::LoopingExpr) + .getLoopBody()) + } + + /** + * Holds if `getLoopBody()` exists. + */ + final predicate hasLoopBody() { exists(this.getLoopBody()) } + } +} diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll index 470207683ae5..6f005ee5a94a 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll @@ -1397,29 +1397,6 @@ private module Impl { ) } - private Element getImmediateChildOfBlockExpr(BlockExpr e, int index, string partialPredicateCall) { - exists(int b, int bExpr, int n, int nAttr, int nLabel, int nStmtList | - b = 0 and - bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and - n = bExpr and - nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and - nLabel = nAttr + 1 and - nStmtList = nLabel + 1 and - ( - none() - or - result = getImmediateChildOfExpr(e, index - b, partialPredicateCall) - or - result = e.getAttr(index - n) and - partialPredicateCall = "Attr(" + (index - n).toString() + ")" - or - index = nAttr and result = e.getLabel() and partialPredicateCall = "Label()" - or - index = nLabel and result = e.getStmtList() and partialPredicateCall = "StmtList()" - ) - ) - } - private Element getImmediateChildOfBoxPat(BoxPat e, int index, string partialPredicateCall) { exists(int b, int bPat, int n, int nPat | b = 0 and @@ -1708,35 +1685,6 @@ private module Impl { ) } - private Element getImmediateChildOfForExpr(ForExpr e, int index, string partialPredicateCall) { - exists(int b, int bExpr, int n, int nAttr, int nIterable, int nLabel, int nLoopBody, int nPat | - b = 0 and - bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and - n = bExpr and - nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and - nIterable = nAttr + 1 and - nLabel = nIterable + 1 and - nLoopBody = nLabel + 1 and - nPat = nLoopBody + 1 and - ( - none() - or - result = getImmediateChildOfExpr(e, index - b, partialPredicateCall) - or - result = e.getAttr(index - n) and - partialPredicateCall = "Attr(" + (index - n).toString() + ")" - or - index = nAttr and result = e.getIterable() and partialPredicateCall = "Iterable()" - or - index = nIterable and result = e.getLabel() and partialPredicateCall = "Label()" - or - index = nLabel and result = e.getLoopBody() and partialPredicateCall = "LoopBody()" - or - index = nLoopBody and result = e.getPat() and partialPredicateCall = "Pat()" - ) - ) - } - private Element getImmediateChildOfForType(ForType e, int index, string partialPredicateCall) { exists(int b, int bTypeRef, int n, int nGenericParamList, int nTy | b = 0 and @@ -1900,6 +1848,24 @@ private module Impl { ) } + private Element getImmediateChildOfLabelableExpr( + LabelableExpr e, int index, string partialPredicateCall + ) { + exists(int b, int bExpr, int n, int nLabel | + b = 0 and + bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and + n = bExpr and + nLabel = n + 1 and + ( + none() + or + result = getImmediateChildOfExpr(e, index - b, partialPredicateCall) + or + index = n and result = e.getLabel() and partialPredicateCall = "Label()" + ) + ) + } + private Element getImmediateChildOfLetExpr(LetExpr e, int index, string partialPredicateCall) { exists(int b, int bExpr, int n, int nAttr, int nExpr, int nPat | b = 0 and @@ -2034,29 +2000,6 @@ private module Impl { ) } - private Element getImmediateChildOfLoopExpr(LoopExpr e, int index, string partialPredicateCall) { - exists(int b, int bExpr, int n, int nAttr, int nLabel, int nLoopBody | - b = 0 and - bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and - n = bExpr and - nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and - nLabel = nAttr + 1 and - nLoopBody = nLabel + 1 and - ( - none() - or - result = getImmediateChildOfExpr(e, index - b, partialPredicateCall) - or - result = e.getAttr(index - n) and - partialPredicateCall = "Attr(" + (index - n).toString() + ")" - or - index = nAttr and result = e.getLabel() and partialPredicateCall = "Label()" - or - index = nLabel and result = e.getLoopBody() and partialPredicateCall = "LoopBody()" - ) - ) - } - private Element getImmediateChildOfMacroExpr(MacroExpr e, int index, string partialPredicateCall) { exists(int b, int bExpr, int n, int nMacroCall | b = 0 and @@ -2748,32 +2691,6 @@ private module Impl { ) } - private Element getImmediateChildOfWhileExpr(WhileExpr e, int index, string partialPredicateCall) { - exists(int b, int bExpr, int n, int nAttr, int nCondition, int nLabel, int nLoopBody | - b = 0 and - bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and - n = bExpr and - nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and - nCondition = nAttr + 1 and - nLabel = nCondition + 1 and - nLoopBody = nLabel + 1 and - ( - none() - or - result = getImmediateChildOfExpr(e, index - b, partialPredicateCall) - or - result = e.getAttr(index - n) and - partialPredicateCall = "Attr(" + (index - n).toString() + ")" - or - index = nAttr and result = e.getCondition() and partialPredicateCall = "Condition()" - or - index = nCondition and result = e.getLabel() and partialPredicateCall = "Label()" - or - index = nLabel and result = e.getLoopBody() and partialPredicateCall = "LoopBody()" - ) - ) - } - private Element getImmediateChildOfWildcardPat( WildcardPat e, int index, string partialPredicateCall ) { @@ -2829,6 +2746,27 @@ private module Impl { ) } + private Element getImmediateChildOfBlockExpr(BlockExpr e, int index, string partialPredicateCall) { + exists(int b, int bLabelableExpr, int n, int nAttr, int nStmtList | + b = 0 and + bLabelableExpr = + b + 1 + max(int i | i = -1 or exists(getImmediateChildOfLabelableExpr(e, i, _)) | i) and + n = bLabelableExpr and + nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and + nStmtList = nAttr + 1 and + ( + none() + or + result = getImmediateChildOfLabelableExpr(e, index - b, partialPredicateCall) + or + result = e.getAttr(index - n) and + partialPredicateCall = "Attr(" + (index - n).toString() + ")" + or + index = nAttr and result = e.getStmtList() and partialPredicateCall = "StmtList()" + ) + ) + } + private Element getImmediateChildOfCallExpr(CallExpr e, int index, string partialPredicateCall) { exists(int b, int bCallExprBase, int n, int nExpr | b = 0 and @@ -3087,6 +3025,25 @@ private module Impl { ) } + private Element getImmediateChildOfLoopingExpr( + LoopingExpr e, int index, string partialPredicateCall + ) { + exists(int b, int bLabelableExpr, int n, int nLoopBody | + b = 0 and + bLabelableExpr = + b + 1 + max(int i | i = -1 or exists(getImmediateChildOfLabelableExpr(e, i, _)) | i) and + n = bLabelableExpr and + nLoopBody = n + 1 and + ( + none() + or + result = getImmediateChildOfLabelableExpr(e, index - b, partialPredicateCall) + or + index = n and result = e.getLoopBody() and partialPredicateCall = "LoopBody()" + ) + ) + } + private Element getImmediateChildOfMacroCall(MacroCall e, int index, string partialPredicateCall) { exists( int b, int bAssocItem, int bExternItem, int bItem, int n, int nAttr, int nPath, @@ -3535,6 +3492,69 @@ private module Impl { ) } + private Element getImmediateChildOfForExpr(ForExpr e, int index, string partialPredicateCall) { + exists(int b, int bLoopingExpr, int n, int nAttr, int nIterable, int nPat | + b = 0 and + bLoopingExpr = + b + 1 + max(int i | i = -1 or exists(getImmediateChildOfLoopingExpr(e, i, _)) | i) and + n = bLoopingExpr and + nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and + nIterable = nAttr + 1 and + nPat = nIterable + 1 and + ( + none() + or + result = getImmediateChildOfLoopingExpr(e, index - b, partialPredicateCall) + or + result = e.getAttr(index - n) and + partialPredicateCall = "Attr(" + (index - n).toString() + ")" + or + index = nAttr and result = e.getIterable() and partialPredicateCall = "Iterable()" + or + index = nIterable and result = e.getPat() and partialPredicateCall = "Pat()" + ) + ) + } + + private Element getImmediateChildOfLoopExpr(LoopExpr e, int index, string partialPredicateCall) { + exists(int b, int bLoopingExpr, int n, int nAttr | + b = 0 and + bLoopingExpr = + b + 1 + max(int i | i = -1 or exists(getImmediateChildOfLoopingExpr(e, i, _)) | i) and + n = bLoopingExpr and + nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and + ( + none() + or + result = getImmediateChildOfLoopingExpr(e, index - b, partialPredicateCall) + or + result = e.getAttr(index - n) and + partialPredicateCall = "Attr(" + (index - n).toString() + ")" + ) + ) + } + + private Element getImmediateChildOfWhileExpr(WhileExpr e, int index, string partialPredicateCall) { + exists(int b, int bLoopingExpr, int n, int nAttr, int nCondition | + b = 0 and + bLoopingExpr = + b + 1 + max(int i | i = -1 or exists(getImmediateChildOfLoopingExpr(e, i, _)) | i) and + n = bLoopingExpr and + nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and + nCondition = nAttr + 1 and + ( + none() + or + result = getImmediateChildOfLoopingExpr(e, index - b, partialPredicateCall) + or + result = e.getAttr(index - n) and + partialPredicateCall = "Attr(" + (index - n).toString() + ")" + or + index = nAttr and result = e.getCondition() and partialPredicateCall = "Condition()" + ) + ) + } + cached Element getImmediateChild(Element e, int index, string partialAccessor) { // why does this look more complicated than it should? @@ -3655,8 +3675,6 @@ private module Impl { or result = getImmediateChildOfBinaryExpr(e, index, partialAccessor) or - result = getImmediateChildOfBlockExpr(e, index, partialAccessor) - or result = getImmediateChildOfBoxPat(e, index, partialAccessor) or result = getImmediateChildOfBreakExpr(e, index, partialAccessor) @@ -3683,8 +3701,6 @@ private module Impl { or result = getImmediateChildOfFnPtrType(e, index, partialAccessor) or - result = getImmediateChildOfForExpr(e, index, partialAccessor) - or result = getImmediateChildOfForType(e, index, partialAccessor) or result = getImmediateChildOfFormatArgsExpr(e, index, partialAccessor) @@ -3711,8 +3727,6 @@ private module Impl { or result = getImmediateChildOfLiteralPat(e, index, partialAccessor) or - result = getImmediateChildOfLoopExpr(e, index, partialAccessor) - or result = getImmediateChildOfMacroExpr(e, index, partialAccessor) or result = getImmediateChildOfMacroPat(e, index, partialAccessor) @@ -3785,14 +3799,14 @@ private module Impl { or result = getImmediateChildOfUnderscoreExpr(e, index, partialAccessor) or - result = getImmediateChildOfWhileExpr(e, index, partialAccessor) - or result = getImmediateChildOfWildcardPat(e, index, partialAccessor) or result = getImmediateChildOfYeetExpr(e, index, partialAccessor) or result = getImmediateChildOfYieldExpr(e, index, partialAccessor) or + result = getImmediateChildOfBlockExpr(e, index, partialAccessor) + or result = getImmediateChildOfCallExpr(e, index, partialAccessor) or result = getImmediateChildOfConst(e, index, partialAccessor) @@ -3834,6 +3848,12 @@ private module Impl { result = getImmediateChildOfUnion(e, index, partialAccessor) or result = getImmediateChildOfUse(e, index, partialAccessor) + or + result = getImmediateChildOfForExpr(e, index, partialAccessor) + or + result = getImmediateChildOfLoopExpr(e, index, partialAccessor) + or + result = getImmediateChildOfWhileExpr(e, index, partialAccessor) } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll index 25af8ddac644..dc9f577bffc5 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll @@ -1366,70 +1366,6 @@ module Raw { Expr getRhs() { binary_expr_rhs(this, result) } } - /** - * INTERNAL: Do not use. - * A block expression. For example: - * ```rust - * { - * let x = 42; - * } - * ``` - * ```rust - * 'label: { - * let x = 42; - * x - * } - * ``` - */ - class BlockExpr extends @block_expr, Expr { - override string toString() { result = "BlockExpr" } - - /** - * Gets the `index`th attr of this block expression (0-based). - */ - Attr getAttr(int index) { block_expr_attrs(this, index, result) } - - /** - * Holds if this block expression is async. - */ - predicate isAsync() { block_expr_is_async(this) } - - /** - * Holds if this block expression is const. - */ - predicate isConst() { block_expr_is_const(this) } - - /** - * Holds if this block expression is gen. - */ - predicate isGen() { block_expr_is_gen(this) } - - /** - * Holds if this block expression is move. - */ - predicate isMove() { block_expr_is_move(this) } - - /** - * Holds if this block expression is try. - */ - predicate isTry() { block_expr_is_try(this) } - - /** - * Holds if this block expression is unsafe. - */ - predicate isUnsafe() { block_expr_is_unsafe(this) } - - /** - * Gets the label of this block expression, if it exists. - */ - Label getLabel() { block_expr_labels(this, result) } - - /** - * Gets the statement list of this block expression, if it exists. - */ - StmtList getStmtList() { block_expr_stmt_lists(this, result) } - } - /** * INTERNAL: Do not use. * A box pattern. For example: @@ -1824,42 +1760,6 @@ module Raw { RetType getRetType() { fn_ptr_type_ret_types(this, result) } } - /** - * INTERNAL: Do not use. - * A ForExpr. For example: - * ```rust - * todo!() - * ``` - */ - class ForExpr extends @for_expr, Expr { - override string toString() { result = "ForExpr" } - - /** - * Gets the `index`th attr of this for expression (0-based). - */ - Attr getAttr(int index) { for_expr_attrs(this, index, result) } - - /** - * Gets the iterable of this for expression, if it exists. - */ - Expr getIterable() { for_expr_iterables(this, result) } - - /** - * Gets the label of this for expression, if it exists. - */ - Label getLabel() { for_expr_labels(this, result) } - - /** - * Gets the loop body of this for expression, if it exists. - */ - BlockExpr getLoopBody() { for_expr_loop_bodies(this, result) } - - /** - * Gets the pat of this for expression, if it exists. - */ - Pat getPat() { for_expr_pats(this, result) } - } - /** * INTERNAL: Do not use. * A ForType. For example: @@ -2071,6 +1971,17 @@ module Raw { string getCrateOrigin() { item_crate_origins(this, result) } } + /** + * INTERNAL: Do not use. + * The base class for expressions that can be labeled (`LoopExpr`, `ForExpr`, `WhileExpr` or `BlockExpr`). + */ + class LabelableExpr extends @labelable_expr, Expr { + /** + * Gets the label of this labelable expression, if it exists. + */ + Label getLabel() { labelable_expr_labels(this, result) } + } + /** * INTERNAL: Do not use. * A `let` expression. For example: @@ -2231,50 +2142,6 @@ module Raw { LiteralExpr getLiteral() { literal_pat_literals(this, result) } } - /** - * INTERNAL: Do not use. - * A loop expression. For example: - * ```rust - * loop { - * println!("Hello, world (again)!"); - * }; - * ``` - * ```rust - * 'label: loop { - * println!("Hello, world (once)!"); - * break 'label; - * }; - * ``` - * ```rust - * let mut x = 0; - * loop { - * if x < 10 { - * x += 1; - * } else { - * break; - * } - * }; - * ``` - */ - class LoopExpr extends @loop_expr, Expr { - override string toString() { result = "LoopExpr" } - - /** - * Gets the `index`th attr of this loop expression (0-based). - */ - Attr getAttr(int index) { loop_expr_attrs(this, index, result) } - - /** - * Gets the label of this loop expression, if it exists. - */ - Label getLabel() { loop_expr_labels(this, result) } - - /** - * Gets the loop body of this loop expression, if it exists. - */ - BlockExpr getLoopBody() { loop_expr_loop_bodies(this, result) } - } - /** * INTERNAL: Do not use. * A MacroExpr. For example: @@ -3063,37 +2930,6 @@ module Raw { Attr getAttr(int index) { underscore_expr_attrs(this, index, result) } } - /** - * INTERNAL: Do not use. - * A WhileExpr. For example: - * ```rust - * todo!() - * ``` - */ - class WhileExpr extends @while_expr, Expr { - override string toString() { result = "WhileExpr" } - - /** - * Gets the `index`th attr of this while expression (0-based). - */ - Attr getAttr(int index) { while_expr_attrs(this, index, result) } - - /** - * Gets the condition of this while expression, if it exists. - */ - Expr getCondition() { while_expr_conditions(this, result) } - - /** - * Gets the label of this while expression, if it exists. - */ - Label getLabel() { while_expr_labels(this, result) } - - /** - * Gets the loop body of this while expression, if it exists. - */ - BlockExpr getLoopBody() { while_expr_loop_bodies(this, result) } - } - /** * INTERNAL: Do not use. * A wildcard pattern. For example: @@ -3152,6 +2988,65 @@ module Raw { Expr getExpr() { yield_expr_exprs(this, result) } } + /** + * INTERNAL: Do not use. + * A block expression. For example: + * ```rust + * { + * let x = 42; + * } + * ``` + * ```rust + * 'label: { + * let x = 42; + * x + * } + * ``` + */ + class BlockExpr extends @block_expr, LabelableExpr { + override string toString() { result = "BlockExpr" } + + /** + * Gets the `index`th attr of this block expression (0-based). + */ + Attr getAttr(int index) { block_expr_attrs(this, index, result) } + + /** + * Holds if this block expression is async. + */ + predicate isAsync() { block_expr_is_async(this) } + + /** + * Holds if this block expression is const. + */ + predicate isConst() { block_expr_is_const(this) } + + /** + * Holds if this block expression is gen. + */ + predicate isGen() { block_expr_is_gen(this) } + + /** + * Holds if this block expression is move. + */ + predicate isMove() { block_expr_is_move(this) } + + /** + * Holds if this block expression is try. + */ + predicate isTry() { block_expr_is_try(this) } + + /** + * Holds if this block expression is unsafe. + */ + predicate isUnsafe() { block_expr_is_unsafe(this) } + + /** + * Gets the statement list of this block expression, if it exists. + */ + StmtList getStmtList() { block_expr_stmt_lists(this, result) } + } + /** * INTERNAL: Do not use. * A function call expression. For example: @@ -3458,6 +3353,17 @@ module Raw { WhereClause getWhereClause() { impl_where_clauses(this, result) } } + /** + * INTERNAL: Do not use. + * The base class for expressions that loop (`LoopExpr`, `ForExpr` or `WhileExpr`). + */ + class LoopingExpr extends @looping_expr, LabelableExpr { + /** + * Gets the loop body of this looping expression, if it exists. + */ + BlockExpr getLoopBody() { looping_expr_loop_bodies(this, result) } + } + /** * INTERNAL: Do not use. * A MacroCall. For example: @@ -3950,4 +3856,85 @@ module Raw { */ Visibility getVisibility() { use_visibilities(this, result) } } + + /** + * INTERNAL: Do not use. + * A ForExpr. For example: + * ```rust + * todo!() + * ``` + */ + class ForExpr extends @for_expr, LoopingExpr { + override string toString() { result = "ForExpr" } + + /** + * Gets the `index`th attr of this for expression (0-based). + */ + Attr getAttr(int index) { for_expr_attrs(this, index, result) } + + /** + * Gets the iterable of this for expression, if it exists. + */ + Expr getIterable() { for_expr_iterables(this, result) } + + /** + * Gets the pat of this for expression, if it exists. + */ + Pat getPat() { for_expr_pats(this, result) } + } + + /** + * INTERNAL: Do not use. + * A loop expression. For example: + * ```rust + * loop { + * println!("Hello, world (again)!"); + * }; + * ``` + * ```rust + * 'label: loop { + * println!("Hello, world (once)!"); + * break 'label; + * }; + * ``` + * ```rust + * let mut x = 0; + * loop { + * if x < 10 { + * x += 1; + * } else { + * break; + * } + * }; + * ``` + */ + class LoopExpr extends @loop_expr, LoopingExpr { + override string toString() { result = "LoopExpr" } + + /** + * Gets the `index`th attr of this loop expression (0-based). + */ + Attr getAttr(int index) { loop_expr_attrs(this, index, result) } + } + + /** + * INTERNAL: Do not use. + * A WhileExpr. For example: + * ```rust + * todo!() + * ``` + */ + class WhileExpr extends @while_expr, LoopingExpr { + override string toString() { result = "WhileExpr" } + + /** + * Gets the `index`th attr of this while expression (0-based). + */ + Attr getAttr(int index) { while_expr_attrs(this, index, result) } + + /** + * Gets the condition of this while expression, if it exists. + */ + Expr getCondition() { while_expr_conditions(this, result) } + } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll index 927ba1f238d8..dda242ffdf93 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll @@ -645,12 +645,12 @@ module Synth { * INTERNAL: Do not use. */ class TExpr = - TArrayExpr or TAsmExpr or TAwaitExpr or TBecomeExpr or TBinaryExpr or TBlockExpr or - TBreakExpr or TCallExprBase or TCastExpr or TClosureExpr or TContinueExpr or TFieldExpr or - TForExpr or TFormatArgsExpr or TIfExpr or TIndexExpr or TLetExpr or TLiteralExpr or - TLoopExpr or TMacroExpr or TMatchExpr or TOffsetOfExpr or TParenExpr or TPathExprBase or - TPrefixExpr or TRangeExpr or TRecordExpr or TRefExpr or TReturnExpr or TTryExpr or - TTupleExpr or TUnderscoreExpr or TWhileExpr or TYeetExpr or TYieldExpr; + TArrayExpr or TAsmExpr or TAwaitExpr or TBecomeExpr or TBinaryExpr or TBreakExpr or + TCallExprBase or TCastExpr or TClosureExpr or TContinueExpr or TFieldExpr or + TFormatArgsExpr or TIfExpr or TIndexExpr or TLabelableExpr or TLetExpr or TLiteralExpr or + TMacroExpr or TMatchExpr or TOffsetOfExpr or TParenExpr or TPathExprBase or TPrefixExpr or + TRangeExpr or TRecordExpr or TRefExpr or TReturnExpr or TTryExpr or TTupleExpr or + TUnderscoreExpr or TYeetExpr or TYieldExpr; /** * INTERNAL: Do not use. @@ -680,11 +680,21 @@ module Synth { TMacroDef or TMacroRules or TModule or TStatic or TStruct or TTrait or TTraitAlias or TTypeAlias or TUnion or TUse; + /** + * INTERNAL: Do not use. + */ + class TLabelableExpr = TBlockExpr or TLoopingExpr; + /** * INTERNAL: Do not use. */ class TLocatable = TAstNode or TFormat or TFormatArgument; + /** + * INTERNAL: Do not use. + */ + class TLoopingExpr = TForExpr or TLoopExpr or TWhileExpr; + /** * INTERNAL: Do not use. */ @@ -1795,8 +1805,6 @@ module Synth { or result = convertBinaryExprFromRaw(e) or - result = convertBlockExprFromRaw(e) - or result = convertBreakExprFromRaw(e) or result = convertCallExprBaseFromRaw(e) @@ -1809,20 +1817,18 @@ module Synth { or result = convertFieldExprFromRaw(e) or - result = convertForExprFromRaw(e) - or result = convertFormatArgsExprFromRaw(e) or result = convertIfExprFromRaw(e) or result = convertIndexExprFromRaw(e) or + result = convertLabelableExprFromRaw(e) + or result = convertLetExprFromRaw(e) or result = convertLiteralExprFromRaw(e) or - result = convertLoopExprFromRaw(e) - or result = convertMacroExprFromRaw(e) or result = convertMatchExprFromRaw(e) @@ -1849,8 +1855,6 @@ module Synth { or result = convertUnderscoreExprFromRaw(e) or - result = convertWhileExprFromRaw(e) - or result = convertYeetExprFromRaw(e) or result = convertYieldExprFromRaw(e) @@ -1946,6 +1950,16 @@ module Synth { result = convertUseFromRaw(e) } + /** + * INTERNAL: Do not use. + * Converts a raw DB element to a synthesized `TLabelableExpr`, if possible. + */ + TLabelableExpr convertLabelableExprFromRaw(Raw::Element e) { + result = convertBlockExprFromRaw(e) + or + result = convertLoopingExprFromRaw(e) + } + /** * INTERNAL: Do not use. * Converts a raw DB element to a synthesized `TLocatable`, if possible. @@ -1958,6 +1972,18 @@ module Synth { result = convertFormatArgumentFromRaw(e) } + /** + * INTERNAL: Do not use. + * Converts a raw DB element to a synthesized `TLoopingExpr`, if possible. + */ + TLoopingExpr convertLoopingExprFromRaw(Raw::Element e) { + result = convertForExprFromRaw(e) + or + result = convertLoopExprFromRaw(e) + or + result = convertWhileExprFromRaw(e) + } + /** * INTERNAL: Do not use. * Converts a raw DB element to a synthesized `TPat`, if possible. @@ -3145,8 +3171,6 @@ module Synth { or result = convertBinaryExprToRaw(e) or - result = convertBlockExprToRaw(e) - or result = convertBreakExprToRaw(e) or result = convertCallExprBaseToRaw(e) @@ -3159,20 +3183,18 @@ module Synth { or result = convertFieldExprToRaw(e) or - result = convertForExprToRaw(e) - or result = convertFormatArgsExprToRaw(e) or result = convertIfExprToRaw(e) or result = convertIndexExprToRaw(e) or + result = convertLabelableExprToRaw(e) + or result = convertLetExprToRaw(e) or result = convertLiteralExprToRaw(e) or - result = convertLoopExprToRaw(e) - or result = convertMacroExprToRaw(e) or result = convertMatchExprToRaw(e) @@ -3199,8 +3221,6 @@ module Synth { or result = convertUnderscoreExprToRaw(e) or - result = convertWhileExprToRaw(e) - or result = convertYeetExprToRaw(e) or result = convertYieldExprToRaw(e) @@ -3296,6 +3316,16 @@ module Synth { result = convertUseToRaw(e) } + /** + * INTERNAL: Do not use. + * Converts a synthesized `TLabelableExpr` to a raw DB element, if possible. + */ + Raw::Element convertLabelableExprToRaw(TLabelableExpr e) { + result = convertBlockExprToRaw(e) + or + result = convertLoopingExprToRaw(e) + } + /** * INTERNAL: Do not use. * Converts a synthesized `TLocatable` to a raw DB element, if possible. @@ -3308,6 +3338,18 @@ module Synth { result = convertFormatArgumentToRaw(e) } + /** + * INTERNAL: Do not use. + * Converts a synthesized `TLoopingExpr` to a raw DB element, if possible. + */ + Raw::Element convertLoopingExprToRaw(TLoopingExpr e) { + result = convertForExprToRaw(e) + or + result = convertLoopExprToRaw(e) + or + result = convertWhileExprToRaw(e) + } + /** * INTERNAL: Do not use. * Converts a synthesized `TPat` to a raw DB element, if possible. diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/WhileExpr.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/WhileExpr.qll index 5cd48bb25063..fa4a4aee65c5 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/WhileExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/WhileExpr.qll @@ -7,10 +7,8 @@ private import codeql.rust.elements.internal.generated.Synth private import codeql.rust.elements.internal.generated.Raw import codeql.rust.elements.Attr -import codeql.rust.elements.BlockExpr import codeql.rust.elements.Expr -import codeql.rust.elements.internal.ExprImpl::Impl as ExprImpl -import codeql.rust.elements.Label +import codeql.rust.elements.internal.LoopingExprImpl::Impl as LoopingExprImpl /** * INTERNAL: This module contains the fully generated definition of `WhileExpr` and should not @@ -25,7 +23,7 @@ module Generated { * INTERNAL: Do not reference the `Generated::WhileExpr` class directly. * Use the subclass `WhileExpr`, where the following predicates are available. */ - class WhileExpr extends Synth::TWhileExpr, ExprImpl::Expr { + class WhileExpr extends Synth::TWhileExpr, LoopingExprImpl::LoopingExpr { override string getAPrimaryQlClass() { result = "WhileExpr" } /** @@ -58,33 +56,5 @@ module Generated { * Holds if `getCondition()` exists. */ final predicate hasCondition() { exists(this.getCondition()) } - - /** - * Gets the label of this while expression, if it exists. - */ - Label getLabel() { - result = - Synth::convertLabelFromRaw(Synth::convertWhileExprToRaw(this).(Raw::WhileExpr).getLabel()) - } - - /** - * Holds if `getLabel()` exists. - */ - final predicate hasLabel() { exists(this.getLabel()) } - - /** - * Gets the loop body of this while expression, if it exists. - */ - BlockExpr getLoopBody() { - result = - Synth::convertBlockExprFromRaw(Synth::convertWhileExprToRaw(this) - .(Raw::WhileExpr) - .getLoopBody()) - } - - /** - * Holds if `getLoopBody()` exists. - */ - final predicate hasLoopBody() { exists(this.getLoopBody()) } } } diff --git a/rust/ql/lib/rust.dbscheme b/rust/ql/lib/rust.dbscheme index 666a1e2b0e16..c9933b5b5e33 100644 --- a/rust/ql/lib/rust.dbscheme +++ b/rust/ql/lib/rust.dbscheme @@ -292,20 +292,18 @@ closure_binder_generic_param_lists( | @await_expr | @become_expr | @binary_expr -| @block_expr | @break_expr | @call_expr_base | @cast_expr | @closure_expr | @continue_expr | @field_expr -| @for_expr | @format_args_expr | @if_expr | @index_expr +| @labelable_expr | @let_expr | @literal_expr -| @loop_expr | @macro_expr | @match_expr | @offset_of_expr @@ -319,7 +317,6 @@ closure_binder_generic_param_lists( | @try_expr | @tuple_expr | @underscore_expr -| @while_expr | @yeet_expr | @yield_expr ; @@ -1314,59 +1311,6 @@ binary_expr_rhs( int rhs: @expr ref ); -block_exprs( - unique int id: @block_expr -); - -#keyset[id, index] -block_expr_attrs( - int id: @block_expr ref, - int index: int ref, - int attr: @attr ref -); - -#keyset[id] -block_expr_is_async( - int id: @block_expr ref -); - -#keyset[id] -block_expr_is_const( - int id: @block_expr ref -); - -#keyset[id] -block_expr_is_gen( - int id: @block_expr ref -); - -#keyset[id] -block_expr_is_move( - int id: @block_expr ref -); - -#keyset[id] -block_expr_is_try( - int id: @block_expr ref -); - -#keyset[id] -block_expr_is_unsafe( - int id: @block_expr ref -); - -#keyset[id] -block_expr_labels( - int id: @block_expr ref, - int label: @label ref -); - -#keyset[id] -block_expr_stmt_lists( - int id: @block_expr ref, - int stmt_list: @stmt_list ref -); - box_pats( unique int id: @box_pat ); @@ -1650,41 +1594,6 @@ fn_ptr_type_ret_types( int ret_type: @ret_type ref ); -for_exprs( - unique int id: @for_expr -); - -#keyset[id, index] -for_expr_attrs( - int id: @for_expr ref, - int index: int ref, - int attr: @attr ref -); - -#keyset[id] -for_expr_iterables( - int id: @for_expr ref, - int iterable: @expr ref -); - -#keyset[id] -for_expr_labels( - int id: @for_expr ref, - int label: @label ref -); - -#keyset[id] -for_expr_loop_bodies( - int id: @for_expr ref, - int loop_body: @block_expr ref -); - -#keyset[id] -for_expr_pats( - int id: @for_expr ref, - int pat: @pat ref -); - for_types( unique int id: @for_type ); @@ -1856,6 +1765,17 @@ item_crate_origins( string crate_origin: string ref ); +@labelable_expr = + @block_expr +| @looping_expr +; + +#keyset[id] +labelable_expr_labels( + int id: @labelable_expr ref, + int label: @label ref +); + let_exprs( unique int id: @let_expr ); @@ -1974,29 +1894,6 @@ literal_pat_literals( int literal: @literal_expr ref ); -loop_exprs( - unique int id: @loop_expr -); - -#keyset[id, index] -loop_expr_attrs( - int id: @loop_expr ref, - int index: int ref, - int attr: @attr ref -); - -#keyset[id] -loop_expr_labels( - int id: @loop_expr ref, - int label: @label ref -); - -#keyset[id] -loop_expr_loop_bodies( - int id: @loop_expr ref, - int loop_body: @block_expr ref -); - macro_exprs( unique int id: @macro_expr ); @@ -2555,35 +2452,6 @@ underscore_expr_attrs( int attr: @attr ref ); -while_exprs( - unique int id: @while_expr -); - -#keyset[id, index] -while_expr_attrs( - int id: @while_expr ref, - int index: int ref, - int attr: @attr ref -); - -#keyset[id] -while_expr_conditions( - int id: @while_expr ref, - int condition: @expr ref -); - -#keyset[id] -while_expr_labels( - int id: @while_expr ref, - int label: @label ref -); - -#keyset[id] -while_expr_loop_bodies( - int id: @while_expr ref, - int loop_body: @block_expr ref -); - wildcard_pats( unique int id: @wildcard_pat ); @@ -2622,6 +2490,53 @@ yield_expr_exprs( int expr: @expr ref ); +block_exprs( + unique int id: @block_expr +); + +#keyset[id, index] +block_expr_attrs( + int id: @block_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +block_expr_is_async( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_const( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_gen( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_move( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_try( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_unsafe( + int id: @block_expr ref +); + +#keyset[id] +block_expr_stmt_lists( + int id: @block_expr ref, + int stmt_list: @stmt_list ref +); + call_exprs( unique int id: @call_expr ); @@ -2908,6 +2823,18 @@ impl_where_clauses( int where_clause: @where_clause ref ); +@looping_expr = + @for_expr +| @loop_expr +| @while_expr +; + +#keyset[id] +looping_expr_loop_bodies( + int id: @looping_expr ref, + int loop_body: @block_expr ref +); + macro_calls( unique int id: @macro_call ); @@ -3368,3 +3295,54 @@ use_visibilities( int id: @use ref, int visibility: @visibility ref ); + +for_exprs( + unique int id: @for_expr +); + +#keyset[id, index] +for_expr_attrs( + int id: @for_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +for_expr_iterables( + int id: @for_expr ref, + int iterable: @expr ref +); + +#keyset[id] +for_expr_pats( + int id: @for_expr ref, + int pat: @pat ref +); + +loop_exprs( + unique int id: @loop_expr +); + +#keyset[id, index] +loop_expr_attrs( + int id: @loop_expr ref, + int index: int ref, + int attr: @attr ref +); + +while_exprs( + unique int id: @while_expr +); + +#keyset[id, index] +while_expr_attrs( + int id: @while_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +while_expr_conditions( + int id: @while_expr ref, + int condition: @expr ref +); diff --git a/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr.ql b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr.ql index 581070545155..992c06a605b6 100644 --- a/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr.ql +++ b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr.ql @@ -3,11 +3,12 @@ import codeql.rust.elements import TestUtils from - BlockExpr x, int getNumberOfAttrs, string isAsync, string isConst, string isGen, string isMove, - string isTry, string isUnsafe, string hasLabel, string hasStmtList + BlockExpr x, string hasLabel, int getNumberOfAttrs, string isAsync, string isConst, string isGen, + string isMove, string isTry, string isUnsafe, string hasStmtList where toBeTested(x) and not x.isUnknown() and + (if x.hasLabel() then hasLabel = "yes" else hasLabel = "no") and getNumberOfAttrs = x.getNumberOfAttrs() and (if x.isAsync() then isAsync = "yes" else isAsync = "no") and (if x.isConst() then isConst = "yes" else isConst = "no") and @@ -15,8 +16,7 @@ where (if x.isMove() then isMove = "yes" else isMove = "no") and (if x.isTry() then isTry = "yes" else isTry = "no") and (if x.isUnsafe() then isUnsafe = "yes" else isUnsafe = "no") and - (if x.hasLabel() then hasLabel = "yes" else hasLabel = "no") and if x.hasStmtList() then hasStmtList = "yes" else hasStmtList = "no" -select x, "getNumberOfAttrs:", getNumberOfAttrs, "isAsync:", isAsync, "isConst:", isConst, "isGen:", - isGen, "isMove:", isMove, "isTry:", isTry, "isUnsafe:", isUnsafe, "hasLabel:", hasLabel, +select x, "hasLabel:", hasLabel, "getNumberOfAttrs:", getNumberOfAttrs, "isAsync:", isAsync, + "isConst:", isConst, "isGen:", isGen, "isMove:", isMove, "isTry:", isTry, "isUnsafe:", isUnsafe, "hasStmtList:", hasStmtList diff --git a/rust/ql/test/extractor-tests/generated/ForExpr/ForExpr.ql b/rust/ql/test/extractor-tests/generated/ForExpr/ForExpr.ql index ef1999ff4a9d..60f5ab1e0809 100644 --- a/rust/ql/test/extractor-tests/generated/ForExpr/ForExpr.ql +++ b/rust/ql/test/extractor-tests/generated/ForExpr/ForExpr.ql @@ -3,15 +3,15 @@ import codeql.rust.elements import TestUtils from - ForExpr x, int getNumberOfAttrs, string hasIterable, string hasLabel, string hasLoopBody, + ForExpr x, string hasLabel, string hasLoopBody, int getNumberOfAttrs, string hasIterable, string hasPat where toBeTested(x) and not x.isUnknown() and - getNumberOfAttrs = x.getNumberOfAttrs() and - (if x.hasIterable() then hasIterable = "yes" else hasIterable = "no") and (if x.hasLabel() then hasLabel = "yes" else hasLabel = "no") and (if x.hasLoopBody() then hasLoopBody = "yes" else hasLoopBody = "no") and + getNumberOfAttrs = x.getNumberOfAttrs() and + (if x.hasIterable() then hasIterable = "yes" else hasIterable = "no") and if x.hasPat() then hasPat = "yes" else hasPat = "no" -select x, "getNumberOfAttrs:", getNumberOfAttrs, "hasIterable:", hasIterable, "hasLabel:", hasLabel, - "hasLoopBody:", hasLoopBody, "hasPat:", hasPat +select x, "hasLabel:", hasLabel, "hasLoopBody:", hasLoopBody, "getNumberOfAttrs:", getNumberOfAttrs, + "hasIterable:", hasIterable, "hasPat:", hasPat diff --git a/rust/ql/test/extractor-tests/generated/LoopExpr/LoopExpr.ql b/rust/ql/test/extractor-tests/generated/LoopExpr/LoopExpr.ql index c627fb16771a..92248ab5ec07 100644 --- a/rust/ql/test/extractor-tests/generated/LoopExpr/LoopExpr.ql +++ b/rust/ql/test/extractor-tests/generated/LoopExpr/LoopExpr.ql @@ -2,11 +2,11 @@ import codeql.rust.elements import TestUtils -from LoopExpr x, int getNumberOfAttrs, string hasLabel, string hasLoopBody +from LoopExpr x, string hasLabel, string hasLoopBody, int getNumberOfAttrs where toBeTested(x) and not x.isUnknown() and - getNumberOfAttrs = x.getNumberOfAttrs() and (if x.hasLabel() then hasLabel = "yes" else hasLabel = "no") and - if x.hasLoopBody() then hasLoopBody = "yes" else hasLoopBody = "no" -select x, "getNumberOfAttrs:", getNumberOfAttrs, "hasLabel:", hasLabel, "hasLoopBody:", hasLoopBody + (if x.hasLoopBody() then hasLoopBody = "yes" else hasLoopBody = "no") and + getNumberOfAttrs = x.getNumberOfAttrs() +select x, "hasLabel:", hasLabel, "hasLoopBody:", hasLoopBody, "getNumberOfAttrs:", getNumberOfAttrs diff --git a/rust/ql/test/extractor-tests/generated/WhileExpr/WhileExpr.ql b/rust/ql/test/extractor-tests/generated/WhileExpr/WhileExpr.ql index ceb095e9d201..8544014e571a 100644 --- a/rust/ql/test/extractor-tests/generated/WhileExpr/WhileExpr.ql +++ b/rust/ql/test/extractor-tests/generated/WhileExpr/WhileExpr.ql @@ -2,13 +2,13 @@ import codeql.rust.elements import TestUtils -from WhileExpr x, int getNumberOfAttrs, string hasCondition, string hasLabel, string hasLoopBody +from WhileExpr x, string hasLabel, string hasLoopBody, int getNumberOfAttrs, string hasCondition where toBeTested(x) and not x.isUnknown() and - getNumberOfAttrs = x.getNumberOfAttrs() and - (if x.hasCondition() then hasCondition = "yes" else hasCondition = "no") and (if x.hasLabel() then hasLabel = "yes" else hasLabel = "no") and - if x.hasLoopBody() then hasLoopBody = "yes" else hasLoopBody = "no" -select x, "getNumberOfAttrs:", getNumberOfAttrs, "hasCondition:", hasCondition, "hasLabel:", - hasLabel, "hasLoopBody:", hasLoopBody + (if x.hasLoopBody() then hasLoopBody = "yes" else hasLoopBody = "no") and + getNumberOfAttrs = x.getNumberOfAttrs() and + if x.hasCondition() then hasCondition = "yes" else hasCondition = "no" +select x, "hasLabel:", hasLabel, "hasLoopBody:", hasLoopBody, "getNumberOfAttrs:", getNumberOfAttrs, + "hasCondition:", hasCondition diff --git a/rust/ql/test/library-tests/controlflow/Cfg.expected b/rust/ql/test/library-tests/controlflow/Cfg.expected index 6260c2328a6e..b7cb71bacfb3 100644 --- a/rust/ql/test/library-tests/controlflow/Cfg.expected +++ b/rust/ql/test/library-tests/controlflow/Cfg.expected @@ -11,10 +11,10 @@ edges | test.rs:7:9:7:19 | method_call | test.rs:7:9:7:21 | method_call(...) | | | test.rs:7:9:7:21 | method_call(...) | test.rs:5:24:8:5 | { ... } | | | test.rs:7:9:7:22 | ExprStmt | test.rs:7:9:7:19 | method_call | | -| test.rs:10:5:13:5 | enter fn method_call | test.rs:11:9:11:37 | let map = ... | | +| test.rs:10:5:13:5 | enter fn method_call | test.rs:11:9:11:37 | let ... = ... | | | test.rs:10:5:13:5 | exit fn method_call (normal) | test.rs:10:5:13:5 | exit fn method_call | | | test.rs:10:22:13:5 | { ... } | test.rs:10:5:13:5 | exit fn method_call (normal) | | -| test.rs:11:9:11:37 | let map = ... | test.rs:11:23:11:34 | HashMap::new | | +| test.rs:11:9:11:37 | let ... = ... | test.rs:11:23:11:34 | HashMap::new | | | test.rs:11:13:11:19 | map | test.rs:12:9:12:28 | ExprStmt | match | | test.rs:11:23:11:34 | HashMap::new | test.rs:11:23:11:36 | HashMap::new(...) | | | test.rs:11:23:11:36 | HashMap::new(...) | test.rs:11:13:11:19 | map | | @@ -25,21 +25,21 @@ edges | test.rs:12:24:12:26 | "a" | test.rs:12:9:12:27 | ... .insert(...) | | | test.rs:18:5:24:5 | enter fn next | test.rs:18:13:18:13 | n | | | test.rs:18:5:24:5 | exit fn next (normal) | test.rs:18:5:24:5 | exit fn next | | -| test.rs:18:13:18:13 | n | test.rs:18:13:18:18 | n: i64 | match | -| test.rs:18:13:18:18 | n: i64 | test.rs:19:12:19:12 | n | | +| test.rs:18:13:18:13 | n | test.rs:18:13:18:18 | ...: i64 | match | +| test.rs:18:13:18:18 | ...: i64 | test.rs:19:12:19:12 | n | | | test.rs:18:28:24:5 | { ... } | test.rs:18:5:24:5 | exit fn next (normal) | | -| test.rs:19:9:23:9 | if ... { ... } else { ... } | test.rs:18:28:24:5 | { ... } | | +| test.rs:19:9:23:9 | if ... {...} else {...} | test.rs:18:28:24:5 | { ... } | | | test.rs:19:12:19:12 | n | test.rs:19:16:19:16 | 2 | | | test.rs:19:12:19:16 | ... % ... | test.rs:19:21:19:21 | 0 | | | test.rs:19:12:19:21 | ... == ... | test.rs:20:13:20:13 | n | true | | test.rs:19:12:19:21 | ... == ... | test.rs:22:13:22:13 | 3 | false | | test.rs:19:16:19:16 | 2 | test.rs:19:12:19:16 | ... % ... | | | test.rs:19:21:19:21 | 0 | test.rs:19:12:19:21 | ... == ... | | -| test.rs:19:23:21:9 | { ... } | test.rs:19:9:23:9 | if ... { ... } else { ... } | | +| test.rs:19:23:21:9 | { ... } | test.rs:19:9:23:9 | if ... {...} else {...} | | | test.rs:20:13:20:13 | n | test.rs:20:17:20:17 | 2 | | | test.rs:20:13:20:17 | ... / ... | test.rs:19:23:21:9 | { ... } | | | test.rs:20:17:20:17 | 2 | test.rs:20:13:20:17 | ... / ... | | -| test.rs:21:16:23:9 | { ... } | test.rs:19:9:23:9 | if ... { ... } else { ... } | | +| test.rs:21:16:23:9 | { ... } | test.rs:19:9:23:9 | if ... {...} else {...} | | | test.rs:22:13:22:13 | 3 | test.rs:22:17:22:17 | n | | | test.rs:22:13:22:17 | ... * ... | test.rs:22:21:22:21 | 1 | | | test.rs:22:13:22:21 | ... + ... | test.rs:21:16:23:9 | { ... } | | @@ -47,13 +47,13 @@ edges | test.rs:22:21:22:21 | 1 | test.rs:22:13:22:21 | ... + ... | | | test.rs:26:5:42:5 | enter fn test_break_and_continue | test.rs:26:32:26:32 | n | | | test.rs:26:5:42:5 | exit fn test_break_and_continue (normal) | test.rs:26:5:42:5 | exit fn test_break_and_continue | | -| test.rs:26:32:26:32 | n | test.rs:26:32:26:37 | n: i64 | match | -| test.rs:26:32:26:37 | n: i64 | test.rs:27:9:27:22 | let i = ... | | -| test.rs:27:9:27:22 | let i = ... | test.rs:27:21:27:21 | n | | +| test.rs:26:32:26:32 | n | test.rs:26:32:26:37 | ...: i64 | match | +| test.rs:26:32:26:37 | ...: i64 | test.rs:27:9:27:22 | let ... = n | | +| test.rs:27:9:27:22 | let ... = n | test.rs:27:21:27:21 | n | | | test.rs:27:13:27:17 | i | test.rs:28:9:40:9 | ExprStmt | match | | test.rs:27:21:27:21 | n | test.rs:27:13:27:17 | i | | | test.rs:28:9:40:9 | ExprStmt | test.rs:29:13:29:24 | ExprStmt | | -| test.rs:28:9:40:9 | loop {...} | test.rs:41:9:41:20 | ExprStmt | | +| test.rs:28:9:40:9 | loop { ... } | test.rs:41:9:41:20 | ExprStmt | | | test.rs:28:14:40:9 | { ... } | test.rs:29:13:29:24 | ExprStmt | | | test.rs:29:13:29:13 | i | test.rs:29:17:29:20 | next | | | test.rs:29:13:29:23 | ... = ... | test.rs:30:13:32:13 | ExprStmt | | @@ -62,27 +62,27 @@ edges | test.rs:29:17:29:23 | next(...) | test.rs:29:13:29:23 | ... = ... | | | test.rs:29:22:29:22 | i | test.rs:29:17:29:23 | next(...) | | | test.rs:30:13:32:13 | ExprStmt | test.rs:30:16:30:16 | i | | -| test.rs:30:13:32:13 | if ... { ... } | test.rs:33:13:35:13 | ExprStmt | | +| test.rs:30:13:32:13 | if ... {...} | test.rs:33:13:35:13 | ExprStmt | | | test.rs:30:16:30:16 | i | test.rs:30:20:30:24 | 10000 | | -| test.rs:30:16:30:24 | ... > ... | test.rs:30:13:32:13 | if ... { ... } | false | +| test.rs:30:16:30:24 | ... > ... | test.rs:30:13:32:13 | if ... {...} | false | | test.rs:30:16:30:24 | ... > ... | test.rs:31:17:31:29 | ExprStmt | true | | test.rs:30:20:30:24 | 10000 | test.rs:30:16:30:24 | ... > ... | | -| test.rs:31:17:31:28 | return ... | test.rs:26:5:42:5 | exit fn test_break_and_continue (normal) | return | +| test.rs:31:17:31:28 | return false | test.rs:26:5:42:5 | exit fn test_break_and_continue (normal) | return | | test.rs:31:17:31:29 | ExprStmt | test.rs:31:24:31:28 | false | | -| test.rs:31:24:31:28 | false | test.rs:31:17:31:28 | return ... | | +| test.rs:31:24:31:28 | false | test.rs:31:17:31:28 | return false | | | test.rs:33:13:35:13 | ExprStmt | test.rs:33:16:33:16 | i | | -| test.rs:33:13:35:13 | if ... { ... } | test.rs:36:13:38:13 | ExprStmt | | +| test.rs:33:13:35:13 | if ... {...} | test.rs:36:13:38:13 | ExprStmt | | | test.rs:33:16:33:16 | i | test.rs:33:21:33:21 | 1 | | -| test.rs:33:16:33:21 | ... == ... | test.rs:33:13:35:13 | if ... { ... } | false | +| test.rs:33:16:33:21 | ... == ... | test.rs:33:13:35:13 | if ... {...} | false | | test.rs:33:16:33:21 | ... == ... | test.rs:34:17:34:22 | ExprStmt | true | | test.rs:33:21:33:21 | 1 | test.rs:33:16:33:21 | ... == ... | | -| test.rs:34:17:34:21 | break | test.rs:28:9:40:9 | loop {...} | break | +| test.rs:34:17:34:21 | break | test.rs:28:9:40:9 | loop { ... } | break | | test.rs:34:17:34:22 | ExprStmt | test.rs:34:17:34:21 | break | | | test.rs:36:13:38:13 | ExprStmt | test.rs:36:16:36:16 | i | | -| test.rs:36:13:38:13 | if ... { ... } | test.rs:39:13:39:13 | i | | +| test.rs:36:13:38:13 | if ... {...} | test.rs:39:13:39:13 | i | | | test.rs:36:16:36:16 | i | test.rs:36:20:36:20 | 2 | | | test.rs:36:16:36:20 | ... % ... | test.rs:36:25:36:25 | 0 | | -| test.rs:36:16:36:25 | ... != ... | test.rs:36:13:38:13 | if ... { ... } | false | +| test.rs:36:16:36:25 | ... != ... | test.rs:36:13:38:13 | if ... {...} | false | | test.rs:36:16:36:25 | ... != ... | test.rs:37:17:37:25 | ExprStmt | true | | test.rs:36:20:36:20 | 2 | test.rs:36:16:36:20 | ... % ... | | | test.rs:36:25:36:25 | 0 | test.rs:36:16:36:25 | ... != ... | | @@ -93,156 +93,156 @@ edges | test.rs:39:17:39:17 | i | test.rs:39:21:39:21 | 2 | | | test.rs:39:17:39:21 | ... / ... | test.rs:39:13:39:21 | ... = ... | | | test.rs:39:21:39:21 | 2 | test.rs:39:17:39:21 | ... / ... | | -| test.rs:41:9:41:19 | return ... | test.rs:26:5:42:5 | exit fn test_break_and_continue (normal) | return | +| test.rs:41:9:41:19 | return true | test.rs:26:5:42:5 | exit fn test_break_and_continue (normal) | return | | test.rs:41:9:41:20 | ExprStmt | test.rs:41:16:41:19 | true | | -| test.rs:41:16:41:19 | true | test.rs:41:9:41:19 | return ... | | +| test.rs:41:16:41:19 | true | test.rs:41:9:41:19 | return true | | | test.rs:44:5:56:5 | enter fn test_break_with_labels | test.rs:44:31:44:31 | b | | | test.rs:44:5:56:5 | exit fn test_break_with_labels (normal) | test.rs:44:5:56:5 | exit fn test_break_with_labels | | -| test.rs:44:31:44:31 | b | test.rs:44:31:44:37 | b: bool | match | -| test.rs:44:31:44:37 | b: bool | test.rs:45:9:54:9 | ExprStmt | | +| test.rs:44:31:44:31 | b | test.rs:44:31:44:37 | ...: bool | match | +| test.rs:44:31:44:37 | ...: bool | test.rs:45:9:54:9 | ExprStmt | | | test.rs:44:48:56:5 | { ... } | test.rs:44:5:56:5 | exit fn test_break_with_labels (normal) | | +| test.rs:45:9:54:9 | ''outer: loop { ... } | test.rs:55:9:55:12 | true | | | test.rs:45:9:54:9 | ExprStmt | test.rs:47:17:51:17 | ExprStmt | | -| test.rs:45:9:54:9 | loop {...} | test.rs:55:9:55:12 | true | | | test.rs:45:22:54:9 | { ... } | test.rs:47:17:51:17 | ExprStmt | | -| test.rs:46:13:53:13 | loop {...} | test.rs:45:22:54:9 | { ... } | | +| test.rs:46:13:53:13 | ''inner: loop { ... } | test.rs:45:22:54:9 | { ... } | | | test.rs:47:17:51:17 | ExprStmt | test.rs:47:20:47:20 | b | | -| test.rs:47:17:51:17 | if ... { ... } else { ... } | test.rs:52:17:52:29 | ExprStmt | | +| test.rs:47:17:51:17 | if b {...} else {...} | test.rs:52:17:52:29 | ExprStmt | | | test.rs:47:20:47:20 | b | test.rs:48:21:48:26 | ExprStmt | true | | test.rs:47:20:47:20 | b | test.rs:49:27:49:27 | b | false | -| test.rs:48:21:48:25 | break | test.rs:46:13:53:13 | loop {...} | break | +| test.rs:48:21:48:25 | break | test.rs:46:13:53:13 | ''inner: loop { ... } | break | | test.rs:48:21:48:26 | ExprStmt | test.rs:48:21:48:25 | break | | -| test.rs:49:24:51:17 | if ... { ... } | test.rs:47:17:51:17 | if ... { ... } else { ... } | | -| test.rs:49:27:49:27 | b | test.rs:49:24:51:17 | if ... { ... } | false | +| test.rs:49:24:51:17 | if b {...} | test.rs:47:17:51:17 | if b {...} else {...} | | +| test.rs:49:27:49:27 | b | test.rs:49:24:51:17 | if b {...} | false | | test.rs:49:27:49:27 | b | test.rs:50:21:50:33 | ExprStmt | true | -| test.rs:50:21:50:32 | break ''outer | test.rs:45:9:54:9 | loop {...} | break | +| test.rs:50:21:50:32 | break ''outer | test.rs:45:9:54:9 | ''outer: loop { ... } | break | | test.rs:50:21:50:33 | ExprStmt | test.rs:50:21:50:32 | break ''outer | | -| test.rs:52:17:52:28 | break ''inner | test.rs:46:13:53:13 | loop {...} | break | +| test.rs:52:17:52:28 | break ''inner | test.rs:46:13:53:13 | ''inner: loop { ... } | break | | test.rs:52:17:52:29 | ExprStmt | test.rs:52:17:52:28 | break ''inner | | | test.rs:55:9:55:12 | true | test.rs:44:48:56:5 | { ... } | | | test.rs:58:5:70:5 | enter fn test_continue_with_labels | test.rs:58:34:58:34 | b | | -| test.rs:58:34:58:34 | b | test.rs:58:34:58:40 | b: bool | match | -| test.rs:58:34:58:40 | b: bool | test.rs:60:13:60:14 | ExprStmt | | +| test.rs:58:34:58:34 | b | test.rs:58:34:58:40 | ...: bool | match | +| test.rs:58:34:58:40 | ...: bool | test.rs:60:13:60:14 | ExprStmt | | | test.rs:60:13:60:13 | 1 | test.rs:62:17:66:17 | ExprStmt | | | test.rs:60:13:60:14 | ExprStmt | test.rs:60:13:60:13 | 1 | | | test.rs:62:17:66:17 | ExprStmt | test.rs:62:20:62:20 | b | | -| test.rs:62:17:66:17 | if ... { ... } else { ... } | test.rs:67:17:67:32 | ExprStmt | | +| test.rs:62:17:66:17 | if b {...} else {...} | test.rs:67:17:67:32 | ExprStmt | | | test.rs:62:20:62:20 | b | test.rs:63:21:63:29 | ExprStmt | true | | test.rs:62:20:62:20 | b | test.rs:64:27:64:27 | b | false | | test.rs:63:21:63:28 | continue | test.rs:62:17:66:17 | ExprStmt | continue | | test.rs:63:21:63:29 | ExprStmt | test.rs:63:21:63:28 | continue | | -| test.rs:64:24:66:17 | if ... { ... } | test.rs:62:17:66:17 | if ... { ... } else { ... } | | -| test.rs:64:27:64:27 | b | test.rs:64:24:66:17 | if ... { ... } | false | +| test.rs:64:24:66:17 | if b {...} | test.rs:62:17:66:17 | if b {...} else {...} | | +| test.rs:64:27:64:27 | b | test.rs:64:24:66:17 | if b {...} | false | | test.rs:64:27:64:27 | b | test.rs:65:21:65:36 | ExprStmt | true | -| test.rs:65:21:65:35 | continue 'outer | test.rs:60:13:60:14 | ExprStmt | continue | -| test.rs:65:21:65:36 | ExprStmt | test.rs:65:21:65:35 | continue 'outer | | -| test.rs:67:17:67:31 | continue 'inner | test.rs:62:17:66:17 | ExprStmt | continue | -| test.rs:67:17:67:32 | ExprStmt | test.rs:67:17:67:31 | continue 'inner | | +| test.rs:65:21:65:35 | continue ''outer | test.rs:60:13:60:14 | ExprStmt | continue | +| test.rs:65:21:65:36 | ExprStmt | test.rs:65:21:65:35 | continue ''outer | | +| test.rs:67:17:67:31 | continue ''inner | test.rs:62:17:66:17 | ExprStmt | continue | +| test.rs:67:17:67:32 | ExprStmt | test.rs:67:17:67:31 | continue ''inner | | | test.rs:72:5:84:5 | enter fn test_loop_label_shadowing | test.rs:72:34:72:34 | b | | -| test.rs:72:34:72:34 | b | test.rs:72:34:72:40 | b: bool | match | -| test.rs:72:34:72:40 | b: bool | test.rs:74:13:74:14 | ExprStmt | | +| test.rs:72:34:72:34 | b | test.rs:72:34:72:40 | ...: bool | match | +| test.rs:72:34:72:40 | ...: bool | test.rs:74:13:74:14 | ExprStmt | | | test.rs:74:13:74:13 | 1 | test.rs:76:17:80:17 | ExprStmt | | | test.rs:74:13:74:14 | ExprStmt | test.rs:74:13:74:13 | 1 | | | test.rs:76:17:80:17 | ExprStmt | test.rs:76:20:76:20 | b | | -| test.rs:76:17:80:17 | if ... { ... } else { ... } | test.rs:81:17:81:32 | ExprStmt | | +| test.rs:76:17:80:17 | if b {...} else {...} | test.rs:81:17:81:32 | ExprStmt | | | test.rs:76:20:76:20 | b | test.rs:77:21:77:29 | ExprStmt | true | | test.rs:76:20:76:20 | b | test.rs:78:27:78:27 | b | false | | test.rs:77:21:77:28 | continue | test.rs:76:17:80:17 | ExprStmt | continue | | test.rs:77:21:77:29 | ExprStmt | test.rs:77:21:77:28 | continue | | -| test.rs:78:24:80:17 | if ... { ... } | test.rs:76:17:80:17 | if ... { ... } else { ... } | | -| test.rs:78:27:78:27 | b | test.rs:78:24:80:17 | if ... { ... } | false | +| test.rs:78:24:80:17 | if b {...} | test.rs:76:17:80:17 | if b {...} else {...} | | +| test.rs:78:27:78:27 | b | test.rs:78:24:80:17 | if b {...} | false | | test.rs:78:27:78:27 | b | test.rs:79:21:79:36 | ExprStmt | true | -| test.rs:79:21:79:35 | continue 'label | test.rs:76:17:80:17 | ExprStmt | continue | -| test.rs:79:21:79:36 | ExprStmt | test.rs:79:21:79:35 | continue 'label | | -| test.rs:81:17:81:31 | continue 'label | test.rs:76:17:80:17 | ExprStmt | continue | -| test.rs:81:17:81:32 | ExprStmt | test.rs:81:17:81:31 | continue 'label | | +| test.rs:79:21:79:35 | continue ''label | test.rs:76:17:80:17 | ExprStmt | continue | +| test.rs:79:21:79:36 | ExprStmt | test.rs:79:21:79:35 | continue ''label | | +| test.rs:81:17:81:31 | continue ''label | test.rs:76:17:80:17 | ExprStmt | continue | +| test.rs:81:17:81:32 | ExprStmt | test.rs:81:17:81:31 | continue ''label | | | test.rs:86:5:95:5 | enter fn test_while | test.rs:86:19:86:19 | i | | | test.rs:86:5:95:5 | exit fn test_while (normal) | test.rs:86:5:95:5 | exit fn test_while | | -| test.rs:86:19:86:19 | i | test.rs:86:19:86:24 | i: i64 | match | -| test.rs:86:19:86:24 | i: i64 | test.rs:87:9:87:25 | let b = ... | | +| test.rs:86:19:86:19 | i | test.rs:86:19:86:24 | ...: i64 | match | +| test.rs:86:19:86:24 | ...: i64 | test.rs:87:9:87:25 | let ... = true | | | test.rs:86:27:95:5 | { ... } | test.rs:86:5:95:5 | exit fn test_while (normal) | | -| test.rs:87:9:87:25 | let b = ... | test.rs:87:21:87:24 | true | | +| test.rs:87:9:87:25 | let ... = true | test.rs:87:21:87:24 | true | | | test.rs:87:13:87:17 | b | test.rs:88:15:88:15 | b | match | | test.rs:87:21:87:24 | true | test.rs:87:13:87:17 | b | | -| test.rs:88:9:94:9 | while ... { ... } | test.rs:86:27:95:5 | { ... } | | -| test.rs:88:15:88:15 | b | test.rs:88:9:94:9 | while ... { ... } | false | +| test.rs:88:9:94:9 | while b { ... } | test.rs:86:27:95:5 | { ... } | | +| test.rs:88:15:88:15 | b | test.rs:88:9:94:9 | while b { ... } | false | | test.rs:88:15:88:15 | b | test.rs:89:13:89:14 | ExprStmt | true | | test.rs:88:17:94:9 | { ... } | test.rs:88:15:88:15 | b | | | test.rs:89:13:89:13 | 1 | test.rs:90:13:92:13 | ExprStmt | | | test.rs:89:13:89:14 | ExprStmt | test.rs:89:13:89:13 | 1 | | | test.rs:90:13:92:13 | ExprStmt | test.rs:90:17:90:17 | i | | -| test.rs:90:13:92:13 | if ... { ... } | test.rs:93:13:93:22 | ExprStmt | | +| test.rs:90:13:92:13 | if ... {...} | test.rs:93:13:93:22 | ExprStmt | | | test.rs:90:17:90:17 | i | test.rs:90:21:90:21 | 0 | | -| test.rs:90:17:90:21 | ... > ... | test.rs:90:13:92:13 | if ... { ... } | false | +| test.rs:90:17:90:21 | ... > ... | test.rs:90:13:92:13 | if ... {...} | false | | test.rs:90:17:90:21 | ... > ... | test.rs:91:17:91:22 | ExprStmt | true | | test.rs:90:21:90:21 | 0 | test.rs:90:17:90:21 | ... > ... | | -| test.rs:91:17:91:21 | break | test.rs:88:9:94:9 | while ... { ... } | break | +| test.rs:91:17:91:21 | break | test.rs:88:9:94:9 | while b { ... } | break | | test.rs:91:17:91:22 | ExprStmt | test.rs:91:17:91:21 | break | | | test.rs:93:13:93:13 | b | test.rs:93:17:93:21 | false | | | test.rs:93:13:93:21 | ... = ... | test.rs:88:17:94:9 | { ... } | | | test.rs:93:13:93:22 | ExprStmt | test.rs:93:13:93:13 | b | | | test.rs:93:17:93:21 | false | test.rs:93:13:93:21 | ... = ... | | -| test.rs:97:5:104:5 | enter fn test_while_let | test.rs:98:9:98:29 | let iter = ... | | +| test.rs:97:5:104:5 | enter fn test_while_let | test.rs:98:9:98:29 | let ... = ... | | | test.rs:97:5:104:5 | exit fn test_while_let (normal) | test.rs:97:5:104:5 | exit fn test_while_let | | | test.rs:97:25:104:5 | { ... } | test.rs:97:5:104:5 | exit fn test_while_let (normal) | | -| test.rs:98:9:98:29 | let iter = ... | test.rs:98:24:98:24 | 1 | | -| test.rs:98:13:98:20 | iter | test.rs:99:15:99:39 | let TupleStructPat = ... | match | +| test.rs:98:9:98:29 | let ... = ... | test.rs:98:24:98:24 | 1 | | +| test.rs:98:13:98:20 | iter | test.rs:99:15:99:39 | let ... = ... | match | | test.rs:98:24:98:24 | 1 | test.rs:98:27:98:28 | 10 | | -| test.rs:98:24:98:28 | ... .. ... | test.rs:98:13:98:20 | iter | | -| test.rs:98:27:98:28 | 10 | test.rs:98:24:98:28 | ... .. ... | | +| test.rs:98:24:98:28 | 1..10 | test.rs:98:13:98:20 | iter | | +| test.rs:98:27:98:28 | 10 | test.rs:98:24:98:28 | 1..10 | | | test.rs:99:9:103:9 | while ... { ... } | test.rs:97:25:104:5 | { ... } | | -| test.rs:99:15:99:39 | let TupleStructPat = ... | test.rs:99:29:99:32 | iter | | +| test.rs:99:15:99:39 | let ... = ... | test.rs:99:29:99:32 | iter | | | test.rs:99:19:99:25 | TupleStructPat | test.rs:99:9:103:9 | while ... { ... } | no-match | | test.rs:99:19:99:25 | TupleStructPat | test.rs:99:24:99:24 | x | match | | test.rs:99:24:99:24 | x | test.rs:100:17:100:17 | x | match | | test.rs:99:29:99:32 | iter | test.rs:99:29:99:39 | ... .next(...) | | | test.rs:99:29:99:39 | ... .next(...) | test.rs:99:19:99:25 | TupleStructPat | | -| test.rs:99:41:103:9 | { ... } | test.rs:99:15:99:39 | let TupleStructPat = ... | | -| test.rs:100:13:102:13 | if ... { ... } | test.rs:99:41:103:9 | { ... } | | +| test.rs:99:41:103:9 | { ... } | test.rs:99:15:99:39 | let ... = ... | | +| test.rs:100:13:102:13 | if ... {...} | test.rs:99:41:103:9 | { ... } | | | test.rs:100:17:100:17 | x | test.rs:100:22:100:22 | 5 | | -| test.rs:100:17:100:22 | ... == ... | test.rs:100:13:102:13 | if ... { ... } | false | +| test.rs:100:17:100:22 | ... == ... | test.rs:100:13:102:13 | if ... {...} | false | | test.rs:100:17:100:22 | ... == ... | test.rs:101:17:101:22 | ExprStmt | true | | test.rs:100:22:100:22 | 5 | test.rs:100:17:100:22 | ... == ... | | | test.rs:101:17:101:21 | break | test.rs:99:9:103:9 | while ... { ... } | break | | test.rs:101:17:101:22 | ExprStmt | test.rs:101:17:101:21 | break | | | test.rs:106:5:113:5 | enter fn test_for | test.rs:106:17:106:17 | j | | | test.rs:106:5:113:5 | exit fn test_for (normal) | test.rs:106:5:113:5 | exit fn test_for | | -| test.rs:106:17:106:17 | j | test.rs:106:17:106:22 | j: i64 | match | -| test.rs:106:17:106:22 | j: i64 | test.rs:107:18:107:18 | 0 | | +| test.rs:106:17:106:17 | j | test.rs:106:17:106:22 | ...: i64 | match | +| test.rs:106:17:106:22 | ...: i64 | test.rs:107:18:107:18 | 0 | | | test.rs:106:25:113:5 | { ... } | test.rs:106:5:113:5 | exit fn test_for (normal) | | -| test.rs:107:9:112:9 | for i in ... { ... } | test.rs:106:25:113:5 | { ... } | | -| test.rs:107:13:107:13 | i | test.rs:107:9:112:9 | for i in ... { ... } | no-match | +| test.rs:107:9:112:9 | for ... in ... { ... } | test.rs:106:25:113:5 | { ... } | | +| test.rs:107:13:107:13 | i | test.rs:107:9:112:9 | for ... in ... { ... } | no-match | | test.rs:107:13:107:13 | i | test.rs:108:13:110:13 | ExprStmt | match | | test.rs:107:18:107:18 | 0 | test.rs:107:21:107:22 | 10 | | -| test.rs:107:18:107:22 | ... .. ... | test.rs:107:13:107:13 | i | | -| test.rs:107:21:107:22 | 10 | test.rs:107:18:107:22 | ... .. ... | | +| test.rs:107:18:107:22 | 0..10 | test.rs:107:13:107:13 | i | | +| test.rs:107:21:107:22 | 10 | test.rs:107:18:107:22 | 0..10 | | | test.rs:107:24:112:9 | { ... } | test.rs:107:13:107:13 | i | | | test.rs:108:13:110:13 | ExprStmt | test.rs:108:17:108:17 | i | | -| test.rs:108:13:110:13 | if ... { ... } | test.rs:111:13:111:14 | ExprStmt | | +| test.rs:108:13:110:13 | if ... {...} | test.rs:111:13:111:14 | ExprStmt | | | test.rs:108:17:108:17 | i | test.rs:108:22:108:22 | j | | -| test.rs:108:17:108:22 | ... == ... | test.rs:108:13:110:13 | if ... { ... } | false | +| test.rs:108:17:108:22 | ... == ... | test.rs:108:13:110:13 | if ... {...} | false | | test.rs:108:17:108:22 | ... == ... | test.rs:109:17:109:22 | ExprStmt | true | | test.rs:108:22:108:22 | j | test.rs:108:17:108:22 | ... == ... | | -| test.rs:109:17:109:21 | break | test.rs:107:9:112:9 | for i in ... { ... } | break | +| test.rs:109:17:109:21 | break | test.rs:107:9:112:9 | for ... in ... { ... } | break | | test.rs:109:17:109:22 | ExprStmt | test.rs:109:17:109:21 | break | | | test.rs:111:13:111:13 | 1 | test.rs:107:24:112:9 | { ... } | | | test.rs:111:13:111:14 | ExprStmt | test.rs:111:13:111:13 | 1 | | | test.rs:115:5:119:5 | enter fn break_with_return | test.rs:117:13:117:27 | ExprStmt | | | test.rs:115:5:119:5 | exit fn break_with_return (normal) | test.rs:115:5:119:5 | exit fn break_with_return | | | test.rs:117:13:117:27 | ExprStmt | test.rs:117:26:117:26 | 1 | | -| test.rs:117:19:117:26 | return ... | test.rs:115:5:119:5 | exit fn break_with_return (normal) | return | -| test.rs:117:26:117:26 | 1 | test.rs:117:19:117:26 | return ... | | +| test.rs:117:19:117:26 | return 1 | test.rs:115:5:119:5 | exit fn break_with_return (normal) | return | +| test.rs:117:26:117:26 | 1 | test.rs:117:19:117:26 | return 1 | | | test.rs:122:1:125:1 | enter fn test_nested_function | test.rs:122:25:122:25 | n | | | test.rs:122:1:125:1 | exit fn test_nested_function (normal) | test.rs:122:1:125:1 | exit fn test_nested_function | | -| test.rs:122:25:122:25 | n | test.rs:122:25:122:30 | n: i64 | match | -| test.rs:122:25:122:30 | n: i64 | test.rs:123:5:123:28 | let add_one = ... | | +| test.rs:122:25:122:25 | n | test.rs:122:25:122:30 | ...: i64 | match | +| test.rs:122:25:122:30 | ...: i64 | test.rs:123:5:123:28 | let ... = ... | | | test.rs:122:40:125:1 | { ... } | test.rs:122:1:125:1 | exit fn test_nested_function (normal) | | -| test.rs:123:5:123:28 | let add_one = ... | test.rs:123:19:123:27 | \|...\| ... | | +| test.rs:123:5:123:28 | let ... = ... | test.rs:123:19:123:27 | \|...\| ... | | | test.rs:123:9:123:15 | add_one | test.rs:124:5:124:11 | add_one | match | | test.rs:123:19:123:27 | \|...\| ... | test.rs:123:9:123:15 | add_one | | | test.rs:123:19:123:27 | enter \|...\| ... | test.rs:123:20:123:20 | i | | | test.rs:123:19:123:27 | exit \|...\| ... (normal) | test.rs:123:19:123:27 | exit \|...\| ... | | -| test.rs:123:20:123:20 | i | test.rs:123:20:123:20 | i | match | -| test.rs:123:20:123:20 | i | test.rs:123:23:123:23 | i | | +| test.rs:123:20:123:20 | ... | test.rs:123:23:123:23 | i | | +| test.rs:123:20:123:20 | i | test.rs:123:20:123:20 | ... | match | | test.rs:123:23:123:23 | i | test.rs:123:27:123:27 | 1 | | | test.rs:123:23:123:27 | ... + ... | test.rs:123:19:123:27 | exit \|...\| ... (normal) | | | test.rs:123:27:123:27 | 1 | test.rs:123:23:123:27 | ... + ... | | @@ -253,105 +253,105 @@ edges | test.rs:124:21:124:21 | n | test.rs:124:13:124:22 | add_one(...) | | | test.rs:129:5:135:5 | enter fn test_if_else | test.rs:129:21:129:21 | n | | | test.rs:129:5:135:5 | exit fn test_if_else (normal) | test.rs:129:5:135:5 | exit fn test_if_else | | -| test.rs:129:21:129:21 | n | test.rs:129:21:129:26 | n: i64 | match | -| test.rs:129:21:129:26 | n: i64 | test.rs:130:12:130:12 | n | | +| test.rs:129:21:129:21 | n | test.rs:129:21:129:26 | ...: i64 | match | +| test.rs:129:21:129:26 | ...: i64 | test.rs:130:12:130:12 | n | | | test.rs:129:36:135:5 | { ... } | test.rs:129:5:135:5 | exit fn test_if_else (normal) | | -| test.rs:130:9:134:9 | if ... { ... } else { ... } | test.rs:129:36:135:5 | { ... } | | +| test.rs:130:9:134:9 | if ... {...} else {...} | test.rs:129:36:135:5 | { ... } | | | test.rs:130:12:130:12 | n | test.rs:130:17:130:17 | 0 | | | test.rs:130:12:130:17 | ... <= ... | test.rs:131:13:131:13 | 0 | true | | test.rs:130:12:130:17 | ... <= ... | test.rs:133:13:133:13 | n | false | | test.rs:130:17:130:17 | 0 | test.rs:130:12:130:17 | ... <= ... | | -| test.rs:130:19:132:9 | { ... } | test.rs:130:9:134:9 | if ... { ... } else { ... } | | +| test.rs:130:19:132:9 | { ... } | test.rs:130:9:134:9 | if ... {...} else {...} | | | test.rs:131:13:131:13 | 0 | test.rs:130:19:132:9 | { ... } | | -| test.rs:132:16:134:9 | { ... } | test.rs:130:9:134:9 | if ... { ... } else { ... } | | +| test.rs:132:16:134:9 | { ... } | test.rs:130:9:134:9 | if ... {...} else {...} | | | test.rs:133:13:133:13 | n | test.rs:133:17:133:17 | 1 | | | test.rs:133:13:133:17 | ... - ... | test.rs:132:16:134:9 | { ... } | | | test.rs:133:17:133:17 | 1 | test.rs:133:13:133:17 | ... - ... | | | test.rs:137:5:143:5 | enter fn test_if_let_else | test.rs:137:25:137:25 | a | | | test.rs:137:5:143:5 | exit fn test_if_let_else (normal) | test.rs:137:5:143:5 | exit fn test_if_let_else | | -| test.rs:137:25:137:25 | a | test.rs:137:25:137:38 | a: Option::<...> | match | -| test.rs:137:25:137:38 | a: Option::<...> | test.rs:138:12:138:26 | let TupleStructPat = ... | | +| test.rs:137:25:137:25 | a | test.rs:137:25:137:38 | ...: Option::<...> | match | +| test.rs:137:25:137:38 | ...: Option::<...> | test.rs:138:12:138:26 | let ... = a | | | test.rs:137:48:143:5 | { ... } | test.rs:137:5:143:5 | exit fn test_if_let_else (normal) | | -| test.rs:138:9:142:9 | if ... { ... } else { ... } | test.rs:137:48:143:5 | { ... } | | -| test.rs:138:12:138:26 | let TupleStructPat = ... | test.rs:138:26:138:26 | a | | +| test.rs:138:9:142:9 | if ... {...} else {...} | test.rs:137:48:143:5 | { ... } | | +| test.rs:138:12:138:26 | let ... = a | test.rs:138:26:138:26 | a | | | test.rs:138:16:138:22 | TupleStructPat | test.rs:138:21:138:21 | n | match | | test.rs:138:16:138:22 | TupleStructPat | test.rs:141:13:141:13 | 0 | no-match | | test.rs:138:21:138:21 | n | test.rs:139:13:139:13 | n | match | | test.rs:138:26:138:26 | a | test.rs:138:16:138:22 | TupleStructPat | | -| test.rs:138:28:140:9 | { ... } | test.rs:138:9:142:9 | if ... { ... } else { ... } | | +| test.rs:138:28:140:9 | { ... } | test.rs:138:9:142:9 | if ... {...} else {...} | | | test.rs:139:13:139:13 | n | test.rs:138:28:140:9 | { ... } | | -| test.rs:140:16:142:9 | { ... } | test.rs:138:9:142:9 | if ... { ... } else { ... } | | +| test.rs:140:16:142:9 | { ... } | test.rs:138:9:142:9 | if ... {...} else {...} | | | test.rs:141:13:141:13 | 0 | test.rs:140:16:142:9 | { ... } | | | test.rs:145:5:150:5 | enter fn test_if_let | test.rs:145:20:145:20 | a | | | test.rs:145:5:150:5 | exit fn test_if_let (normal) | test.rs:145:5:150:5 | exit fn test_if_let | | -| test.rs:145:20:145:20 | a | test.rs:145:20:145:33 | a: Option::<...> | match | -| test.rs:145:20:145:33 | a: Option::<...> | test.rs:146:9:148:9 | ExprStmt | | +| test.rs:145:20:145:20 | a | test.rs:145:20:145:33 | ...: Option::<...> | match | +| test.rs:145:20:145:33 | ...: Option::<...> | test.rs:146:9:148:9 | ExprStmt | | | test.rs:145:43:150:5 | { ... } | test.rs:145:5:150:5 | exit fn test_if_let (normal) | | -| test.rs:146:9:148:9 | ExprStmt | test.rs:146:12:146:26 | let TupleStructPat = ... | | -| test.rs:146:9:148:9 | if ... { ... } | test.rs:149:9:149:9 | 0 | | -| test.rs:146:12:146:26 | let TupleStructPat = ... | test.rs:146:26:146:26 | a | | -| test.rs:146:16:146:22 | TupleStructPat | test.rs:146:9:148:9 | if ... { ... } | no-match | +| test.rs:146:9:148:9 | ExprStmt | test.rs:146:12:146:26 | let ... = a | | +| test.rs:146:9:148:9 | if ... {...} | test.rs:149:9:149:9 | 0 | | +| test.rs:146:12:146:26 | let ... = a | test.rs:146:26:146:26 | a | | +| test.rs:146:16:146:22 | TupleStructPat | test.rs:146:9:148:9 | if ... {...} | no-match | | test.rs:146:16:146:22 | TupleStructPat | test.rs:146:21:146:21 | n | match | | test.rs:146:21:146:21 | n | test.rs:147:13:147:21 | ExprStmt | match | | test.rs:146:26:146:26 | a | test.rs:146:16:146:22 | TupleStructPat | | -| test.rs:147:13:147:20 | return ... | test.rs:145:5:150:5 | exit fn test_if_let (normal) | return | +| test.rs:147:13:147:20 | return n | test.rs:145:5:150:5 | exit fn test_if_let (normal) | return | | test.rs:147:13:147:21 | ExprStmt | test.rs:147:20:147:20 | n | | -| test.rs:147:20:147:20 | n | test.rs:147:13:147:20 | return ... | | +| test.rs:147:20:147:20 | n | test.rs:147:13:147:20 | return n | | | test.rs:149:9:149:9 | 0 | test.rs:145:43:150:5 | { ... } | | | test.rs:152:5:158:5 | enter fn test_nested_if | test.rs:152:23:152:23 | a | | | test.rs:152:5:158:5 | exit fn test_nested_if (normal) | test.rs:152:5:158:5 | exit fn test_nested_if | | -| test.rs:152:23:152:23 | a | test.rs:152:23:152:28 | a: i64 | match | -| test.rs:152:23:152:28 | a: i64 | test.rs:153:16:153:16 | a | | +| test.rs:152:23:152:23 | a | test.rs:152:23:152:28 | ...: i64 | match | +| test.rs:152:23:152:28 | ...: i64 | test.rs:153:16:153:16 | a | | | test.rs:152:38:158:5 | { ... } | test.rs:152:5:158:5 | exit fn test_nested_if (normal) | | -| test.rs:153:9:157:9 | if ... { ... } else { ... } | test.rs:152:38:158:5 | { ... } | | -| test.rs:153:13:153:48 | [boolean(false)] if ... { ... } else { ... } | test.rs:156:13:156:13 | 0 | false | -| test.rs:153:13:153:48 | [boolean(true)] if ... { ... } else { ... } | test.rs:154:13:154:13 | 1 | true | +| test.rs:153:9:157:9 | if ... {...} else {...} | test.rs:152:38:158:5 | { ... } | | +| test.rs:153:13:153:48 | [boolean(false)] if ... {...} else {...} | test.rs:156:13:156:13 | 0 | false | +| test.rs:153:13:153:48 | [boolean(true)] if ... {...} else {...} | test.rs:154:13:154:13 | 1 | true | | test.rs:153:16:153:16 | a | test.rs:153:20:153:20 | 0 | | | test.rs:153:16:153:20 | ... < ... | test.rs:153:24:153:24 | a | true | | test.rs:153:16:153:20 | ... < ... | test.rs:153:41:153:41 | a | false | | test.rs:153:20:153:20 | 0 | test.rs:153:16:153:20 | ... < ... | | -| test.rs:153:22:153:32 | [boolean(false)] { ... } | test.rs:153:13:153:48 | [boolean(false)] if ... { ... } else { ... } | false | -| test.rs:153:22:153:32 | [boolean(true)] { ... } | test.rs:153:13:153:48 | [boolean(true)] if ... { ... } else { ... } | true | +| test.rs:153:22:153:32 | [boolean(false)] { ... } | test.rs:153:13:153:48 | [boolean(false)] if ... {...} else {...} | false | +| test.rs:153:22:153:32 | [boolean(true)] { ... } | test.rs:153:13:153:48 | [boolean(true)] if ... {...} else {...} | true | | test.rs:153:24:153:24 | a | test.rs:153:29:153:30 | 10 | | | test.rs:153:24:153:30 | ... < ... | test.rs:153:22:153:32 | [boolean(false)] { ... } | false | | test.rs:153:24:153:30 | ... < ... | test.rs:153:22:153:32 | [boolean(true)] { ... } | true | | test.rs:153:28:153:30 | - ... | test.rs:153:24:153:30 | ... < ... | | | test.rs:153:29:153:30 | 10 | test.rs:153:28:153:30 | - ... | | -| test.rs:153:39:153:48 | [boolean(false)] { ... } | test.rs:153:13:153:48 | [boolean(false)] if ... { ... } else { ... } | false | -| test.rs:153:39:153:48 | [boolean(true)] { ... } | test.rs:153:13:153:48 | [boolean(true)] if ... { ... } else { ... } | true | +| test.rs:153:39:153:48 | [boolean(false)] { ... } | test.rs:153:13:153:48 | [boolean(false)] if ... {...} else {...} | false | +| test.rs:153:39:153:48 | [boolean(true)] { ... } | test.rs:153:13:153:48 | [boolean(true)] if ... {...} else {...} | true | | test.rs:153:41:153:41 | a | test.rs:153:45:153:46 | 10 | | | test.rs:153:41:153:46 | ... > ... | test.rs:153:39:153:48 | [boolean(false)] { ... } | false | | test.rs:153:41:153:46 | ... > ... | test.rs:153:39:153:48 | [boolean(true)] { ... } | true | | test.rs:153:45:153:46 | 10 | test.rs:153:41:153:46 | ... > ... | | -| test.rs:153:51:155:9 | { ... } | test.rs:153:9:157:9 | if ... { ... } else { ... } | | +| test.rs:153:51:155:9 | { ... } | test.rs:153:9:157:9 | if ... {...} else {...} | | | test.rs:154:13:154:13 | 1 | test.rs:153:51:155:9 | { ... } | | -| test.rs:155:16:157:9 | { ... } | test.rs:153:9:157:9 | if ... { ... } else { ... } | | +| test.rs:155:16:157:9 | { ... } | test.rs:153:9:157:9 | if ... {...} else {...} | | | test.rs:156:13:156:13 | 0 | test.rs:155:16:157:9 | { ... } | | | test.rs:160:5:169:5 | enter fn test_nested_if_match | test.rs:160:29:160:29 | a | | | test.rs:160:5:169:5 | exit fn test_nested_if_match (normal) | test.rs:160:5:169:5 | exit fn test_nested_if_match | | -| test.rs:160:29:160:29 | a | test.rs:160:29:160:34 | a: i64 | match | -| test.rs:160:29:160:34 | a: i64 | test.rs:161:19:161:19 | a | | +| test.rs:160:29:160:29 | a | test.rs:160:29:160:34 | ...: i64 | match | +| test.rs:160:29:160:34 | ...: i64 | test.rs:161:19:161:19 | a | | | test.rs:160:44:169:5 | { ... } | test.rs:160:5:169:5 | exit fn test_nested_if_match (normal) | | -| test.rs:161:9:168:9 | if ... { ... } else { ... } | test.rs:160:44:169:5 | { ... } | | -| test.rs:161:13:164:9 | [boolean(false)] match ... { ... } | test.rs:167:13:167:13 | 0 | false | -| test.rs:161:13:164:9 | [boolean(true)] match ... { ... } | test.rs:165:13:165:13 | 1 | true | +| test.rs:161:9:168:9 | if ... {...} else {...} | test.rs:160:44:169:5 | { ... } | | +| test.rs:161:13:164:9 | [boolean(false)] match a { ... } | test.rs:167:13:167:13 | 0 | false | +| test.rs:161:13:164:9 | [boolean(true)] match a { ... } | test.rs:165:13:165:13 | 1 | true | | test.rs:161:19:161:19 | a | test.rs:162:13:162:13 | 0 | | | test.rs:162:13:162:13 | 0 | test.rs:162:13:162:13 | 0 | | | test.rs:162:13:162:13 | 0 | test.rs:162:18:162:21 | true | match | | test.rs:162:13:162:13 | 0 | test.rs:163:13:163:13 | _ | no-match | -| test.rs:162:18:162:21 | true | test.rs:161:13:164:9 | [boolean(true)] match ... { ... } | true | +| test.rs:162:18:162:21 | true | test.rs:161:13:164:9 | [boolean(true)] match a { ... } | true | | test.rs:163:13:163:13 | _ | test.rs:163:18:163:22 | false | match | -| test.rs:163:18:163:22 | false | test.rs:161:13:164:9 | [boolean(false)] match ... { ... } | false | -| test.rs:164:12:166:9 | { ... } | test.rs:161:9:168:9 | if ... { ... } else { ... } | | +| test.rs:163:18:163:22 | false | test.rs:161:13:164:9 | [boolean(false)] match a { ... } | false | +| test.rs:164:12:166:9 | { ... } | test.rs:161:9:168:9 | if ... {...} else {...} | | | test.rs:165:13:165:13 | 1 | test.rs:164:12:166:9 | { ... } | | -| test.rs:166:16:168:9 | { ... } | test.rs:161:9:168:9 | if ... { ... } else { ... } | | +| test.rs:166:16:168:9 | { ... } | test.rs:161:9:168:9 | if ... {...} else {...} | | | test.rs:167:13:167:13 | 0 | test.rs:166:16:168:9 | { ... } | | | test.rs:171:5:180:5 | enter fn test_nested_if_block | test.rs:171:29:171:29 | a | | | test.rs:171:5:180:5 | exit fn test_nested_if_block (normal) | test.rs:171:5:180:5 | exit fn test_nested_if_block | | -| test.rs:171:29:171:29 | a | test.rs:171:29:171:34 | a: i64 | match | -| test.rs:171:29:171:34 | a: i64 | test.rs:173:13:173:15 | ExprStmt | | +| test.rs:171:29:171:29 | a | test.rs:171:29:171:34 | ...: i64 | match | +| test.rs:171:29:171:34 | ...: i64 | test.rs:173:13:173:15 | ExprStmt | | | test.rs:171:44:180:5 | { ... } | test.rs:171:5:180:5 | exit fn test_nested_if_block (normal) | | -| test.rs:172:9:179:9 | if ... { ... } else { ... } | test.rs:171:44:180:5 | { ... } | | +| test.rs:172:9:179:9 | if ... {...} else {...} | test.rs:171:44:180:5 | { ... } | | | test.rs:172:12:175:9 | [boolean(false)] { ... } | test.rs:178:13:178:13 | 0 | false | | test.rs:172:12:175:9 | [boolean(true)] { ... } | test.rs:176:13:176:13 | 1 | true | | test.rs:173:13:173:14 | TupleExpr | test.rs:174:13:174:13 | a | | @@ -360,19 +360,19 @@ edges | test.rs:174:13:174:17 | ... > ... | test.rs:172:12:175:9 | [boolean(false)] { ... } | false | | test.rs:174:13:174:17 | ... > ... | test.rs:172:12:175:9 | [boolean(true)] { ... } | true | | test.rs:174:17:174:17 | 0 | test.rs:174:13:174:17 | ... > ... | | -| test.rs:175:11:177:9 | { ... } | test.rs:172:9:179:9 | if ... { ... } else { ... } | | +| test.rs:175:11:177:9 | { ... } | test.rs:172:9:179:9 | if ... {...} else {...} | | | test.rs:176:13:176:13 | 1 | test.rs:175:11:177:9 | { ... } | | -| test.rs:177:16:179:9 | { ... } | test.rs:172:9:179:9 | if ... { ... } else { ... } | | +| test.rs:177:16:179:9 | { ... } | test.rs:172:9:179:9 | if ... {...} else {...} | | | test.rs:178:13:178:13 | 0 | test.rs:177:16:179:9 | { ... } | | | test.rs:182:5:192:5 | enter fn test_if_assignment | test.rs:182:27:182:27 | a | | | test.rs:182:5:192:5 | exit fn test_if_assignment (normal) | test.rs:182:5:192:5 | exit fn test_if_assignment | | -| test.rs:182:27:182:27 | a | test.rs:182:27:182:32 | a: i64 | match | -| test.rs:182:27:182:32 | a: i64 | test.rs:183:9:183:26 | let x = ... | | +| test.rs:182:27:182:27 | a | test.rs:182:27:182:32 | ...: i64 | match | +| test.rs:182:27:182:32 | ...: i64 | test.rs:183:9:183:26 | let ... = false | | | test.rs:182:42:192:5 | { ... } | test.rs:182:5:192:5 | exit fn test_if_assignment (normal) | | -| test.rs:183:9:183:26 | let x = ... | test.rs:183:21:183:25 | false | | +| test.rs:183:9:183:26 | let ... = false | test.rs:183:21:183:25 | false | | | test.rs:183:13:183:17 | x | test.rs:185:13:185:21 | ExprStmt | match | | test.rs:183:21:183:25 | false | test.rs:183:13:183:17 | x | | -| test.rs:184:9:191:9 | if ... { ... } else { ... } | test.rs:182:42:192:5 | { ... } | | +| test.rs:184:9:191:9 | if ... {...} else {...} | test.rs:182:42:192:5 | { ... } | | | test.rs:184:12:187:9 | [boolean(false)] { ... } | test.rs:190:13:190:13 | 0 | false | | test.rs:184:12:187:9 | [boolean(true)] { ... } | test.rs:188:13:188:13 | 1 | true | | test.rs:185:13:185:13 | x | test.rs:185:17:185:20 | true | | @@ -381,27 +381,27 @@ edges | test.rs:185:17:185:20 | true | test.rs:185:13:185:20 | ... = ... | | | test.rs:186:13:186:13 | x | test.rs:184:12:187:9 | [boolean(false)] { ... } | false | | test.rs:186:13:186:13 | x | test.rs:184:12:187:9 | [boolean(true)] { ... } | true | -| test.rs:187:11:189:9 | { ... } | test.rs:184:9:191:9 | if ... { ... } else { ... } | | +| test.rs:187:11:189:9 | { ... } | test.rs:184:9:191:9 | if ... {...} else {...} | | | test.rs:188:13:188:13 | 1 | test.rs:187:11:189:9 | { ... } | | -| test.rs:189:16:191:9 | { ... } | test.rs:184:9:191:9 | if ... { ... } else { ... } | | +| test.rs:189:16:191:9 | { ... } | test.rs:184:9:191:9 | if ... {...} else {...} | | | test.rs:190:13:190:13 | 0 | test.rs:189:16:191:9 | { ... } | | | test.rs:194:5:205:5 | enter fn test_if_loop1 | test.rs:194:22:194:22 | a | | | test.rs:194:5:205:5 | exit fn test_if_loop1 (normal) | test.rs:194:5:205:5 | exit fn test_if_loop1 | | -| test.rs:194:22:194:22 | a | test.rs:194:22:194:27 | a: i64 | match | -| test.rs:194:22:194:27 | a: i64 | test.rs:196:13:198:14 | ExprStmt | | +| test.rs:194:22:194:22 | a | test.rs:194:22:194:27 | ...: i64 | match | +| test.rs:194:22:194:27 | ...: i64 | test.rs:196:13:198:14 | ExprStmt | | | test.rs:194:37:205:5 | { ... } | test.rs:194:5:205:5 | exit fn test_if_loop1 (normal) | | -| test.rs:195:9:204:9 | if ... { ... } else { ... } | test.rs:194:37:205:5 | { ... } | | -| test.rs:195:13:200:9 | [boolean(false)] loop {...} | test.rs:203:13:203:13 | 0 | false | -| test.rs:195:13:200:9 | [boolean(true)] loop {...} | test.rs:201:13:201:13 | 1 | true | +| test.rs:195:9:204:9 | if ... {...} else {...} | test.rs:194:37:205:5 | { ... } | | +| test.rs:195:13:200:9 | [boolean(false)] loop { ... } | test.rs:203:13:203:13 | 0 | false | +| test.rs:195:13:200:9 | [boolean(true)] loop { ... } | test.rs:201:13:201:13 | 1 | true | | test.rs:195:18:200:9 | { ... } | test.rs:196:13:198:14 | ExprStmt | | -| test.rs:196:13:198:13 | if ... { ... } | test.rs:199:13:199:19 | ExprStmt | | +| test.rs:196:13:198:13 | if ... {...} | test.rs:199:13:199:19 | ExprStmt | | | test.rs:196:13:198:14 | ExprStmt | test.rs:196:16:196:16 | a | | | test.rs:196:16:196:16 | a | test.rs:196:20:196:20 | 0 | | -| test.rs:196:16:196:20 | ... > ... | test.rs:196:13:198:13 | if ... { ... } | false | +| test.rs:196:16:196:20 | ... > ... | test.rs:196:13:198:13 | if ... {...} | false | | test.rs:196:16:196:20 | ... > ... | test.rs:197:17:197:29 | ExprStmt | true | | test.rs:196:20:196:20 | 0 | test.rs:196:16:196:20 | ... > ... | | -| test.rs:197:17:197:28 | [boolean(false)] break ... | test.rs:195:13:200:9 | [boolean(false)] loop {...} | break | -| test.rs:197:17:197:28 | [boolean(true)] break ... | test.rs:195:13:200:9 | [boolean(true)] loop {...} | break | +| test.rs:197:17:197:28 | [boolean(false)] break ... | test.rs:195:13:200:9 | [boolean(false)] loop { ... } | break | +| test.rs:197:17:197:28 | [boolean(true)] break ... | test.rs:195:13:200:9 | [boolean(true)] loop { ... } | break | | test.rs:197:17:197:29 | ExprStmt | test.rs:197:23:197:23 | a | | | test.rs:197:23:197:23 | a | test.rs:197:27:197:28 | 10 | | | test.rs:197:23:197:28 | ... > ... | test.rs:197:17:197:28 | [boolean(false)] break ... | false | @@ -411,27 +411,27 @@ edges | test.rs:199:13:199:18 | ... < ... | test.rs:195:18:200:9 | { ... } | | | test.rs:199:13:199:19 | ExprStmt | test.rs:199:13:199:13 | a | | | test.rs:199:17:199:18 | 10 | test.rs:199:13:199:18 | ... < ... | | -| test.rs:200:12:202:9 | { ... } | test.rs:195:9:204:9 | if ... { ... } else { ... } | | +| test.rs:200:12:202:9 | { ... } | test.rs:195:9:204:9 | if ... {...} else {...} | | | test.rs:201:13:201:13 | 1 | test.rs:200:12:202:9 | { ... } | | -| test.rs:202:16:204:9 | { ... } | test.rs:195:9:204:9 | if ... { ... } else { ... } | | +| test.rs:202:16:204:9 | { ... } | test.rs:195:9:204:9 | if ... {...} else {...} | | | test.rs:203:13:203:13 | 0 | test.rs:202:16:204:9 | { ... } | | | test.rs:207:5:218:5 | enter fn test_if_loop2 | test.rs:207:22:207:22 | a | | | test.rs:207:5:218:5 | exit fn test_if_loop2 (normal) | test.rs:207:5:218:5 | exit fn test_if_loop2 | | -| test.rs:207:22:207:22 | a | test.rs:207:22:207:27 | a: i64 | match | -| test.rs:207:22:207:27 | a: i64 | test.rs:209:13:211:14 | ExprStmt | | +| test.rs:207:22:207:22 | a | test.rs:207:22:207:27 | ...: i64 | match | +| test.rs:207:22:207:27 | ...: i64 | test.rs:209:13:211:14 | ExprStmt | | | test.rs:207:37:218:5 | { ... } | test.rs:207:5:218:5 | exit fn test_if_loop2 (normal) | | -| test.rs:208:9:217:9 | if ... { ... } else { ... } | test.rs:207:37:218:5 | { ... } | | -| test.rs:208:13:213:9 | [boolean(false)] loop {...} | test.rs:216:13:216:13 | 0 | false | -| test.rs:208:13:213:9 | [boolean(true)] loop {...} | test.rs:214:13:214:13 | 1 | true | +| test.rs:208:9:217:9 | if ... {...} else {...} | test.rs:207:37:218:5 | { ... } | | +| test.rs:208:13:213:9 | [boolean(false)] ''label: loop { ... } | test.rs:216:13:216:13 | 0 | false | +| test.rs:208:13:213:9 | [boolean(true)] ''label: loop { ... } | test.rs:214:13:214:13 | 1 | true | | test.rs:208:26:213:9 | { ... } | test.rs:209:13:211:14 | ExprStmt | | -| test.rs:209:13:211:13 | if ... { ... } | test.rs:212:13:212:19 | ExprStmt | | +| test.rs:209:13:211:13 | if ... {...} | test.rs:212:13:212:19 | ExprStmt | | | test.rs:209:13:211:14 | ExprStmt | test.rs:209:16:209:16 | a | | | test.rs:209:16:209:16 | a | test.rs:209:20:209:20 | 0 | | -| test.rs:209:16:209:20 | ... > ... | test.rs:209:13:211:13 | if ... { ... } | false | +| test.rs:209:16:209:20 | ... > ... | test.rs:209:13:211:13 | if ... {...} | false | | test.rs:209:16:209:20 | ... > ... | test.rs:210:17:210:36 | ExprStmt | true | | test.rs:209:20:209:20 | 0 | test.rs:209:16:209:20 | ... > ... | | -| test.rs:210:17:210:35 | [boolean(false)] break ''label ... | test.rs:208:13:213:9 | [boolean(false)] loop {...} | break | -| test.rs:210:17:210:35 | [boolean(true)] break ''label ... | test.rs:208:13:213:9 | [boolean(true)] loop {...} | break | +| test.rs:210:17:210:35 | [boolean(false)] break ''label ... | test.rs:208:13:213:9 | [boolean(false)] ''label: loop { ... } | break | +| test.rs:210:17:210:35 | [boolean(true)] break ''label ... | test.rs:208:13:213:9 | [boolean(true)] ''label: loop { ... } | break | | test.rs:210:17:210:36 | ExprStmt | test.rs:210:30:210:30 | a | | | test.rs:210:30:210:30 | a | test.rs:210:34:210:35 | 10 | | | test.rs:210:30:210:35 | ... > ... | test.rs:210:17:210:35 | [boolean(false)] break ''label ... | false | @@ -441,39 +441,39 @@ edges | test.rs:212:13:212:18 | ... < ... | test.rs:208:26:213:9 | { ... } | | | test.rs:212:13:212:19 | ExprStmt | test.rs:212:13:212:13 | a | | | test.rs:212:17:212:18 | 10 | test.rs:212:13:212:18 | ... < ... | | -| test.rs:213:12:215:9 | { ... } | test.rs:208:9:217:9 | if ... { ... } else { ... } | | +| test.rs:213:12:215:9 | { ... } | test.rs:208:9:217:9 | if ... {...} else {...} | | | test.rs:214:13:214:13 | 1 | test.rs:213:12:215:9 | { ... } | | -| test.rs:215:16:217:9 | { ... } | test.rs:208:9:217:9 | if ... { ... } else { ... } | | +| test.rs:215:16:217:9 | { ... } | test.rs:208:9:217:9 | if ... {...} else {...} | | | test.rs:216:13:216:13 | 0 | test.rs:215:16:217:9 | { ... } | | | test.rs:220:5:228:5 | enter fn test_labelled_block | test.rs:220:28:220:28 | a | | | test.rs:220:5:228:5 | exit fn test_labelled_block (normal) | test.rs:220:5:228:5 | exit fn test_labelled_block | | -| test.rs:220:28:220:28 | a | test.rs:220:28:220:33 | a: i64 | match | -| test.rs:220:28:220:33 | a: i64 | test.rs:222:13:222:31 | ExprStmt | | +| test.rs:220:28:220:28 | a | test.rs:220:28:220:33 | ...: i64 | match | +| test.rs:220:28:220:33 | ...: i64 | test.rs:222:13:222:31 | ExprStmt | | | test.rs:220:43:228:5 | { ... } | test.rs:220:5:228:5 | exit fn test_labelled_block (normal) | | -| test.rs:221:9:227:9 | if ... { ... } else { ... } | test.rs:220:43:228:5 | { ... } | | -| test.rs:221:13:223:9 | [boolean(false)] { ... } | test.rs:226:13:226:13 | 0 | false | -| test.rs:221:13:223:9 | [boolean(true)] { ... } | test.rs:224:13:224:13 | 1 | true | -| test.rs:222:13:222:30 | [boolean(false)] break ''block ... | test.rs:221:13:223:9 | [boolean(false)] { ... } | break | -| test.rs:222:13:222:30 | [boolean(true)] break ''block ... | test.rs:221:13:223:9 | [boolean(true)] { ... } | break | +| test.rs:221:9:227:9 | if ... {...} else {...} | test.rs:220:43:228:5 | { ... } | | +| test.rs:221:13:223:9 | [boolean(false)] ''block: { ... } | test.rs:226:13:226:13 | 0 | false | +| test.rs:221:13:223:9 | [boolean(true)] ''block: { ... } | test.rs:224:13:224:13 | 1 | true | +| test.rs:222:13:222:30 | [boolean(false)] break ''block ... | test.rs:221:13:223:9 | [boolean(false)] ''block: { ... } | break | +| test.rs:222:13:222:30 | [boolean(true)] break ''block ... | test.rs:221:13:223:9 | [boolean(true)] ''block: { ... } | break | | test.rs:222:13:222:31 | ExprStmt | test.rs:222:26:222:26 | a | | | test.rs:222:26:222:26 | a | test.rs:222:30:222:30 | 0 | | | test.rs:222:26:222:30 | ... > ... | test.rs:222:13:222:30 | [boolean(false)] break ''block ... | false | | test.rs:222:26:222:30 | ... > ... | test.rs:222:13:222:30 | [boolean(true)] break ''block ... | true | | test.rs:222:30:222:30 | 0 | test.rs:222:26:222:30 | ... > ... | | -| test.rs:223:12:225:9 | { ... } | test.rs:221:9:227:9 | if ... { ... } else { ... } | | +| test.rs:223:12:225:9 | { ... } | test.rs:221:9:227:9 | if ... {...} else {...} | | | test.rs:224:13:224:13 | 1 | test.rs:223:12:225:9 | { ... } | | -| test.rs:225:16:227:9 | { ... } | test.rs:221:9:227:9 | if ... { ... } else { ... } | | +| test.rs:225:16:227:9 | { ... } | test.rs:221:9:227:9 | if ... {...} else {...} | | | test.rs:226:13:226:13 | 0 | test.rs:225:16:227:9 | { ... } | | | test.rs:233:5:236:5 | enter fn test_and_operator | test.rs:233:30:233:30 | a | | | test.rs:233:5:236:5 | exit fn test_and_operator (normal) | test.rs:233:5:236:5 | exit fn test_and_operator | | -| test.rs:233:30:233:30 | a | test.rs:233:30:233:36 | a: bool | match | -| test.rs:233:30:233:36 | a: bool | test.rs:233:39:233:39 | b | | -| test.rs:233:39:233:39 | b | test.rs:233:39:233:45 | b: bool | match | -| test.rs:233:39:233:45 | b: bool | test.rs:233:48:233:48 | c | | -| test.rs:233:48:233:48 | c | test.rs:233:48:233:54 | c: bool | match | -| test.rs:233:48:233:54 | c: bool | test.rs:234:9:234:28 | let d = ... | | +| test.rs:233:30:233:30 | a | test.rs:233:30:233:36 | ...: bool | match | +| test.rs:233:30:233:36 | ...: bool | test.rs:233:39:233:39 | b | | +| test.rs:233:39:233:39 | b | test.rs:233:39:233:45 | ...: bool | match | +| test.rs:233:39:233:45 | ...: bool | test.rs:233:48:233:48 | c | | +| test.rs:233:48:233:48 | c | test.rs:233:48:233:54 | ...: bool | match | +| test.rs:233:48:233:54 | ...: bool | test.rs:234:9:234:28 | let ... = ... | | | test.rs:233:65:236:5 | { ... } | test.rs:233:5:236:5 | exit fn test_and_operator (normal) | | -| test.rs:234:9:234:28 | let d = ... | test.rs:234:17:234:17 | a | | +| test.rs:234:9:234:28 | let ... = ... | test.rs:234:17:234:17 | a | | | test.rs:234:13:234:13 | d | test.rs:235:9:235:9 | d | match | | test.rs:234:17:234:17 | a | test.rs:234:17:234:22 | [boolean(false)] ... && ... | false | | test.rs:234:17:234:17 | a | test.rs:234:22:234:22 | b | true | @@ -486,14 +486,14 @@ edges | test.rs:235:9:235:9 | d | test.rs:233:65:236:5 | { ... } | | | test.rs:238:5:241:5 | enter fn test_or_operator | test.rs:238:25:238:25 | a | | | test.rs:238:5:241:5 | exit fn test_or_operator (normal) | test.rs:238:5:241:5 | exit fn test_or_operator | | -| test.rs:238:25:238:25 | a | test.rs:238:25:238:31 | a: bool | match | -| test.rs:238:25:238:31 | a: bool | test.rs:238:34:238:34 | b | | -| test.rs:238:34:238:34 | b | test.rs:238:34:238:40 | b: bool | match | -| test.rs:238:34:238:40 | b: bool | test.rs:238:43:238:43 | c | | -| test.rs:238:43:238:43 | c | test.rs:238:43:238:49 | c: bool | match | -| test.rs:238:43:238:49 | c: bool | test.rs:239:9:239:28 | let d = ... | | +| test.rs:238:25:238:25 | a | test.rs:238:25:238:31 | ...: bool | match | +| test.rs:238:25:238:31 | ...: bool | test.rs:238:34:238:34 | b | | +| test.rs:238:34:238:34 | b | test.rs:238:34:238:40 | ...: bool | match | +| test.rs:238:34:238:40 | ...: bool | test.rs:238:43:238:43 | c | | +| test.rs:238:43:238:43 | c | test.rs:238:43:238:49 | ...: bool | match | +| test.rs:238:43:238:49 | ...: bool | test.rs:239:9:239:28 | let ... = ... | | | test.rs:238:60:241:5 | { ... } | test.rs:238:5:241:5 | exit fn test_or_operator (normal) | | -| test.rs:239:9:239:28 | let d = ... | test.rs:239:17:239:17 | a | | +| test.rs:239:9:239:28 | let ... = ... | test.rs:239:17:239:17 | a | | | test.rs:239:13:239:13 | d | test.rs:240:9:240:9 | d | match | | test.rs:239:17:239:17 | a | test.rs:239:17:239:22 | [boolean(true)] ... \|\| ... | true | | test.rs:239:17:239:17 | a | test.rs:239:22:239:22 | b | false | @@ -506,14 +506,14 @@ edges | test.rs:240:9:240:9 | d | test.rs:238:60:241:5 | { ... } | | | test.rs:243:5:246:5 | enter fn test_or_operator_2 | test.rs:243:27:243:27 | a | | | test.rs:243:5:246:5 | exit fn test_or_operator_2 (normal) | test.rs:243:5:246:5 | exit fn test_or_operator_2 | | -| test.rs:243:27:243:27 | a | test.rs:243:27:243:33 | a: bool | match | -| test.rs:243:27:243:33 | a: bool | test.rs:243:36:243:36 | b | | -| test.rs:243:36:243:36 | b | test.rs:243:36:243:41 | b: i64 | match | -| test.rs:243:36:243:41 | b: i64 | test.rs:243:44:243:44 | c | | -| test.rs:243:44:243:44 | c | test.rs:243:44:243:50 | c: bool | match | -| test.rs:243:44:243:50 | c: bool | test.rs:244:9:244:36 | let d = ... | | +| test.rs:243:27:243:27 | a | test.rs:243:27:243:33 | ...: bool | match | +| test.rs:243:27:243:33 | ...: bool | test.rs:243:36:243:36 | b | | +| test.rs:243:36:243:36 | b | test.rs:243:36:243:41 | ...: i64 | match | +| test.rs:243:36:243:41 | ...: i64 | test.rs:243:44:243:44 | c | | +| test.rs:243:44:243:44 | c | test.rs:243:44:243:50 | ...: bool | match | +| test.rs:243:44:243:50 | ...: bool | test.rs:244:9:244:36 | let ... = ... | | | test.rs:243:61:246:5 | { ... } | test.rs:243:5:246:5 | exit fn test_or_operator_2 (normal) | | -| test.rs:244:9:244:36 | let d = ... | test.rs:244:17:244:17 | a | | +| test.rs:244:9:244:36 | let ... = ... | test.rs:244:17:244:17 | a | | | test.rs:244:13:244:13 | d | test.rs:245:9:245:9 | d | match | | test.rs:244:17:244:17 | a | test.rs:244:17:244:30 | [boolean(true)] ... \|\| ... | true | | test.rs:244:17:244:17 | a | test.rs:244:23:244:23 | b | false | @@ -528,24 +528,24 @@ edges | test.rs:245:9:245:9 | d | test.rs:243:61:246:5 | { ... } | | | test.rs:248:5:251:5 | enter fn test_not_operator | test.rs:248:26:248:26 | a | | | test.rs:248:5:251:5 | exit fn test_not_operator (normal) | test.rs:248:5:251:5 | exit fn test_not_operator | | -| test.rs:248:26:248:26 | a | test.rs:248:26:248:32 | a: bool | match | -| test.rs:248:26:248:32 | a: bool | test.rs:249:9:249:19 | let d = ... | | +| test.rs:248:26:248:26 | a | test.rs:248:26:248:32 | ...: bool | match | +| test.rs:248:26:248:32 | ...: bool | test.rs:249:9:249:19 | let ... = ... | | | test.rs:248:43:251:5 | { ... } | test.rs:248:5:251:5 | exit fn test_not_operator (normal) | | -| test.rs:249:9:249:19 | let d = ... | test.rs:249:18:249:18 | a | | +| test.rs:249:9:249:19 | let ... = ... | test.rs:249:18:249:18 | a | | | test.rs:249:13:249:13 | d | test.rs:250:9:250:9 | d | match | | test.rs:249:17:249:18 | ! ... | test.rs:249:13:249:13 | d | | | test.rs:249:18:249:18 | a | test.rs:249:17:249:18 | ! ... | | | test.rs:250:9:250:9 | d | test.rs:248:43:251:5 | { ... } | | | test.rs:253:5:259:5 | enter fn test_if_and_operator | test.rs:253:29:253:29 | a | | | test.rs:253:5:259:5 | exit fn test_if_and_operator (normal) | test.rs:253:5:259:5 | exit fn test_if_and_operator | | -| test.rs:253:29:253:29 | a | test.rs:253:29:253:35 | a: bool | match | -| test.rs:253:29:253:35 | a: bool | test.rs:253:38:253:38 | b | | -| test.rs:253:38:253:38 | b | test.rs:253:38:253:44 | b: bool | match | -| test.rs:253:38:253:44 | b: bool | test.rs:253:47:253:47 | c | | -| test.rs:253:47:253:47 | c | test.rs:253:47:253:53 | c: bool | match | -| test.rs:253:47:253:53 | c: bool | test.rs:254:12:254:12 | a | | +| test.rs:253:29:253:29 | a | test.rs:253:29:253:35 | ...: bool | match | +| test.rs:253:29:253:35 | ...: bool | test.rs:253:38:253:38 | b | | +| test.rs:253:38:253:38 | b | test.rs:253:38:253:44 | ...: bool | match | +| test.rs:253:38:253:44 | ...: bool | test.rs:253:47:253:47 | c | | +| test.rs:253:47:253:47 | c | test.rs:253:47:253:53 | ...: bool | match | +| test.rs:253:47:253:53 | ...: bool | test.rs:254:12:254:12 | a | | | test.rs:253:64:259:5 | { ... } | test.rs:253:5:259:5 | exit fn test_if_and_operator (normal) | | -| test.rs:254:9:258:9 | if ... { ... } else { ... } | test.rs:253:64:259:5 | { ... } | | +| test.rs:254:9:258:9 | if ... {...} else {...} | test.rs:253:64:259:5 | { ... } | | | test.rs:254:12:254:12 | a | test.rs:254:12:254:17 | [boolean(false)] ... && ... | false | | test.rs:254:12:254:12 | a | test.rs:254:17:254:17 | b | true | | test.rs:254:12:254:17 | [boolean(false)] ... && ... | test.rs:254:12:254:22 | [boolean(false)] ... && ... | false | @@ -556,20 +556,20 @@ edges | test.rs:254:17:254:17 | b | test.rs:254:12:254:17 | [boolean(true)] ... && ... | true | | test.rs:254:22:254:22 | c | test.rs:254:12:254:22 | [boolean(false)] ... && ... | false | | test.rs:254:22:254:22 | c | test.rs:254:12:254:22 | [boolean(true)] ... && ... | true | -| test.rs:254:24:256:9 | { ... } | test.rs:254:9:258:9 | if ... { ... } else { ... } | | +| test.rs:254:24:256:9 | { ... } | test.rs:254:9:258:9 | if ... {...} else {...} | | | test.rs:255:13:255:16 | true | test.rs:254:24:256:9 | { ... } | | -| test.rs:256:16:258:9 | { ... } | test.rs:254:9:258:9 | if ... { ... } else { ... } | | +| test.rs:256:16:258:9 | { ... } | test.rs:254:9:258:9 | if ... {...} else {...} | | | test.rs:257:13:257:17 | false | test.rs:256:16:258:9 | { ... } | | | test.rs:261:5:267:5 | enter fn test_if_or_operator | test.rs:261:28:261:28 | a | | | test.rs:261:5:267:5 | exit fn test_if_or_operator (normal) | test.rs:261:5:267:5 | exit fn test_if_or_operator | | -| test.rs:261:28:261:28 | a | test.rs:261:28:261:34 | a: bool | match | -| test.rs:261:28:261:34 | a: bool | test.rs:261:37:261:37 | b | | -| test.rs:261:37:261:37 | b | test.rs:261:37:261:43 | b: bool | match | -| test.rs:261:37:261:43 | b: bool | test.rs:261:46:261:46 | c | | -| test.rs:261:46:261:46 | c | test.rs:261:46:261:52 | c: bool | match | -| test.rs:261:46:261:52 | c: bool | test.rs:262:12:262:12 | a | | +| test.rs:261:28:261:28 | a | test.rs:261:28:261:34 | ...: bool | match | +| test.rs:261:28:261:34 | ...: bool | test.rs:261:37:261:37 | b | | +| test.rs:261:37:261:37 | b | test.rs:261:37:261:43 | ...: bool | match | +| test.rs:261:37:261:43 | ...: bool | test.rs:261:46:261:46 | c | | +| test.rs:261:46:261:46 | c | test.rs:261:46:261:52 | ...: bool | match | +| test.rs:261:46:261:52 | ...: bool | test.rs:262:12:262:12 | a | | | test.rs:261:63:267:5 | { ... } | test.rs:261:5:267:5 | exit fn test_if_or_operator (normal) | | -| test.rs:262:9:266:9 | if ... { ... } else { ... } | test.rs:261:63:267:5 | { ... } | | +| test.rs:262:9:266:9 | if ... {...} else {...} | test.rs:261:63:267:5 | { ... } | | | test.rs:262:12:262:12 | a | test.rs:262:12:262:17 | [boolean(true)] ... \|\| ... | true | | test.rs:262:12:262:12 | a | test.rs:262:17:262:17 | b | false | | test.rs:262:12:262:17 | [boolean(false)] ... \|\| ... | test.rs:262:22:262:22 | c | false | @@ -580,28 +580,28 @@ edges | test.rs:262:17:262:17 | b | test.rs:262:12:262:17 | [boolean(true)] ... \|\| ... | true | | test.rs:262:22:262:22 | c | test.rs:262:12:262:22 | [boolean(false)] ... \|\| ... | false | | test.rs:262:22:262:22 | c | test.rs:262:12:262:22 | [boolean(true)] ... \|\| ... | true | -| test.rs:262:24:264:9 | { ... } | test.rs:262:9:266:9 | if ... { ... } else { ... } | | +| test.rs:262:24:264:9 | { ... } | test.rs:262:9:266:9 | if ... {...} else {...} | | | test.rs:263:13:263:16 | true | test.rs:262:24:264:9 | { ... } | | -| test.rs:264:16:266:9 | { ... } | test.rs:262:9:266:9 | if ... { ... } else { ... } | | +| test.rs:264:16:266:9 | { ... } | test.rs:262:9:266:9 | if ... {...} else {...} | | | test.rs:265:13:265:17 | false | test.rs:264:16:266:9 | { ... } | | | test.rs:269:5:275:5 | enter fn test_if_not_operator | test.rs:269:29:269:29 | a | | | test.rs:269:5:275:5 | exit fn test_if_not_operator (normal) | test.rs:269:5:275:5 | exit fn test_if_not_operator | | -| test.rs:269:29:269:29 | a | test.rs:269:29:269:35 | a: bool | match | -| test.rs:269:29:269:35 | a: bool | test.rs:270:13:270:13 | a | | +| test.rs:269:29:269:29 | a | test.rs:269:29:269:35 | ...: bool | match | +| test.rs:269:29:269:35 | ...: bool | test.rs:270:13:270:13 | a | | | test.rs:269:46:275:5 | { ... } | test.rs:269:5:275:5 | exit fn test_if_not_operator (normal) | | -| test.rs:270:9:274:9 | if ... { ... } else { ... } | test.rs:269:46:275:5 | { ... } | | +| test.rs:270:9:274:9 | if ... {...} else {...} | test.rs:269:46:275:5 | { ... } | | | test.rs:270:12:270:13 | [boolean(false)] ! ... | test.rs:273:13:273:17 | false | false | | test.rs:270:12:270:13 | [boolean(true)] ! ... | test.rs:271:13:271:16 | true | true | | test.rs:270:13:270:13 | a | test.rs:270:12:270:13 | [boolean(false)] ! ... | true | | test.rs:270:13:270:13 | a | test.rs:270:12:270:13 | [boolean(true)] ! ... | false | -| test.rs:270:15:272:9 | { ... } | test.rs:270:9:274:9 | if ... { ... } else { ... } | | +| test.rs:270:15:272:9 | { ... } | test.rs:270:9:274:9 | if ... {...} else {...} | | | test.rs:271:13:271:16 | true | test.rs:270:15:272:9 | { ... } | | -| test.rs:272:16:274:9 | { ... } | test.rs:270:9:274:9 | if ... { ... } else { ... } | | +| test.rs:272:16:274:9 | { ... } | test.rs:270:9:274:9 | if ... {...} else {...} | | | test.rs:273:13:273:17 | false | test.rs:272:16:274:9 | { ... } | | | test.rs:277:5:279:5 | enter fn test_and_return | test.rs:277:24:277:24 | a | | | test.rs:277:5:279:5 | exit fn test_and_return (normal) | test.rs:277:5:279:5 | exit fn test_and_return | | -| test.rs:277:24:277:24 | a | test.rs:277:24:277:30 | a: bool | match | -| test.rs:277:24:277:30 | a: bool | test.rs:278:9:278:20 | ExprStmt | | +| test.rs:277:24:277:24 | a | test.rs:277:24:277:30 | ...: bool | match | +| test.rs:277:24:277:30 | ...: bool | test.rs:278:9:278:20 | ExprStmt | | | test.rs:277:33:279:5 | { ... } | test.rs:277:5:279:5 | exit fn test_and_return (normal) | | | test.rs:278:9:278:9 | a | test.rs:278:9:278:19 | ... && ... | false | | test.rs:278:9:278:9 | a | test.rs:278:14:278:19 | return | true | @@ -610,8 +610,8 @@ edges | test.rs:278:14:278:19 | return | test.rs:277:5:279:5 | exit fn test_and_return (normal) | return | | test.rs:285:5:287:5 | enter fn test_question_mark_operator_1 | test.rs:285:38:285:38 | s | | | test.rs:285:5:287:5 | exit fn test_question_mark_operator_1 (normal) | test.rs:285:5:287:5 | exit fn test_question_mark_operator_1 | | -| test.rs:285:38:285:38 | s | test.rs:285:38:285:44 | s: RefType | match | -| test.rs:285:38:285:44 | s: RefType | test.rs:286:9:286:10 | Ok | | +| test.rs:285:38:285:38 | s | test.rs:285:38:285:44 | ...: ... | match | +| test.rs:285:38:285:44 | ...: ... | test.rs:286:9:286:10 | Ok | | | test.rs:285:87:287:5 | { ... } | test.rs:285:5:287:5 | exit fn test_question_mark_operator_1 (normal) | | | test.rs:286:9:286:10 | Ok | test.rs:286:12:286:12 | s | | | test.rs:286:9:286:33 | Ok(...) | test.rs:285:87:287:5 | { ... } | | @@ -623,8 +623,8 @@ edges | test.rs:286:32:286:32 | 4 | test.rs:286:12:286:32 | ... + ... | | | test.rs:289:5:294:5 | enter fn test_question_mark_operator_2 | test.rs:289:38:289:38 | b | | | test.rs:289:5:294:5 | exit fn test_question_mark_operator_2 (normal) | test.rs:289:5:294:5 | exit fn test_question_mark_operator_2 | | -| test.rs:289:38:289:38 | b | test.rs:289:38:289:52 | b: Option::<...> | match | -| test.rs:289:38:289:52 | b: Option::<...> | test.rs:290:15:290:15 | b | | +| test.rs:289:38:289:38 | b | test.rs:289:38:289:52 | ...: Option::<...> | match | +| test.rs:289:38:289:52 | ...: Option::<...> | test.rs:290:15:290:15 | b | | | test.rs:289:71:294:5 | { ... } | test.rs:289:5:294:5 | exit fn test_question_mark_operator_2 (normal) | | | test.rs:290:9:293:9 | match ... { ... } | test.rs:289:71:294:5 | { ... } | | | test.rs:290:15:290:15 | b | test.rs:290:15:290:16 | TryExpr | | @@ -643,10 +643,10 @@ edges | test.rs:292:27:292:30 | true | test.rs:292:22:292:31 | Some(...) | | | test.rs:300:5:306:5 | enter fn test_match | test.rs:300:19:300:29 | maybe_digit | | | test.rs:300:5:306:5 | exit fn test_match (normal) | test.rs:300:5:306:5 | exit fn test_match | | -| test.rs:300:19:300:29 | maybe_digit | test.rs:300:19:300:42 | maybe_digit: Option::<...> | match | -| test.rs:300:19:300:42 | maybe_digit: Option::<...> | test.rs:301:15:301:25 | maybe_digit | | +| test.rs:300:19:300:29 | maybe_digit | test.rs:300:19:300:42 | ...: Option::<...> | match | +| test.rs:300:19:300:42 | ...: Option::<...> | test.rs:301:15:301:25 | maybe_digit | | | test.rs:300:52:306:5 | { ... } | test.rs:300:5:306:5 | exit fn test_match (normal) | | -| test.rs:301:9:305:9 | match ... { ... } | test.rs:300:52:306:5 | { ... } | | +| test.rs:301:9:305:9 | match maybe_digit { ... } | test.rs:300:52:306:5 | { ... } | | | test.rs:301:15:301:25 | maybe_digit | test.rs:302:13:302:27 | TupleStructPat | | | test.rs:302:13:302:27 | TupleStructPat | test.rs:302:26:302:26 | x | match | | test.rs:302:13:302:27 | TupleStructPat | test.rs:303:13:303:27 | TupleStructPat | no-match | @@ -656,31 +656,31 @@ edges | test.rs:302:32:302:37 | ... < ... | test.rs:303:13:303:27 | TupleStructPat | false | | test.rs:302:36:302:37 | 10 | test.rs:302:32:302:37 | ... < ... | | | test.rs:302:42:302:42 | x | test.rs:302:46:302:46 | 5 | | -| test.rs:302:42:302:46 | ... + ... | test.rs:301:9:305:9 | match ... { ... } | | +| test.rs:302:42:302:46 | ... + ... | test.rs:301:9:305:9 | match maybe_digit { ... } | | | test.rs:302:46:302:46 | 5 | test.rs:302:42:302:46 | ... + ... | | | test.rs:303:13:303:27 | TupleStructPat | test.rs:303:26:303:26 | x | match | | test.rs:303:13:303:27 | TupleStructPat | test.rs:304:13:304:24 | Option::None | no-match | | test.rs:303:26:303:26 | x | test.rs:303:32:303:32 | x | match | -| test.rs:303:32:303:32 | x | test.rs:301:9:305:9 | match ... { ... } | | +| test.rs:303:32:303:32 | x | test.rs:301:9:305:9 | match maybe_digit { ... } | | | test.rs:304:13:304:24 | Option::None | test.rs:304:29:304:29 | 5 | match | -| test.rs:304:29:304:29 | 5 | test.rs:301:9:305:9 | match ... { ... } | | +| test.rs:304:29:304:29 | 5 | test.rs:301:9:305:9 | match maybe_digit { ... } | | | test.rs:308:5:317:5 | enter fn test_match_with_return_in_scrutinee | test.rs:308:44:308:54 | maybe_digit | | | test.rs:308:5:317:5 | exit fn test_match_with_return_in_scrutinee (normal) | test.rs:308:5:317:5 | exit fn test_match_with_return_in_scrutinee | | -| test.rs:308:44:308:54 | maybe_digit | test.rs:308:44:308:67 | maybe_digit: Option::<...> | match | -| test.rs:308:44:308:67 | maybe_digit: Option::<...> | test.rs:309:19:309:29 | maybe_digit | | +| test.rs:308:44:308:54 | maybe_digit | test.rs:308:44:308:67 | ...: Option::<...> | match | +| test.rs:308:44:308:67 | ...: Option::<...> | test.rs:309:19:309:29 | maybe_digit | | | test.rs:308:77:317:5 | { ... } | test.rs:308:5:317:5 | exit fn test_match_with_return_in_scrutinee (normal) | | | test.rs:309:9:316:9 | match ... { ... } | test.rs:308:77:317:5 | { ... } | | -| test.rs:309:16:313:9 | if ... { ... } else { ... } | test.rs:314:13:314:27 | TupleStructPat | | +| test.rs:309:16:313:9 | if ... {...} else {...} | test.rs:314:13:314:27 | TupleStructPat | | | test.rs:309:19:309:29 | maybe_digit | test.rs:309:34:309:37 | Some | | | test.rs:309:19:309:40 | ... == ... | test.rs:310:13:310:21 | ExprStmt | true | | test.rs:309:19:309:40 | ... == ... | test.rs:312:13:312:23 | maybe_digit | false | | test.rs:309:34:309:37 | Some | test.rs:309:39:309:39 | 3 | | | test.rs:309:34:309:40 | Some(...) | test.rs:309:19:309:40 | ... == ... | | | test.rs:309:39:309:39 | 3 | test.rs:309:34:309:40 | Some(...) | | -| test.rs:310:13:310:20 | return ... | test.rs:308:5:317:5 | exit fn test_match_with_return_in_scrutinee (normal) | return | +| test.rs:310:13:310:20 | return 3 | test.rs:308:5:317:5 | exit fn test_match_with_return_in_scrutinee (normal) | return | | test.rs:310:13:310:21 | ExprStmt | test.rs:310:20:310:20 | 3 | | -| test.rs:310:20:310:20 | 3 | test.rs:310:13:310:20 | return ... | | -| test.rs:311:16:313:9 | { ... } | test.rs:309:16:313:9 | if ... { ... } else { ... } | | +| test.rs:310:20:310:20 | 3 | test.rs:310:13:310:20 | return 3 | | +| test.rs:311:16:313:9 | { ... } | test.rs:309:16:313:9 | if ... {...} else {...} | | | test.rs:312:13:312:23 | maybe_digit | test.rs:311:16:313:9 | { ... } | | | test.rs:314:13:314:27 | TupleStructPat | test.rs:314:26:314:26 | x | match | | test.rs:314:13:314:27 | TupleStructPat | test.rs:315:13:315:24 | Option::None | no-match | @@ -692,44 +692,44 @@ edges | test.rs:315:29:315:29 | 5 | test.rs:309:9:316:9 | match ... { ... } | | | test.rs:319:5:324:5 | enter fn test_match_and | test.rs:319:23:319:26 | cond | | | test.rs:319:5:324:5 | exit fn test_match_and (normal) | test.rs:319:5:324:5 | exit fn test_match_and | | -| test.rs:319:23:319:26 | cond | test.rs:319:23:319:32 | cond: bool | match | -| test.rs:319:23:319:32 | cond: bool | test.rs:319:35:319:35 | r | | -| test.rs:319:35:319:35 | r | test.rs:319:35:319:49 | r: Option::<...> | match | -| test.rs:319:35:319:49 | r: Option::<...> | test.rs:320:16:320:16 | r | | +| test.rs:319:23:319:26 | cond | test.rs:319:23:319:32 | ...: bool | match | +| test.rs:319:23:319:32 | ...: bool | test.rs:319:35:319:35 | r | | +| test.rs:319:35:319:35 | r | test.rs:319:35:319:49 | ...: Option::<...> | match | +| test.rs:319:35:319:49 | ...: Option::<...> | test.rs:320:16:320:16 | r | | | test.rs:319:60:324:5 | { ... } | test.rs:319:5:324:5 | exit fn test_match_and (normal) | | | test.rs:320:9:323:18 | ... && ... | test.rs:319:60:324:5 | { ... } | | -| test.rs:320:10:323:9 | [boolean(false)] match ... { ... } | test.rs:320:9:323:18 | ... && ... | false | -| test.rs:320:10:323:9 | [boolean(true)] match ... { ... } | test.rs:323:15:323:18 | cond | true | +| test.rs:320:10:323:9 | [boolean(false)] match r { ... } | test.rs:320:9:323:18 | ... && ... | false | +| test.rs:320:10:323:9 | [boolean(true)] match r { ... } | test.rs:323:15:323:18 | cond | true | | test.rs:320:16:320:16 | r | test.rs:321:13:321:19 | TupleStructPat | | | test.rs:321:13:321:19 | TupleStructPat | test.rs:321:18:321:18 | a | match | | test.rs:321:13:321:19 | TupleStructPat | test.rs:322:13:322:13 | _ | no-match | | test.rs:321:18:321:18 | a | test.rs:321:24:321:24 | a | match | -| test.rs:321:24:321:24 | a | test.rs:320:10:323:9 | [boolean(false)] match ... { ... } | false | -| test.rs:321:24:321:24 | a | test.rs:320:10:323:9 | [boolean(true)] match ... { ... } | true | +| test.rs:321:24:321:24 | a | test.rs:320:10:323:9 | [boolean(false)] match r { ... } | false | +| test.rs:321:24:321:24 | a | test.rs:320:10:323:9 | [boolean(true)] match r { ... } | true | | test.rs:322:13:322:13 | _ | test.rs:322:18:322:22 | false | match | -| test.rs:322:18:322:22 | false | test.rs:320:10:323:9 | [boolean(false)] match ... { ... } | false | +| test.rs:322:18:322:22 | false | test.rs:320:10:323:9 | [boolean(false)] match r { ... } | false | | test.rs:323:15:323:18 | cond | test.rs:320:9:323:18 | ... && ... | | | test.rs:326:5:331:5 | enter fn test_match_with_no_arms | test.rs:326:35:326:35 | r | | | test.rs:326:5:331:5 | exit fn test_match_with_no_arms (normal) | test.rs:326:5:331:5 | exit fn test_match_with_no_arms | | -| test.rs:326:35:326:35 | r | test.rs:326:35:326:58 | r: Result::<...> | match | -| test.rs:326:35:326:58 | r: Result::<...> | test.rs:327:15:327:15 | r | | +| test.rs:326:35:326:35 | r | test.rs:326:35:326:58 | ...: Result::<...> | match | +| test.rs:326:35:326:58 | ...: Result::<...> | test.rs:327:15:327:15 | r | | | test.rs:326:66:331:5 | { ... } | test.rs:326:5:331:5 | exit fn test_match_with_no_arms (normal) | | -| test.rs:327:9:330:9 | match ... { ... } | test.rs:326:66:331:5 | { ... } | | +| test.rs:327:9:330:9 | match r { ... } | test.rs:326:66:331:5 | { ... } | | | test.rs:327:15:327:15 | r | test.rs:328:13:328:21 | TupleStructPat | | | test.rs:328:13:328:21 | TupleStructPat | test.rs:328:16:328:20 | value | match | | test.rs:328:13:328:21 | TupleStructPat | test.rs:329:13:329:22 | TupleStructPat | no-match | | test.rs:328:16:328:20 | value | test.rs:328:26:328:30 | value | match | -| test.rs:328:26:328:30 | value | test.rs:327:9:330:9 | match ... { ... } | | +| test.rs:328:26:328:30 | value | test.rs:327:9:330:9 | match r { ... } | | | test.rs:329:13:329:22 | TupleStructPat | test.rs:329:17:329:21 | never | match | | test.rs:329:17:329:21 | never | test.rs:329:33:329:37 | never | match | -| test.rs:329:27:329:40 | match ... { ... } | test.rs:327:9:330:9 | match ... { ... } | | -| test.rs:329:33:329:37 | never | test.rs:329:27:329:40 | match ... { ... } | | +| test.rs:329:27:329:40 | match never { ... } | test.rs:327:9:330:9 | match r { ... } | | +| test.rs:329:33:329:37 | never | test.rs:329:27:329:40 | match never { ... } | | | test.rs:336:5:339:5 | enter fn test_let_match | test.rs:336:23:336:23 | a | | | test.rs:336:5:339:5 | exit fn test_let_match (normal) | test.rs:336:5:339:5 | exit fn test_let_match | | -| test.rs:336:23:336:23 | a | test.rs:336:23:336:36 | a: Option::<...> | match | -| test.rs:336:23:336:36 | a: Option::<...> | test.rs:337:9:337:57 | let TupleStructPat = ... else { ... } | | +| test.rs:336:23:336:23 | a | test.rs:336:23:336:36 | ...: Option::<...> | match | +| test.rs:336:23:336:36 | ...: Option::<...> | test.rs:337:9:337:57 | let ... = a else { ... } | | | test.rs:336:46:339:5 | { ... } | test.rs:336:5:339:5 | exit fn test_let_match (normal) | | -| test.rs:337:9:337:57 | let TupleStructPat = ... else { ... } | test.rs:337:23:337:23 | a | | +| test.rs:337:9:337:57 | let ... = a else { ... } | test.rs:337:23:337:23 | a | | | test.rs:337:13:337:19 | TupleStructPat | test.rs:337:18:337:18 | n | match | | test.rs:337:13:337:19 | TupleStructPat | test.rs:337:39:337:53 | MacroStmts | no-match | | test.rs:337:18:337:18 | n | test.rs:338:9:338:9 | n | match | @@ -748,51 +748,51 @@ edges | test.rs:338:9:338:9 | n | test.rs:336:46:339:5 | { ... } | | | test.rs:341:5:347:5 | enter fn test_let_with_return | test.rs:341:29:341:29 | m | | | test.rs:341:5:347:5 | exit fn test_let_with_return (normal) | test.rs:341:5:347:5 | exit fn test_let_with_return | | -| test.rs:341:29:341:29 | m | test.rs:341:29:341:42 | m: Option::<...> | match | -| test.rs:341:29:341:42 | m: Option::<...> | test.rs:342:9:345:10 | let ret = ... | | +| test.rs:341:29:341:29 | m | test.rs:341:29:341:42 | ...: Option::<...> | match | +| test.rs:341:29:341:42 | ...: Option::<...> | test.rs:342:9:345:10 | let ... = ... | | | test.rs:341:53:347:5 | { ... } | test.rs:341:5:347:5 | exit fn test_let_with_return (normal) | | -| test.rs:342:9:345:10 | let ret = ... | test.rs:342:25:342:25 | m | | +| test.rs:342:9:345:10 | let ... = ... | test.rs:342:25:342:25 | m | | | test.rs:342:13:342:15 | ret | test.rs:346:9:346:12 | true | match | -| test.rs:342:19:345:9 | match ... { ... } | test.rs:342:13:342:15 | ret | | +| test.rs:342:19:345:9 | match m { ... } | test.rs:342:13:342:15 | ret | | | test.rs:342:25:342:25 | m | test.rs:343:13:343:21 | TupleStructPat | | | test.rs:343:13:343:21 | TupleStructPat | test.rs:343:18:343:20 | ret | match | | test.rs:343:13:343:21 | TupleStructPat | test.rs:344:13:344:16 | None | no-match | | test.rs:343:18:343:20 | ret | test.rs:343:26:343:28 | ret | match | -| test.rs:343:26:343:28 | ret | test.rs:342:19:345:9 | match ... { ... } | | +| test.rs:343:26:343:28 | ret | test.rs:342:19:345:9 | match m { ... } | | | test.rs:344:13:344:16 | None | test.rs:344:28:344:32 | false | match | -| test.rs:344:21:344:32 | return ... | test.rs:341:5:347:5 | exit fn test_let_with_return (normal) | return | -| test.rs:344:28:344:32 | false | test.rs:344:21:344:32 | return ... | | +| test.rs:344:21:344:32 | return false | test.rs:341:5:347:5 | exit fn test_let_with_return (normal) | return | +| test.rs:344:28:344:32 | false | test.rs:344:21:344:32 | return false | | | test.rs:346:9:346:12 | true | test.rs:341:53:347:5 | { ... } | | | test.rs:352:5:355:5 | enter fn empty_tuple_pattern | test.rs:352:28:352:31 | unit | | | test.rs:352:5:355:5 | exit fn empty_tuple_pattern (normal) | test.rs:352:5:355:5 | exit fn empty_tuple_pattern | | -| test.rs:352:28:352:31 | unit | test.rs:352:28:352:35 | unit: TupleType | match | -| test.rs:352:28:352:35 | unit: TupleType | test.rs:353:9:353:22 | let TuplePat = ... | | -| test.rs:353:9:353:22 | let TuplePat = ... | test.rs:353:18:353:21 | unit | | +| test.rs:352:28:352:31 | unit | test.rs:352:28:352:35 | ...: ... | match | +| test.rs:352:28:352:35 | ...: ... | test.rs:353:9:353:22 | let ... = unit | | +| test.rs:353:9:353:22 | let ... = unit | test.rs:353:18:353:21 | unit | | | test.rs:353:13:353:14 | TuplePat | test.rs:354:9:354:15 | ExprStmt | match | | test.rs:353:18:353:21 | unit | test.rs:353:13:353:14 | TuplePat | | | test.rs:354:9:354:14 | return | test.rs:352:5:355:5 | exit fn empty_tuple_pattern (normal) | return | | test.rs:354:9:354:15 | ExprStmt | test.rs:354:9:354:14 | return | | | test.rs:359:5:363:5 | enter fn empty_struct_pattern | test.rs:359:29:359:30 | st | | | test.rs:359:5:363:5 | exit fn empty_struct_pattern (normal) | test.rs:359:5:363:5 | exit fn empty_struct_pattern | | -| test.rs:359:29:359:30 | st | test.rs:359:29:359:40 | st: MyStruct | match | -| test.rs:359:29:359:40 | st: MyStruct | test.rs:360:15:360:16 | st | | +| test.rs:359:29:359:30 | st | test.rs:359:29:359:40 | ...: MyStruct | match | +| test.rs:359:29:359:40 | ...: MyStruct | test.rs:360:15:360:16 | st | | | test.rs:359:50:363:5 | { ... } | test.rs:359:5:363:5 | exit fn empty_struct_pattern (normal) | | -| test.rs:360:9:362:9 | match ... { ... } | test.rs:359:50:363:5 | { ... } | | +| test.rs:360:9:362:9 | match st { ... } | test.rs:359:50:363:5 | { ... } | | | test.rs:360:15:360:16 | st | test.rs:361:13:361:27 | MyStruct {...} | | | test.rs:361:13:361:27 | MyStruct {...} | test.rs:361:24:361:25 | .. | match | | test.rs:361:24:361:25 | .. | test.rs:361:32:361:32 | 1 | match | -| test.rs:361:32:361:32 | 1 | test.rs:360:9:362:9 | match ... { ... } | | +| test.rs:361:32:361:32 | 1 | test.rs:360:9:362:9 | match st { ... } | | | test.rs:365:5:372:5 | enter fn range_pattern | test.rs:366:15:366:16 | 42 | | | test.rs:365:5:372:5 | exit fn range_pattern (normal) | test.rs:365:5:372:5 | exit fn range_pattern | | | test.rs:365:31:372:5 | { ... } | test.rs:365:5:372:5 | exit fn range_pattern (normal) | | -| test.rs:366:9:371:9 | match ... { ... } | test.rs:365:31:372:5 | { ... } | | +| test.rs:366:9:371:9 | match 42 { ... } | test.rs:365:31:372:5 | { ... } | | | test.rs:366:15:366:16 | 42 | test.rs:367:13:367:15 | RangePat | | | test.rs:367:13:367:15 | RangePat | test.rs:367:15:367:15 | 0 | match | | test.rs:367:13:367:15 | RangePat | test.rs:368:13:368:16 | RangePat | no-match | | test.rs:367:15:367:15 | 0 | test.rs:367:15:367:15 | 0 | | | test.rs:367:15:367:15 | 0 | test.rs:367:20:367:20 | 1 | match | | test.rs:367:15:367:15 | 0 | test.rs:368:13:368:16 | RangePat | no-match | -| test.rs:367:20:367:20 | 1 | test.rs:366:9:371:9 | match ... { ... } | | +| test.rs:367:20:367:20 | 1 | test.rs:366:9:371:9 | match 42 { ... } | | | test.rs:368:13:368:13 | 1 | test.rs:368:13:368:13 | 1 | | | test.rs:368:13:368:13 | 1 | test.rs:368:16:368:16 | 2 | match | | test.rs:368:13:368:13 | 1 | test.rs:369:13:369:15 | RangePat | no-match | @@ -801,15 +801,15 @@ edges | test.rs:368:16:368:16 | 2 | test.rs:368:16:368:16 | 2 | | | test.rs:368:16:368:16 | 2 | test.rs:368:21:368:21 | 2 | match | | test.rs:368:16:368:16 | 2 | test.rs:369:13:369:15 | RangePat | no-match | -| test.rs:368:21:368:21 | 2 | test.rs:366:9:371:9 | match ... { ... } | | +| test.rs:368:21:368:21 | 2 | test.rs:366:9:371:9 | match 42 { ... } | | | test.rs:369:13:369:13 | 5 | test.rs:369:13:369:13 | 5 | | | test.rs:369:13:369:13 | 5 | test.rs:369:20:369:20 | 3 | match | | test.rs:369:13:369:13 | 5 | test.rs:370:13:370:13 | _ | no-match | | test.rs:369:13:369:15 | RangePat | test.rs:369:13:369:13 | 5 | match | | test.rs:369:13:369:15 | RangePat | test.rs:370:13:370:13 | _ | no-match | -| test.rs:369:20:369:20 | 3 | test.rs:366:9:371:9 | match ... { ... } | | +| test.rs:369:20:369:20 | 3 | test.rs:366:9:371:9 | match 42 { ... } | | | test.rs:370:13:370:13 | _ | test.rs:370:18:370:18 | 4 | match | -| test.rs:370:18:370:18 | 4 | test.rs:366:9:371:9 | match ... { ... } | | +| test.rs:370:18:370:18 | 4 | test.rs:366:9:371:9 | match 42 { ... } | | | test.rs:376:5:381:5 | enter fn test_infinite_loop | test.rs:377:9:379:9 | ExprStmt | | | test.rs:377:9:379:9 | ExprStmt | test.rs:378:13:378:14 | TupleExpr | | | test.rs:377:14:379:9 | { ... } | test.rs:378:13:378:14 | TupleExpr | | @@ -829,11 +829,11 @@ edges | test.rs:386:18:386:32 | { ... } | test.rs:386:9:386:33 | MacroExpr | | | test.rs:389:5:408:5 | enter fn async_block | test.rs:389:26:389:26 | b | | | test.rs:389:5:408:5 | exit fn async_block (normal) | test.rs:389:5:408:5 | exit fn async_block | | -| test.rs:389:26:389:26 | b | test.rs:389:26:389:32 | b: bool | match | -| test.rs:389:26:389:32 | b: bool | test.rs:390:9:392:10 | let say_godbye = ... | | +| test.rs:389:26:389:26 | b | test.rs:389:26:389:32 | ...: bool | match | +| test.rs:389:26:389:32 | ...: bool | test.rs:390:9:392:10 | let ... = ... | | | test.rs:389:35:408:5 | { ... } | test.rs:389:5:408:5 | exit fn async_block (normal) | | -| test.rs:390:9:392:10 | let say_godbye = ... | test.rs:390:26:392:9 | { ... } | | -| test.rs:390:13:390:22 | say_godbye | test.rs:393:9:395:10 | let say_how_are_you = ... | match | +| test.rs:390:9:392:10 | let ... = ... | test.rs:390:26:392:9 | { ... } | | +| test.rs:390:13:390:22 | say_godbye | test.rs:393:9:395:10 | let ... = ... | match | | test.rs:390:26:392:9 | enter { ... } | test.rs:391:13:391:42 | ExprStmt | | | test.rs:390:26:392:9 | exit { ... } (normal) | test.rs:390:26:392:9 | exit { ... } | | | test.rs:390:26:392:9 | { ... } | test.rs:390:13:390:22 | say_godbye | | @@ -847,8 +847,8 @@ edges | test.rs:391:22:391:40 | MacroExpr | test.rs:391:22:391:40 | $crate::io::_print(...) | | | test.rs:391:22:391:40 | MacroStmts | test.rs:391:22:391:40 | ExprStmt | | | test.rs:391:22:391:40 | { ... } | test.rs:391:13:391:41 | MacroExpr | | -| test.rs:393:9:395:10 | let say_how_are_you = ... | test.rs:393:31:395:9 | { ... } | | -| test.rs:393:13:393:27 | say_how_are_you | test.rs:396:9:396:28 | let noop = ... | match | +| test.rs:393:9:395:10 | let ... = ... | test.rs:393:31:395:9 | { ... } | | +| test.rs:393:13:393:27 | say_how_are_you | test.rs:396:9:396:28 | let ... = ... | match | | test.rs:393:31:395:9 | enter { ... } | test.rs:394:13:394:37 | ExprStmt | | | test.rs:393:31:395:9 | exit { ... } (normal) | test.rs:393:31:395:9 | exit { ... } | | | test.rs:393:31:395:9 | { ... } | test.rs:393:13:393:27 | say_how_are_you | | @@ -862,35 +862,35 @@ edges | test.rs:394:22:394:35 | MacroExpr | test.rs:394:22:394:35 | $crate::io::_print(...) | | | test.rs:394:22:394:35 | MacroStmts | test.rs:394:22:394:35 | ExprStmt | | | test.rs:394:22:394:35 | { ... } | test.rs:394:13:394:36 | MacroExpr | | -| test.rs:396:9:396:28 | let noop = ... | test.rs:396:20:396:27 | { ... } | | +| test.rs:396:9:396:28 | let ... = ... | test.rs:396:20:396:27 | { ... } | | | test.rs:396:13:396:16 | noop | test.rs:397:9:397:26 | ExprStmt | match | | test.rs:396:20:396:27 | { ... } | test.rs:396:13:396:16 | noop | | | test.rs:397:9:397:17 | say_hello | test.rs:397:9:397:19 | say_hello(...) | | | test.rs:397:9:397:19 | say_hello(...) | test.rs:397:9:397:25 | await ... | | | test.rs:397:9:397:25 | await ... | test.rs:398:9:398:30 | ExprStmt | | | test.rs:397:9:397:26 | ExprStmt | test.rs:397:9:397:17 | say_hello | | -| test.rs:398:9:398:23 | say_how_are_you | test.rs:398:9:398:29 | await ... | | -| test.rs:398:9:398:29 | await ... | test.rs:399:9:399:25 | ExprStmt | | +| test.rs:398:9:398:23 | say_how_are_you | test.rs:398:9:398:29 | await say_how_are_you | | +| test.rs:398:9:398:29 | await say_how_are_you | test.rs:399:9:399:25 | ExprStmt | | | test.rs:398:9:398:30 | ExprStmt | test.rs:398:9:398:23 | say_how_are_you | | -| test.rs:399:9:399:18 | say_godbye | test.rs:399:9:399:24 | await ... | | -| test.rs:399:9:399:24 | await ... | test.rs:400:9:400:19 | ExprStmt | | +| test.rs:399:9:399:18 | say_godbye | test.rs:399:9:399:24 | await say_godbye | | +| test.rs:399:9:399:24 | await say_godbye | test.rs:400:9:400:19 | ExprStmt | | | test.rs:399:9:399:25 | ExprStmt | test.rs:399:9:399:18 | say_godbye | | -| test.rs:400:9:400:12 | noop | test.rs:400:9:400:18 | await ... | | -| test.rs:400:9:400:18 | await ... | test.rs:402:9:407:10 | let lambda = ... | | +| test.rs:400:9:400:12 | noop | test.rs:400:9:400:18 | await noop | | +| test.rs:400:9:400:18 | await noop | test.rs:402:9:407:10 | let ... = ... | | | test.rs:400:9:400:19 | ExprStmt | test.rs:400:9:400:12 | noop | | -| test.rs:402:9:407:10 | let lambda = ... | test.rs:402:22:407:9 | \|...\| ... | | +| test.rs:402:9:407:10 | let ... = ... | test.rs:402:22:407:9 | \|...\| ... | | | test.rs:402:13:402:18 | lambda | test.rs:389:35:408:5 | { ... } | match | | test.rs:402:22:407:9 | \|...\| ... | test.rs:402:13:402:18 | lambda | | | test.rs:402:22:407:9 | enter \|...\| ... | test.rs:402:23:402:25 | foo | | | test.rs:402:22:407:9 | exit \|...\| ... (normal) | test.rs:402:22:407:9 | exit \|...\| ... | | -| test.rs:402:23:402:25 | foo | test.rs:402:23:402:25 | foo | match | -| test.rs:402:23:402:25 | foo | test.rs:402:28:407:9 | { ... } | | +| test.rs:402:23:402:25 | ... | test.rs:402:28:407:9 | { ... } | | +| test.rs:402:23:402:25 | foo | test.rs:402:23:402:25 | ... | match | | test.rs:402:28:407:9 | enter { ... } | test.rs:403:13:405:14 | ExprStmt | | | test.rs:402:28:407:9 | exit { ... } (normal) | test.rs:402:28:407:9 | exit { ... } | | | test.rs:402:28:407:9 | { ... } | test.rs:402:22:407:9 | exit \|...\| ... (normal) | | -| test.rs:403:13:405:13 | if ... { ... } | test.rs:406:13:406:15 | foo | | +| test.rs:403:13:405:13 | if b {...} | test.rs:406:13:406:15 | foo | | | test.rs:403:13:405:14 | ExprStmt | test.rs:403:16:403:16 | b | | -| test.rs:403:16:403:16 | b | test.rs:403:13:405:13 | if ... { ... } | false | +| test.rs:403:16:403:16 | b | test.rs:403:13:405:13 | if b {...} | false | | test.rs:403:16:403:16 | b | test.rs:404:17:404:41 | ExprStmt | true | | test.rs:404:17:404:40 | return ... | test.rs:402:28:407:9 | exit { ... } (normal) | return | | test.rs:404:17:404:41 | ExprStmt | test.rs:404:24:404:34 | async_block | | @@ -900,8 +900,8 @@ edges | test.rs:406:13:406:15 | foo | test.rs:402:28:407:9 | exit { ... } (normal) | | | test.rs:414:5:416:5 | enter fn add_two | test.rs:414:22:414:22 | n | | | test.rs:414:5:416:5 | exit fn add_two (normal) | test.rs:414:5:416:5 | exit fn add_two | | -| test.rs:414:22:414:22 | n | test.rs:414:22:414:27 | n: i64 | match | -| test.rs:414:22:414:27 | n: i64 | test.rs:415:9:415:9 | n | | +| test.rs:414:22:414:22 | n | test.rs:414:22:414:27 | ...: i64 | match | +| test.rs:414:22:414:27 | ...: i64 | test.rs:415:9:415:9 | n | | | test.rs:414:37:416:5 | { ... } | test.rs:414:5:416:5 | exit fn add_two (normal) | | | test.rs:415:9:415:9 | n | test.rs:415:13:415:13 | 2 | | | test.rs:415:9:415:13 | ... + ... | test.rs:414:37:416:5 | { ... } | | @@ -925,16 +925,16 @@ edges | test.rs:424:13:424:49 | panic_cold_explicit(...) | test.rs:424:13:424:49 | { ... } | | | test.rs:424:13:424:49 | { ... } | test.rs:424:13:424:49 | MacroExpr | | | test.rs:424:13:424:49 | { ... } | test.rs:424:13:424:49 | exit fn panic_cold_explicit (normal) | | -| test.rs:424:13:424:49 | { ... } | test.rs:424:21:424:48 | if ... { ... } | | +| test.rs:424:13:424:49 | { ... } | test.rs:424:21:424:48 | if ... {...} | | | test.rs:424:13:424:50 | ExprStmt | test.rs:424:21:424:48 | MacroStmts | | | test.rs:424:21:424:42 | std::mem::size_of::<...> | test.rs:424:21:424:44 | std::mem::size_of::<...>(...) | | | test.rs:424:21:424:44 | std::mem::size_of::<...>(...) | test.rs:424:48:424:48 | 0 | | | test.rs:424:21:424:48 | ... > ... | test.rs:424:21:424:48 | [boolean(false)] ! ... | true | | test.rs:424:21:424:48 | ... > ... | test.rs:424:21:424:48 | [boolean(true)] ! ... | false | | test.rs:424:21:424:48 | MacroStmts | test.rs:424:21:424:42 | std::mem::size_of::<...> | | -| test.rs:424:21:424:48 | [boolean(false)] ! ... | test.rs:424:21:424:48 | if ... { ... } | false | +| test.rs:424:21:424:48 | [boolean(false)] ! ... | test.rs:424:21:424:48 | if ... {...} | false | | test.rs:424:21:424:48 | [boolean(true)] ! ... | test.rs:424:13:424:49 | ExprStmt | true | -| test.rs:424:21:424:48 | if ... { ... } | test.rs:424:21:424:48 | { ... } | | +| test.rs:424:21:424:48 | if ... {...} | test.rs:424:21:424:48 | { ... } | | | test.rs:424:21:424:48 | { ... } | test.rs:424:13:424:49 | MacroExpr | | | test.rs:424:48:424:48 | 0 | test.rs:424:21:424:48 | ... > ... | | | test.rs:427:9:427:10 | 42 | test.rs:420:41:428:5 | { ... } | | @@ -943,8 +943,8 @@ edges | test.rs:430:35:439:5 | { ... } | test.rs:430:5:439:5 | exit fn const_block_panic (normal) | | | test.rs:431:9:431:30 | Const | test.rs:432:9:437:9 | ExprStmt | | | test.rs:432:9:437:9 | ExprStmt | test.rs:432:12:432:16 | false | | -| test.rs:432:9:437:9 | if ... { ... } | test.rs:438:9:438:9 | N | | -| test.rs:432:12:432:16 | false | test.rs:432:9:437:9 | if ... { ... } | false | +| test.rs:432:9:437:9 | if false {...} | test.rs:438:9:438:9 | N | | +| test.rs:432:12:432:16 | false | test.rs:432:9:437:9 | if false {...} | false | | test.rs:435:17:435:24 | $crate::panicking::panic_explicit | test.rs:435:17:435:24 | $crate::panicking::panic_explicit(...) | | | test.rs:435:17:435:24 | $crate::panicking::panic_explicit(...) | test.rs:435:17:435:24 | { ... } | | | test.rs:435:17:435:24 | enter fn panic_cold_explicit | test.rs:435:17:435:24 | $crate::panicking::panic_explicit | | @@ -955,9 +955,9 @@ edges | test.rs:442:1:447:1 | exit fn dead_code (normal) | test.rs:442:1:447:1 | exit fn dead_code | | | test.rs:443:5:445:5 | ExprStmt | test.rs:443:9:443:12 | true | | | test.rs:443:9:443:12 | true | test.rs:444:9:444:17 | ExprStmt | true | -| test.rs:444:9:444:16 | return ... | test.rs:442:1:447:1 | exit fn dead_code (normal) | return | +| test.rs:444:9:444:16 | return 0 | test.rs:442:1:447:1 | exit fn dead_code (normal) | return | | test.rs:444:9:444:17 | ExprStmt | test.rs:444:16:444:16 | 0 | | -| test.rs:444:16:444:16 | 0 | test.rs:444:9:444:16 | return ... | | +| test.rs:444:16:444:16 | 0 | test.rs:444:9:444:16 | return 0 | | | test.rs:449:1:449:16 | enter fn do_thing | test.rs:449:15:449:16 | { ... } | | | test.rs:449:1:449:16 | exit fn do_thing (normal) | test.rs:449:1:449:16 | exit fn do_thing | | | test.rs:449:15:449:16 | { ... } | test.rs:449:1:449:16 | exit fn do_thing (normal) | | @@ -971,68 +971,68 @@ edges | test.rs:457:1:457:21 | enter fn do_last_thing | test.rs:457:20:457:21 | { ... } | | | test.rs:457:1:457:21 | exit fn do_last_thing (normal) | test.rs:457:1:457:21 | exit fn do_last_thing | | | test.rs:457:20:457:21 | { ... } | test.rs:457:1:457:21 | exit fn do_last_thing (normal) | | -| test.rs:459:1:473:1 | enter fn labelled_block1 | test.rs:460:5:471:6 | let result = ... | | +| test.rs:459:1:473:1 | enter fn labelled_block1 | test.rs:460:5:471:6 | let ... = ... | | | test.rs:459:1:473:1 | exit fn labelled_block1 (normal) | test.rs:459:1:473:1 | exit fn labelled_block1 | | | test.rs:459:29:473:1 | { ... } | test.rs:459:1:473:1 | exit fn labelled_block1 (normal) | | -| test.rs:460:5:471:6 | let result = ... | test.rs:461:9:461:19 | ExprStmt | | +| test.rs:460:5:471:6 | let ... = ... | test.rs:461:9:461:19 | ExprStmt | | | test.rs:460:9:460:14 | result | test.rs:472:5:472:10 | result | match | -| test.rs:460:18:471:5 | { ... } | test.rs:460:9:460:14 | result | | +| test.rs:460:18:471:5 | ''block: { ... } | test.rs:460:9:460:14 | result | | | test.rs:461:9:461:16 | do_thing | test.rs:461:9:461:18 | do_thing(...) | | | test.rs:461:9:461:18 | do_thing(...) | test.rs:462:9:464:9 | ExprStmt | | | test.rs:461:9:461:19 | ExprStmt | test.rs:461:9:461:16 | do_thing | | | test.rs:462:9:464:9 | ExprStmt | test.rs:462:12:462:28 | condition_not_met | | -| test.rs:462:9:464:9 | if ... { ... } | test.rs:465:9:465:24 | ExprStmt | | +| test.rs:462:9:464:9 | if ... {...} | test.rs:465:9:465:24 | ExprStmt | | | test.rs:462:12:462:28 | condition_not_met | test.rs:462:12:462:30 | condition_not_met(...) | | -| test.rs:462:12:462:30 | condition_not_met(...) | test.rs:462:9:464:9 | if ... { ... } | false | +| test.rs:462:12:462:30 | condition_not_met(...) | test.rs:462:9:464:9 | if ... {...} | false | | test.rs:462:12:462:30 | condition_not_met(...) | test.rs:463:13:463:27 | ExprStmt | true | -| test.rs:463:13:463:26 | break ''block ... | test.rs:460:18:471:5 | { ... } | break | +| test.rs:463:13:463:26 | break ''block 1 | test.rs:460:18:471:5 | ''block: { ... } | break | | test.rs:463:13:463:27 | ExprStmt | test.rs:463:26:463:26 | 1 | | -| test.rs:463:26:463:26 | 1 | test.rs:463:13:463:26 | break ''block ... | | +| test.rs:463:26:463:26 | 1 | test.rs:463:13:463:26 | break ''block 1 | | | test.rs:465:9:465:21 | do_next_thing | test.rs:465:9:465:23 | do_next_thing(...) | | | test.rs:465:9:465:23 | do_next_thing(...) | test.rs:466:9:468:9 | ExprStmt | | | test.rs:465:9:465:24 | ExprStmt | test.rs:465:9:465:21 | do_next_thing | | | test.rs:466:9:468:9 | ExprStmt | test.rs:466:12:466:28 | condition_not_met | | -| test.rs:466:9:468:9 | if ... { ... } | test.rs:469:9:469:24 | ExprStmt | | +| test.rs:466:9:468:9 | if ... {...} | test.rs:469:9:469:24 | ExprStmt | | | test.rs:466:12:466:28 | condition_not_met | test.rs:466:12:466:30 | condition_not_met(...) | | -| test.rs:466:12:466:30 | condition_not_met(...) | test.rs:466:9:468:9 | if ... { ... } | false | +| test.rs:466:12:466:30 | condition_not_met(...) | test.rs:466:9:468:9 | if ... {...} | false | | test.rs:466:12:466:30 | condition_not_met(...) | test.rs:467:13:467:27 | ExprStmt | true | -| test.rs:467:13:467:26 | break ''block ... | test.rs:460:18:471:5 | { ... } | break | +| test.rs:467:13:467:26 | break ''block 2 | test.rs:460:18:471:5 | ''block: { ... } | break | | test.rs:467:13:467:27 | ExprStmt | test.rs:467:26:467:26 | 2 | | -| test.rs:467:26:467:26 | 2 | test.rs:467:13:467:26 | break ''block ... | | +| test.rs:467:26:467:26 | 2 | test.rs:467:13:467:26 | break ''block 2 | | | test.rs:469:9:469:21 | do_last_thing | test.rs:469:9:469:23 | do_last_thing(...) | | | test.rs:469:9:469:23 | do_last_thing(...) | test.rs:470:9:470:9 | 3 | | | test.rs:469:9:469:24 | ExprStmt | test.rs:469:9:469:21 | do_last_thing | | -| test.rs:470:9:470:9 | 3 | test.rs:460:18:471:5 | { ... } | | +| test.rs:470:9:470:9 | 3 | test.rs:460:18:471:5 | ''block: { ... } | | | test.rs:472:5:472:10 | result | test.rs:459:29:473:1 | { ... } | | -| test.rs:475:1:483:1 | enter fn labelled_block2 | test.rs:476:5:482:6 | let result = ... | | +| test.rs:475:1:483:1 | enter fn labelled_block2 | test.rs:476:5:482:6 | let ... = ... | | | test.rs:475:1:483:1 | exit fn labelled_block2 (normal) | test.rs:475:1:483:1 | exit fn labelled_block2 | | | test.rs:475:22:483:1 | { ... } | test.rs:475:1:483:1 | exit fn labelled_block2 (normal) | | -| test.rs:476:5:482:6 | let result = ... | test.rs:477:9:477:34 | let x = ... | | +| test.rs:476:5:482:6 | let ... = ... | test.rs:477:9:477:34 | let ... = None | | | test.rs:476:9:476:14 | result | test.rs:475:22:483:1 | { ... } | match | -| test.rs:476:18:482:5 | { ... } | test.rs:476:9:476:14 | result | | -| test.rs:477:9:477:34 | let x = ... | test.rs:477:30:477:33 | None | | -| test.rs:477:13:477:13 | x | test.rs:478:9:480:10 | let TupleStructPat = ... else { ... } | match | +| test.rs:476:18:482:5 | ''block: { ... } | test.rs:476:9:476:14 | result | | +| test.rs:477:9:477:34 | let ... = None | test.rs:477:30:477:33 | None | | +| test.rs:477:13:477:13 | x | test.rs:478:9:480:10 | let ... = x else { ... } | match | | test.rs:477:30:477:33 | None | test.rs:477:13:477:13 | x | | -| test.rs:478:9:480:10 | let TupleStructPat = ... else { ... } | test.rs:478:23:478:23 | x | | +| test.rs:478:9:480:10 | let ... = x else { ... } | test.rs:478:23:478:23 | x | | | test.rs:478:13:478:19 | TupleStructPat | test.rs:478:18:478:18 | y | match | | test.rs:478:13:478:19 | TupleStructPat | test.rs:479:13:479:27 | ExprStmt | no-match | | test.rs:478:18:478:18 | y | test.rs:481:9:481:9 | 0 | match | | test.rs:478:23:478:23 | x | test.rs:478:13:478:19 | TupleStructPat | | -| test.rs:479:13:479:26 | break ''block ... | test.rs:476:18:482:5 | { ... } | break | +| test.rs:479:13:479:26 | break ''block 1 | test.rs:476:18:482:5 | ''block: { ... } | break | | test.rs:479:13:479:27 | ExprStmt | test.rs:479:26:479:26 | 1 | | -| test.rs:479:26:479:26 | 1 | test.rs:479:13:479:26 | break ''block ... | | -| test.rs:481:9:481:9 | 0 | test.rs:476:18:482:5 | { ... } | | -| test.rs:485:1:491:1 | enter fn test_nested_function2 | test.rs:486:5:486:18 | let x = ... | | +| test.rs:479:26:479:26 | 1 | test.rs:479:13:479:26 | break ''block 1 | | +| test.rs:481:9:481:9 | 0 | test.rs:476:18:482:5 | ''block: { ... } | | +| test.rs:485:1:491:1 | enter fn test_nested_function2 | test.rs:486:5:486:18 | let ... = 0 | | | test.rs:485:1:491:1 | exit fn test_nested_function2 (normal) | test.rs:485:1:491:1 | exit fn test_nested_function2 | | | test.rs:485:28:491:1 | { ... } | test.rs:485:1:491:1 | exit fn test_nested_function2 (normal) | | -| test.rs:486:5:486:18 | let x = ... | test.rs:486:17:486:17 | 0 | | +| test.rs:486:5:486:18 | let ... = 0 | test.rs:486:17:486:17 | 0 | | | test.rs:486:9:486:13 | x | test.rs:487:5:489:5 | fn nested | match | | test.rs:486:17:486:17 | 0 | test.rs:486:9:486:13 | x | | | test.rs:487:5:489:5 | enter fn nested | test.rs:487:15:487:15 | x | | | test.rs:487:5:489:5 | exit fn nested (normal) | test.rs:487:5:489:5 | exit fn nested | | | test.rs:487:5:489:5 | fn nested | test.rs:490:5:490:19 | ExprStmt | | -| test.rs:487:15:487:15 | x | test.rs:487:15:487:25 | x: RefType | match | -| test.rs:487:15:487:25 | x: RefType | test.rs:488:9:488:16 | ExprStmt | | +| test.rs:487:15:487:15 | x | test.rs:487:15:487:25 | ...: ... | match | +| test.rs:487:15:487:25 | ...: ... | test.rs:488:9:488:16 | ExprStmt | | | test.rs:487:28:489:5 | { ... } | test.rs:487:5:489:5 | exit fn nested (normal) | | | test.rs:488:9:488:10 | * ... | test.rs:488:15:488:15 | 1 | | | test.rs:488:9:488:15 | ... += ... | test.rs:487:28:489:5 | { ... } | | @@ -1042,28 +1042,28 @@ edges | test.rs:490:5:490:10 | nested | test.rs:490:17:490:17 | x | | | test.rs:490:5:490:18 | nested(...) | test.rs:485:28:491:1 | { ... } | | | test.rs:490:5:490:19 | ExprStmt | test.rs:490:5:490:10 | nested | | -| test.rs:490:12:490:17 | &mut ... | test.rs:490:5:490:18 | nested(...) | | -| test.rs:490:17:490:17 | x | test.rs:490:12:490:17 | &mut ... | | +| test.rs:490:12:490:17 | &mut x | test.rs:490:5:490:18 | nested(...) | | +| test.rs:490:17:490:17 | x | test.rs:490:12:490:17 | &mut x | | breakTarget -| test.rs:34:17:34:21 | break | test.rs:28:9:40:9 | loop {...} | -| test.rs:48:21:48:25 | break | test.rs:46:13:53:13 | loop {...} | -| test.rs:50:21:50:32 | break ''outer | test.rs:45:9:54:9 | loop {...} | -| test.rs:52:17:52:28 | break ''inner | test.rs:46:13:53:13 | loop {...} | -| test.rs:91:17:91:21 | break | test.rs:88:9:94:9 | while ... { ... } | +| test.rs:34:17:34:21 | break | test.rs:28:9:40:9 | loop { ... } | +| test.rs:48:21:48:25 | break | test.rs:46:13:53:13 | ''inner: loop { ... } | +| test.rs:50:21:50:32 | break ''outer | test.rs:45:9:54:9 | ''outer: loop { ... } | +| test.rs:52:17:52:28 | break ''inner | test.rs:46:13:53:13 | ''inner: loop { ... } | +| test.rs:91:17:91:21 | break | test.rs:88:9:94:9 | while b { ... } | | test.rs:101:17:101:21 | break | test.rs:99:9:103:9 | while ... { ... } | -| test.rs:109:17:109:21 | break | test.rs:107:9:112:9 | for i in ... { ... } | -| test.rs:117:13:117:26 | break ... | test.rs:116:9:118:9 | loop {...} | -| test.rs:197:17:197:28 | break ... | test.rs:195:13:200:9 | loop {...} | -| test.rs:210:17:210:35 | break ''label ... | test.rs:208:13:213:9 | loop {...} | -| test.rs:222:13:222:30 | break ''block ... | test.rs:221:13:223:9 | { ... } | -| test.rs:463:13:463:26 | break ''block ... | test.rs:460:18:471:5 | { ... } | -| test.rs:467:13:467:26 | break ''block ... | test.rs:460:18:471:5 | { ... } | -| test.rs:479:13:479:26 | break ''block ... | test.rs:476:18:482:5 | { ... } | +| test.rs:109:17:109:21 | break | test.rs:107:9:112:9 | for ... in ... { ... } | +| test.rs:117:13:117:26 | break ... | test.rs:116:9:118:9 | loop { ... } | +| test.rs:197:17:197:28 | break ... | test.rs:195:13:200:9 | loop { ... } | +| test.rs:210:17:210:35 | break ''label ... | test.rs:208:13:213:9 | ''label: loop { ... } | +| test.rs:222:13:222:30 | break ''block ... | test.rs:221:13:223:9 | ''block: { ... } | +| test.rs:463:13:463:26 | break ''block 1 | test.rs:460:18:471:5 | ''block: { ... } | +| test.rs:467:13:467:26 | break ''block 2 | test.rs:460:18:471:5 | ''block: { ... } | +| test.rs:479:13:479:26 | break ''block 1 | test.rs:476:18:482:5 | ''block: { ... } | continueTarget -| test.rs:37:17:37:24 | continue | test.rs:28:9:40:9 | loop {...} | -| test.rs:63:21:63:28 | continue | test.rs:61:13:68:13 | loop {...} | -| test.rs:65:21:65:35 | continue 'outer | test.rs:59:9:69:9 | loop {...} | -| test.rs:67:17:67:31 | continue 'inner | test.rs:61:13:68:13 | loop {...} | -| test.rs:77:21:77:28 | continue | test.rs:75:13:82:13 | loop {...} | -| test.rs:79:21:79:35 | continue 'label | test.rs:75:13:82:13 | loop {...} | -| test.rs:81:17:81:31 | continue 'label | test.rs:75:13:82:13 | loop {...} | +| test.rs:37:17:37:24 | continue | test.rs:28:9:40:9 | loop { ... } | +| test.rs:63:21:63:28 | continue | test.rs:61:13:68:13 | ''inner: loop { ... } | +| test.rs:65:21:65:35 | continue ''outer | test.rs:59:9:69:9 | ''outer: loop { ... } | +| test.rs:67:17:67:31 | continue ''inner | test.rs:61:13:68:13 | ''inner: loop { ... } | +| test.rs:77:21:77:28 | continue | test.rs:75:13:82:13 | ''label: loop { ... } | +| test.rs:79:21:79:35 | continue ''label | test.rs:75:13:82:13 | ''label: loop { ... } | +| test.rs:81:17:81:31 | continue ''label | test.rs:75:13:82:13 | ''label: loop { ... } | diff --git a/rust/ql/test/library-tests/dataflow/barrier/inline-flow.expected b/rust/ql/test/library-tests/dataflow/barrier/inline-flow.expected index c8d53f467e99..29d8b8e3b920 100644 --- a/rust/ql/test/library-tests/dataflow/barrier/inline-flow.expected +++ b/rust/ql/test/library-tests/dataflow/barrier/inline-flow.expected @@ -1,16 +1,16 @@ models edges -| main.rs:21:13:21:21 | source(...) : unit | main.rs:22:10:22:10 | s | provenance | | -| main.rs:32:13:32:21 | source(...) : unit | main.rs:33:10:33:10 | s | provenance | | +| main.rs:21:13:21:21 | (...) ... : unit | main.rs:22:10:22:10 | s | provenance | | +| main.rs:32:13:32:21 | (...) ... : unit | main.rs:33:10:33:10 | s | provenance | | nodes -| main.rs:17:10:17:18 | source(...) | semmle.label | source(...) | -| main.rs:21:13:21:21 | source(...) : unit | semmle.label | source(...) : unit | +| main.rs:17:10:17:18 | (...) ... | semmle.label | (...) ... | +| main.rs:21:13:21:21 | (...) ... : unit | semmle.label | (...) ... : unit | | main.rs:22:10:22:10 | s | semmle.label | s | -| main.rs:32:13:32:21 | source(...) : unit | semmle.label | source(...) : unit | +| main.rs:32:13:32:21 | (...) ... : unit | semmle.label | (...) ... : unit | | main.rs:33:10:33:10 | s | semmle.label | s | subpaths testFailures #select -| main.rs:17:10:17:18 | source(...) | main.rs:17:10:17:18 | source(...) | main.rs:17:10:17:18 | source(...) | $@ | main.rs:17:10:17:18 | source(...) | source(...) | -| main.rs:22:10:22:10 | s | main.rs:21:13:21:21 | source(...) : unit | main.rs:22:10:22:10 | s | $@ | main.rs:21:13:21:21 | source(...) : unit | source(...) : unit | -| main.rs:33:10:33:10 | s | main.rs:32:13:32:21 | source(...) : unit | main.rs:33:10:33:10 | s | $@ | main.rs:32:13:32:21 | source(...) : unit | source(...) : unit | +| main.rs:17:10:17:18 | (...) ... | main.rs:17:10:17:18 | (...) ... | main.rs:17:10:17:18 | (...) ... | $@ | main.rs:17:10:17:18 | (...) ... | (...) ... | +| main.rs:22:10:22:10 | s | main.rs:21:13:21:21 | (...) ... : unit | main.rs:22:10:22:10 | s | $@ | main.rs:21:13:21:21 | (...) ... : unit | (...) ... : unit | +| main.rs:33:10:33:10 | s | main.rs:32:13:32:21 | (...) ... : unit | main.rs:33:10:33:10 | s | $@ | main.rs:32:13:32:21 | (...) ... : unit | (...) ... : unit | diff --git a/rust/ql/test/library-tests/dataflow/global/viableCallable.expected b/rust/ql/test/library-tests/dataflow/global/viableCallable.expected index 28e43535c79e..5fbf2fe41e1a 100644 --- a/rust/ql/test/library-tests/dataflow/global/viableCallable.expected +++ b/rust/ql/test/library-tests/dataflow/global/viableCallable.expected @@ -1,24 +1,24 @@ -| main.rs:13:5:13:13 | source(...) | main.rs:1:1:3:1 | fn source | -| main.rs:17:13:17:23 | get_data(...) | main.rs:12:1:14:1 | fn get_data | -| main.rs:18:5:18:11 | sink(...) | main.rs:5:1:7:1 | fn sink | -| main.rs:22:5:22:15 | sink(...) | main.rs:5:1:7:1 | fn sink | -| main.rs:26:13:26:21 | source(...) | main.rs:1:1:3:1 | fn source | -| main.rs:27:5:27:14 | data_in(...) | main.rs:21:1:23:1 | fn data_in | -| main.rs:35:13:35:21 | source(...) | main.rs:1:1:3:1 | fn source | -| main.rs:36:13:36:27 | pass_through(...) | main.rs:30:1:32:1 | fn pass_through | -| main.rs:37:5:37:11 | sink(...) | main.rs:5:1:7:1 | fn sink | -| main.rs:49:9:49:15 | sink(...) | main.rs:5:1:7:1 | fn sink | -| main.rs:55:13:55:21 | source(...) | main.rs:1:1:3:1 | fn source | +| main.rs:13:5:13:13 | (...) ... | main.rs:1:1:3:1 | fn source | +| main.rs:17:13:17:23 | (...) ... | main.rs:12:1:14:1 | fn get_data | +| main.rs:18:5:18:11 | (...) ... | main.rs:5:1:7:1 | fn sink | +| main.rs:22:5:22:15 | (...) ... | main.rs:5:1:7:1 | fn sink | +| main.rs:26:13:26:21 | (...) ... | main.rs:1:1:3:1 | fn source | +| main.rs:27:5:27:14 | (...) ... | main.rs:21:1:23:1 | fn data_in | +| main.rs:35:13:35:21 | (...) ... | main.rs:1:1:3:1 | fn source | +| main.rs:36:13:36:27 | (...) ... | main.rs:30:1:32:1 | fn pass_through | +| main.rs:37:5:37:11 | (...) ... | main.rs:5:1:7:1 | fn sink | +| main.rs:49:9:49:15 | (...) ... | main.rs:5:1:7:1 | fn sink | +| main.rs:55:13:55:21 | (...) ... | main.rs:1:1:3:1 | fn source | | main.rs:69:13:69:25 | ... .get_data(...) | main.rs:51:5:57:5 | fn get_data | -| main.rs:70:5:70:11 | sink(...) | main.rs:5:1:7:1 | fn sink | -| main.rs:75:13:75:21 | source(...) | main.rs:1:1:3:1 | fn source | +| main.rs:70:5:70:11 | (...) ... | main.rs:5:1:7:1 | fn sink | +| main.rs:75:13:75:21 | (...) ... | main.rs:1:1:3:1 | fn source | | main.rs:76:5:76:17 | ... .data_in(...) | main.rs:48:5:50:5 | fn data_in | -| main.rs:81:13:81:21 | source(...) | main.rs:1:1:3:1 | fn source | +| main.rs:81:13:81:21 | (...) ... | main.rs:1:1:3:1 | fn source | | main.rs:82:5:82:22 | ... .data_through(...) | main.rs:58:5:64:5 | fn data_through | -| main.rs:83:5:83:11 | sink(...) | main.rs:5:1:7:1 | fn sink | -| main.rs:87:5:87:22 | data_out_of_call(...) | main.rs:16:1:19:1 | fn data_out_of_call | -| main.rs:88:5:88:21 | data_in_to_call(...) | main.rs:25:1:28:1 | fn data_in_to_call | -| main.rs:89:5:89:23 | data_through_call(...) | main.rs:34:1:38:1 | fn data_through_call | -| main.rs:91:5:91:24 | data_out_of_method(...) | main.rs:67:1:71:1 | fn data_out_of_method | -| main.rs:92:5:92:28 | data_in_to_method_call(...) | main.rs:73:1:77:1 | fn data_in_to_method_call | -| main.rs:93:5:93:25 | data_through_method(...) | main.rs:79:1:84:1 | fn data_through_method | +| main.rs:83:5:83:11 | (...) ... | main.rs:5:1:7:1 | fn sink | +| main.rs:87:5:87:22 | (...) ... | main.rs:16:1:19:1 | fn data_out_of_call | +| main.rs:88:5:88:21 | (...) ... | main.rs:25:1:28:1 | fn data_in_to_call | +| main.rs:89:5:89:23 | (...) ... | main.rs:34:1:38:1 | fn data_through_call | +| main.rs:91:5:91:24 | (...) ... | main.rs:67:1:71:1 | fn data_out_of_method | +| main.rs:92:5:92:28 | (...) ... | main.rs:73:1:77:1 | fn data_in_to_method_call | +| main.rs:93:5:93:25 | (...) ... | main.rs:79:1:84:1 | fn data_through_method | diff --git a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected index 3639294bd494..e0bab71ec1eb 100644 --- a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected +++ b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected @@ -5,27 +5,27 @@ | main.rs:7:9:7:9 | s | main.rs:7:9:7:9 | [SSA] s | | main.rs:19:9:19:9 | [SSA] s | main.rs:20:10:20:10 | s | | main.rs:19:9:19:9 | s | main.rs:19:9:19:9 | [SSA] s | -| main.rs:19:13:19:21 | source(...) | main.rs:19:9:19:9 | s | +| main.rs:19:13:19:21 | (...) ... | main.rs:19:9:19:9 | s | | main.rs:23:18:23:21 | [SSA] cond | main.rs:26:16:26:19 | cond | | main.rs:23:18:23:21 | cond | main.rs:23:18:23:21 | [SSA] cond | | main.rs:24:9:24:9 | [SSA] a | main.rs:26:23:26:23 | a | | main.rs:24:9:24:9 | a | main.rs:24:9:24:9 | [SSA] a | -| main.rs:24:13:24:21 | source(...) | main.rs:24:9:24:9 | a | +| main.rs:24:13:24:21 | (...) ... | main.rs:24:9:24:9 | a | | main.rs:25:9:25:9 | [SSA] b | main.rs:26:34:26:34 | b | | main.rs:25:9:25:9 | b | main.rs:25:9:25:9 | [SSA] b | | main.rs:25:13:25:13 | 2 | main.rs:25:9:25:9 | b | | main.rs:26:9:26:9 | [SSA] c | main.rs:27:10:27:10 | c | | main.rs:26:9:26:9 | c | main.rs:26:9:26:9 | [SSA] c | -| main.rs:26:13:26:36 | if ... { ... } else { ... } | main.rs:26:9:26:9 | c | -| main.rs:26:21:26:25 | { ... } | main.rs:26:13:26:36 | if ... { ... } else { ... } | +| main.rs:26:13:26:36 | ... else { ... } if {...} | main.rs:26:9:26:9 | c | +| main.rs:26:21:26:25 | { ... } | main.rs:26:13:26:36 | ... else { ... } if {...} | | main.rs:26:23:26:23 | a | main.rs:26:21:26:25 | { ... } | -| main.rs:26:32:26:36 | { ... } | main.rs:26:13:26:36 | if ... { ... } else { ... } | +| main.rs:26:32:26:36 | { ... } | main.rs:26:13:26:36 | ... else { ... } if {...} | | main.rs:26:34:26:34 | b | main.rs:26:32:26:36 | { ... } | | main.rs:30:21:30:21 | [SSA] m | main.rs:32:19:32:19 | m | | main.rs:30:21:30:21 | m | main.rs:30:21:30:21 | [SSA] m | | main.rs:31:9:31:9 | [SSA] a | main.rs:33:20:33:20 | a | | main.rs:31:9:31:9 | a | main.rs:31:9:31:9 | [SSA] a | -| main.rs:31:13:31:21 | source(...) | main.rs:31:9:31:9 | a | +| main.rs:31:13:31:21 | (...) ... | main.rs:31:9:31:9 | a | | main.rs:32:9:32:9 | [SSA] b | main.rs:36:10:36:10 | b | | main.rs:32:9:32:9 | b | main.rs:32:9:32:9 | [SSA] b | | main.rs:32:13:35:5 | match ... { ... } | main.rs:32:9:32:9 | b | @@ -33,14 +33,14 @@ | main.rs:34:17:34:17 | 0 | main.rs:32:13:35:5 | match ... { ... } | | main.rs:40:9:40:9 | [SSA] a | main.rs:43:10:43:10 | a | | main.rs:40:9:40:9 | a | main.rs:40:9:40:9 | [SSA] a | -| main.rs:40:13:42:5 | loop {...} | main.rs:40:9:40:9 | a | -| main.rs:41:9:41:15 | break ... | main.rs:40:13:42:5 | loop {...} | -| main.rs:41:15:41:15 | 1 | main.rs:41:9:41:15 | break ... | +| main.rs:40:13:42:5 | loop { ... } | main.rs:40:9:40:9 | a | +| main.rs:41:9:41:15 | 1 break | main.rs:40:13:42:5 | loop { ... } | +| main.rs:41:15:41:15 | 1 | main.rs:41:9:41:15 | 1 break | | main.rs:44:9:44:9 | [SSA] b | main.rs:47:10:47:10 | b | | main.rs:44:9:44:9 | b | main.rs:44:9:44:9 | [SSA] b | -| main.rs:44:13:46:5 | loop {...} | main.rs:44:9:44:9 | b | -| main.rs:45:9:45:23 | break ... | main.rs:44:13:46:5 | loop {...} | -| main.rs:45:15:45:23 | source(...) | main.rs:45:9:45:23 | break ... | +| main.rs:44:13:46:5 | loop { ... } | main.rs:44:9:44:9 | b | +| main.rs:45:9:45:23 | ... break | main.rs:44:13:46:5 | loop { ... } | +| main.rs:45:15:45:23 | (...) ... | main.rs:45:9:45:23 | ... break | | main.rs:51:9:51:13 | [SSA] i | main.rs:52:10:52:10 | i | | main.rs:51:9:51:13 | i | main.rs:51:9:51:13 | [SSA] i | | main.rs:51:17:51:17 | 1 | main.rs:51:9:51:13 | i | @@ -48,7 +48,7 @@ | main.rs:53:5:53:5 | i | main.rs:53:5:53:5 | [SSA] i | | main.rs:61:9:61:9 | [SSA] i | main.rs:62:11:62:11 | i | | main.rs:61:9:61:9 | i | main.rs:61:9:61:9 | [SSA] i | -| main.rs:61:13:61:31 | Box::new(...) | main.rs:61:9:61:9 | i | +| main.rs:61:13:61:31 | (...) ... | main.rs:61:9:61:9 | i | | main.rs:66:9:66:9 | [SSA] a | main.rs:67:10:67:10 | a | | main.rs:66:9:66:9 | a | main.rs:66:9:66:9 | [SSA] a | | main.rs:66:13:66:26 | TupleExpr | main.rs:66:9:66:9 | a | @@ -70,16 +70,16 @@ | main.rs:97:38:97:38 | p | main.rs:97:9:97:34 | Point {...} | | main.rs:104:9:104:10 | [SSA] s1 | main.rs:106:11:106:12 | s1 | | main.rs:104:9:104:10 | s1 | main.rs:104:9:104:10 | [SSA] s1 | -| main.rs:104:14:104:28 | Some(...) | main.rs:104:9:104:10 | s1 | +| main.rs:104:14:104:28 | (...) ... | main.rs:104:9:104:10 | s1 | | main.rs:105:9:105:10 | [SSA] s2 | main.rs:110:11:110:12 | s2 | | main.rs:105:9:105:10 | s2 | main.rs:105:9:105:10 | [SSA] s2 | -| main.rs:105:14:105:20 | Some(...) | main.rs:105:9:105:10 | s2 | +| main.rs:105:14:105:20 | (...) ... | main.rs:105:9:105:10 | s2 | | main.rs:107:14:107:14 | [SSA] n | main.rs:107:25:107:25 | n | | main.rs:107:14:107:14 | n | main.rs:107:14:107:14 | [SSA] n | -| main.rs:107:20:107:26 | sink(...) | main.rs:106:5:109:5 | match ... { ... } | -| main.rs:108:17:108:23 | sink(...) | main.rs:106:5:109:5 | match ... { ... } | +| main.rs:107:20:107:26 | (...) ... | main.rs:106:5:109:5 | match ... { ... } | +| main.rs:108:17:108:23 | (...) ... | main.rs:106:5:109:5 | match ... { ... } | | main.rs:110:5:113:5 | match ... { ... } | main.rs:103:27:114:1 | { ... } | | main.rs:111:14:111:14 | [SSA] n | main.rs:111:25:111:25 | n | | main.rs:111:14:111:14 | n | main.rs:111:14:111:14 | [SSA] n | -| main.rs:111:20:111:26 | sink(...) | main.rs:110:5:113:5 | match ... { ... } | -| main.rs:112:17:112:23 | sink(...) | main.rs:110:5:113:5 | match ... { ... } | +| main.rs:111:20:111:26 | (...) ... | main.rs:110:5:113:5 | match ... { ... } | +| main.rs:112:17:112:23 | (...) ... | main.rs:110:5:113:5 | match ... { ... } | diff --git a/rust/ql/test/library-tests/dataflow/local/inline-flow.expected b/rust/ql/test/library-tests/dataflow/local/inline-flow.expected index b4c292a93d9a..315c3580f3d1 100644 --- a/rust/ql/test/library-tests/dataflow/local/inline-flow.expected +++ b/rust/ql/test/library-tests/dataflow/local/inline-flow.expected @@ -1,24 +1,24 @@ models edges -| main.rs:19:13:19:21 | source(...) : unit | main.rs:20:10:20:10 | s | provenance | | -| main.rs:24:13:24:21 | source(...) : unit | main.rs:27:10:27:10 | c | provenance | | -| main.rs:31:13:31:21 | source(...) : unit | main.rs:36:10:36:10 | b | provenance | | -| main.rs:45:15:45:23 | source(...) : unit | main.rs:47:10:47:10 | b | provenance | | +| main.rs:19:13:19:21 | (...) ... : unit | main.rs:20:10:20:10 | s | provenance | | +| main.rs:24:13:24:21 | (...) ... : unit | main.rs:27:10:27:10 | c | provenance | | +| main.rs:31:13:31:21 | (...) ... : unit | main.rs:36:10:36:10 | b | provenance | | +| main.rs:45:15:45:23 | (...) ... : unit | main.rs:47:10:47:10 | b | provenance | | nodes -| main.rs:15:10:15:18 | source(...) | semmle.label | source(...) | -| main.rs:19:13:19:21 | source(...) : unit | semmle.label | source(...) : unit | +| main.rs:15:10:15:18 | (...) ... | semmle.label | (...) ... | +| main.rs:19:13:19:21 | (...) ... : unit | semmle.label | (...) ... : unit | | main.rs:20:10:20:10 | s | semmle.label | s | -| main.rs:24:13:24:21 | source(...) : unit | semmle.label | source(...) : unit | +| main.rs:24:13:24:21 | (...) ... : unit | semmle.label | (...) ... : unit | | main.rs:27:10:27:10 | c | semmle.label | c | -| main.rs:31:13:31:21 | source(...) : unit | semmle.label | source(...) : unit | +| main.rs:31:13:31:21 | (...) ... : unit | semmle.label | (...) ... : unit | | main.rs:36:10:36:10 | b | semmle.label | b | -| main.rs:45:15:45:23 | source(...) : unit | semmle.label | source(...) : unit | +| main.rs:45:15:45:23 | (...) ... : unit | semmle.label | (...) ... : unit | | main.rs:47:10:47:10 | b | semmle.label | b | subpaths testFailures #select -| main.rs:15:10:15:18 | source(...) | main.rs:15:10:15:18 | source(...) | main.rs:15:10:15:18 | source(...) | $@ | main.rs:15:10:15:18 | source(...) | source(...) | -| main.rs:20:10:20:10 | s | main.rs:19:13:19:21 | source(...) : unit | main.rs:20:10:20:10 | s | $@ | main.rs:19:13:19:21 | source(...) : unit | source(...) : unit | -| main.rs:27:10:27:10 | c | main.rs:24:13:24:21 | source(...) : unit | main.rs:27:10:27:10 | c | $@ | main.rs:24:13:24:21 | source(...) : unit | source(...) : unit | -| main.rs:36:10:36:10 | b | main.rs:31:13:31:21 | source(...) : unit | main.rs:36:10:36:10 | b | $@ | main.rs:31:13:31:21 | source(...) : unit | source(...) : unit | -| main.rs:47:10:47:10 | b | main.rs:45:15:45:23 | source(...) : unit | main.rs:47:10:47:10 | b | $@ | main.rs:45:15:45:23 | source(...) : unit | source(...) : unit | +| main.rs:15:10:15:18 | (...) ... | main.rs:15:10:15:18 | (...) ... | main.rs:15:10:15:18 | (...) ... | $@ | main.rs:15:10:15:18 | (...) ... | (...) ... | +| main.rs:20:10:20:10 | s | main.rs:19:13:19:21 | (...) ... : unit | main.rs:20:10:20:10 | s | $@ | main.rs:19:13:19:21 | (...) ... : unit | (...) ... : unit | +| main.rs:27:10:27:10 | c | main.rs:24:13:24:21 | (...) ... : unit | main.rs:27:10:27:10 | c | $@ | main.rs:24:13:24:21 | (...) ... : unit | (...) ... : unit | +| main.rs:36:10:36:10 | b | main.rs:31:13:31:21 | (...) ... : unit | main.rs:36:10:36:10 | b | $@ | main.rs:31:13:31:21 | (...) ... : unit | (...) ... : unit | +| main.rs:47:10:47:10 | b | main.rs:45:15:45:23 | (...) ... : unit | main.rs:47:10:47:10 | b | $@ | main.rs:45:15:45:23 | (...) ... : unit | (...) ... : unit | diff --git a/rust/schema/annotations.py b/rust/schema/annotations.py index d8e9835b16a6..323e946e4f99 100644 --- a/rust/schema/annotations.py +++ b/rust/schema/annotations.py @@ -1,6 +1,19 @@ from misc.codegen.lib.schemadefs import * from .ast import * +class LabelableExpr(Expr): + """ + The base class for expressions that can be labeled (`LoopExpr`, `ForExpr`, `WhileExpr` or `BlockExpr`). + """ + label: optional[Label] | child + +class LoopingExpr(LabelableExpr): + """ + The base class for expressions that loop (`LoopExpr`, `ForExpr` or `WhileExpr`). + """ + loop_body: optional["BlockExpr"] | child + + @annotate(Module) @rust.doc_test_signature(None) @@ -151,7 +164,7 @@ class _: """ -@annotate(BlockExpr) +@annotate(BlockExpr, replace_bases={Expr: LabelableExpr}) class _: """ A block expression. For example: @@ -167,9 +180,10 @@ class _: } ``` """ + label: drop -@annotate(LoopExpr) +@annotate(LoopExpr, replace_bases={Expr: LoopingExpr}) class _: """ A loop expression. For example: @@ -195,6 +209,8 @@ class _: }; ``` """ + label: drop + loop_body: drop class CallExprBase(Expr): @@ -990,7 +1006,7 @@ class _: """ -@annotate(ForExpr) +@annotate(ForExpr, replace_bases={Expr: LoopingExpr}) class _: """ A ForExpr. For example: @@ -998,6 +1014,8 @@ class _: todo!() ``` """ + label: drop + loop_body: drop @annotate(ForType) @@ -1744,7 +1762,7 @@ class _: """ -@annotate(WhileExpr) +@annotate(WhileExpr, replace_bases={Expr: LoopingExpr}) class _: """ A WhileExpr. For example: @@ -1752,6 +1770,8 @@ class _: todo!() ``` """ + label: drop + loop_body: drop @annotate(Function, add_bases=[Callable])