Rust: Handle chained let expressions

This commit is contained in:
Tom Hvitved
2025-08-12 17:18:28 +02:00
parent fd1d9401c0
commit f63e55c1fd
28 changed files with 537 additions and 199 deletions

View File

@@ -7,8 +7,7 @@ private import codeql.rust.controlflow.CfgNodes
private import codeql.rust.internal.CachedStages
private predicate isPostOrder(AstNode n) {
n instanceof Expr and
not n instanceof LetExpr
n instanceof Expr
or
n instanceof OrPat
or

View File

@@ -200,8 +200,7 @@ class TypeReprTree extends LeafTree instanceof TypeRepr { }
/**
* Provides `ControlFlowTree`s for expressions.
*
* Since expressions construct values, they are modeled in post-order, except for
* `LetExpr`s.
* Since expressions construct values, they are modeled in post-order.
*/
module ExprTrees {
class ArrayExprTree extends StandardPostOrderTree, ArrayExpr {
@@ -341,21 +340,15 @@ module ExprTrees {
child = [super.getCondition(), super.getABranch()]
}
private ConditionalCompletion conditionCompletion(Completion c) {
if super.getCondition() instanceof LetExpr
then result = c.(MatchCompletion)
else result = c.(BooleanCompletion)
}
override predicate succ(AstNode pred, AstNode succ, Completion c) {
// Edges from the condition to the branches
last(super.getCondition(), pred, c) and
(
first(super.getThen(), succ) and this.conditionCompletion(c).succeeded()
first(super.getThen(), succ) and c.(ConditionalCompletion).succeeded()
or
first(super.getElse(), succ) and this.conditionCompletion(c).failed()
first(super.getElse(), succ) and c.(ConditionalCompletion).failed()
or
not super.hasElse() and succ = this and this.conditionCompletion(c).failed()
not super.hasElse() and succ = this and c.(ConditionalCompletion).failed()
)
or
// An edge from the then branch to the last node
@@ -401,10 +394,7 @@ module ExprTrees {
}
}
// `LetExpr` is a pre-order tree such that the pattern itself ends up
// dominating successors in the graph in the same way that patterns do in
// `match` expressions.
class LetExprTree extends StandardPreOrderTree, LetExpr {
class LetExprTree extends StandardPostOrderTree, LetExpr {
override AstNode getChildNode(int i) {
i = 0 and
result = this.getScrutinee()
@@ -456,21 +446,15 @@ module ExprTrees {
override predicate first(AstNode node) { first(super.getCondition(), node) }
private ConditionalCompletion conditionCompletion(Completion c) {
if super.getCondition() instanceof LetExpr
then result = c.(MatchCompletion)
else result = c.(BooleanCompletion)
}
override predicate succ(AstNode pred, AstNode succ, Completion c) {
super.succ(pred, succ, c)
or
last(super.getCondition(), pred, c) and
this.conditionCompletion(c).succeeded() and
c.(ConditionalCompletion).succeeded() and
first(this.getLoopBody(), succ)
or
last(super.getCondition(), pred, c) and
this.conditionCompletion(c).failed() and
c.(ConditionalCompletion).failed() and
succ = this
}
}

View File

@@ -71,13 +71,7 @@ module ConditionalCompletionSplitting {
child = parent.(LogicalNotExpr).getExpr() and
childCompletion.getDual() = parentCompletion
or
(
childCompletion = parentCompletion
or
// needed for `let` expressions
childCompletion.(MatchCompletion).getValue() =
parentCompletion.(BooleanCompletion).getValue()
) and
childCompletion = parentCompletion and
(
child = parent.(BinaryLogicalOperation).getAnOperand()
or
@@ -92,6 +86,9 @@ module ConditionalCompletionSplitting {
or
child = parent.(PatternTrees::PostOrderPatTree).getPat(_)
)
or
child = parent.(LetExpr).getPat() and
childCompletion.(MatchCompletion).getValue() = parentCompletion.(BooleanCompletion).getValue()
}
}

View File

@@ -194,9 +194,16 @@ module Ssa {
ae.getRhs() = value
)
or
exists(LetStmtCfgNode ls |
ls.getPat().(IdentPatCfgNode).getName() = write and
ls.getInitializer() = value
exists(IdentPatCfgNode pat | pat.getName() = write |
exists(LetStmtCfgNode ls |
pat = ls.getPat() and
ls.getInitializer() = value
)
or
exists(LetExprCfgNode le |
pat = le.getPat() and
le.getScrutinee() = value
)
)
}

View File

@@ -241,6 +241,12 @@ module LocalFlow {
nodeTo.getCfgNode() = s.getPat()
)
or
// An edge from the right-hand side of a let expression to the left-hand side.
exists(LetExprCfgNode e |
nodeFrom.getCfgNode() = e.getScrutinee() and
nodeTo.getCfgNode() = e.getPat()
)
or
exists(IdentPatCfgNode p |
not p.isRef() and
nodeFrom.getCfgNode() = p and
@@ -379,6 +385,8 @@ module RustDataFlow implements InputSig<Location> {
predicate neverSkipInPathGraph(Node node) {
node.(Node::Node).getCfgNode() = any(LetStmtCfgNode s).getPat()
or
node.(Node::Node).getCfgNode() = any(LetExprCfgNode e).getPat()
or
node.(Node::Node).getCfgNode() = any(AssignmentExprCfgNode a).getLhs()
or
exists(MatchExprCfgNode match |
@@ -899,6 +907,12 @@ module VariableCapture {
v.getPat() = ls.getPat().getPat() and
ls.getInitializer() = source
)
or
exists(LetExprCfgNode le |
this = le and
v.getPat() = le.getPat().getPat() and
le.getScrutinee() = source
)
}
CapturedVariable getVariable() { result = v }

View File

@@ -1,6 +1,6 @@
private import rust
private import codeql.rust.controlflow.ControlFlowGraph
private import codeql.rust.elements.internal.generated.ParentChild
private import codeql.rust.elements.internal.generated.ParentChild as ParentChild
private import codeql.rust.elements.internal.PathImpl::Impl as PathImpl
private import codeql.rust.elements.internal.PathExprBaseImpl::Impl as PathExprBaseImpl
private import codeql.rust.elements.internal.FormatTemplateVariableAccessImpl::Impl as FormatTemplateVariableAccessImpl
@@ -36,6 +36,38 @@ module Impl {
ClosureBodyScope() { this = any(ClosureExpr ce).getBody() }
}
/**
* A scope for conditions, which may introduce variables using `let` expressions.
*
* Such variables are only available in the body guarded by the condition.
*/
class ConditionScope extends VariableScope, Expr {
private AstNode parent;
private AstNode body;
ConditionScope() {
parent =
any(IfExpr ie |
this = ie.getCondition() and
body = ie.getThen()
)
or
parent =
any(WhileExpr we |
this = we.getCondition() and
body = we.getLoopBody()
)
}
/** Gets the parent of this condition. */
AstNode getParent() { result = parent }
/**
* Gets the body in which variables introduced in this scope are available.
*/
AstNode getBody() { result = body }
}
private Pat getAPatAncestor(Pat p) {
(p instanceof IdentPat or p instanceof OrPat) and
exists(Pat p0 | result = p0.getParentPat() |
@@ -152,8 +184,14 @@ module Impl {
/** Gets the `let` statement that introduces this variable, if any. */
LetStmt getLetStmt() { this.getPat() = result.getPat() }
/** Gets the `let` expression that introduces this variable, if any. */
LetExpr getLetExpr() { this.getPat() = result.getPat() }
/** Gets the initial value of this variable, if any. */
Expr getInitializer() { result = this.getLetStmt().getInitializer() }
Expr getInitializer() {
result = this.getLetStmt().getInitializer() or
result = this.getLetExpr().getScrutinee()
}
/** Holds if this variable is captured. */
predicate isCaptured() { this.getAnAccess().isCapture() }
@@ -193,15 +231,53 @@ module Impl {
string getName() { result = name_ }
}
pragma[nomagic]
private Element getImmediateChildAdj(Element e, int preOrd, int index) {
result = ParentChild::getImmediateChild(e, index) and
preOrd = 0 and
not exists(ConditionScope cs |
e = cs.getParent() and
result = cs.getBody()
)
or
result = e.(ConditionScope).getBody() and
preOrd = 1 and
index = 0
}
/**
* An adjusted version of `ParentChild::getImmediateChild`, which makes the following
* two adjustments:
*
* 1. For conditions like `if cond body`, instead of letting `body` be the second child
* of `if`, we make it the last child of `cond`. This ensures that variables
* introduced in the `cond` scope are available in `body`.
*
* 2. A similar adjustment is made for `while` loops: the body of the loop is made a
* child of the loop condition instead of the loop itself.
*/
pragma[nomagic]
private Element getImmediateChildAdj(Element e, int index) {
result =
rank[index + 1](Element res, int preOrd, int i |
res = getImmediateChildAdj(e, preOrd, i)
|
res order by preOrd, i
)
}
private Element getImmediateParentAdj(Element e) { e = getImmediateChildAdj(result, _) }
private AstNode getAnAncestorInVariableScope(AstNode n) {
(
n instanceof Pat or
n instanceof VariableAccessCand or
n instanceof LetStmt or
n = any(LetExpr le).getScrutinee() or
n instanceof VariableScope
) and
exists(AstNode n0 |
result = getImmediateParent(n0) or
result = getImmediateParentAdj(n0) or
result = n0.(FormatTemplateVariableAccess).getArgument().getParent().getParent()
|
n0 = n
@@ -243,14 +319,15 @@ module Impl {
this instanceof VariableScope or
this instanceof VariableAccessCand or
this instanceof LetStmt or
getImmediateChild(this, _) instanceof RelevantElement
this = any(LetExpr le).getScrutinee() or
getImmediateChildAdj(this, _) instanceof RelevantElement
}
pragma[nomagic]
private RelevantElement getChild(int index) { result = getImmediateChild(this, index) }
private RelevantElement getChild(int index) { result = getImmediateChildAdj(this, index) }
pragma[nomagic]
private RelevantElement getImmediateChildMin(int index) {
private RelevantElement getImmediateChildAdjMin(int index) {
// A child may have multiple positions for different accessors,
// so always use the first
result = this.getChild(index) and
@@ -258,16 +335,16 @@ module Impl {
}
pragma[nomagic]
RelevantElement getImmediateChild(int index) {
RelevantElement getImmediateChildAdj(int index) {
result =
rank[index + 1](Element res, int i | res = this.getImmediateChildMin(i) | res order by i)
rank[index + 1](Element res, int i | res = this.getImmediateChildAdjMin(i) | res order by i)
}
pragma[nomagic]
RelevantElement getImmediateLastChild() {
exists(int last |
result = this.getImmediateChild(last) and
not exists(this.getImmediateChild(last + 1))
result = this.getImmediateChildAdj(last) and
not exists(this.getImmediateChildAdj(last + 1))
)
}
}
@@ -288,13 +365,13 @@ module Impl {
|
// first child of a previously numbered node
result = getPreOrderNumbering(scope, parent) + 1 and
n = parent.getImmediateChild(0)
n = parent.getImmediateChildAdj(0)
or
// non-first child of a previously numbered node
exists(RelevantElement child, int i |
result = getLastPreOrderNumbering(scope, child) + 1 and
child = parent.getImmediateChild(i) and
n = parent.getImmediateChild(i + 1)
child = parent.getImmediateChildAdj(i) and
n = parent.getImmediateChildAdj(i + 1)
)
)
}
@@ -309,7 +386,7 @@ module Impl {
result = getPreOrderNumbering(scope, leaf) and
leaf != scope and
(
not exists(leaf.getImmediateChild(_))
not exists(leaf.getImmediateChildAdj(_))
or
leaf instanceof VariableScope
)
@@ -331,7 +408,7 @@ module Impl {
/**
* Holds if `v` is named `name` and is declared inside variable scope
* `scope`. The pre-order numbering of the binding site of `v`, amongst
* all nodes nester under `scope`, is `ord`.
* all nodes nested under `scope`, is `ord`.
*/
private predicate variableDeclInScope(Variable v, VariableScope scope, string name, int ord) {
name = v.getText() and
@@ -354,11 +431,13 @@ module Impl {
ord = getLastPreOrderNumbering(scope, let) + 1
)
or
exists(IfExpr ie, LetExpr let |
exists(LetExpr let, Expr scrutinee |
let.getPat() = pat and
ie.getCondition() = let and
scope = ie.getThen() and
ord = getPreOrderNumbering(scope, scope)
scrutinee = let.getScrutinee() and
scope = getEnclosingScope(scrutinee) and
// for `let` expressions, variables are bound _after_ the expression, i.e.
// not in the RHS
ord = getLastPreOrderNumbering(scope, scrutinee) + 1
)
or
exists(ForExpr fe |
@@ -366,13 +445,6 @@ module Impl {
scope = fe.getLoopBody() and
ord = getPreOrderNumbering(scope, scope)
)
or
exists(WhileExpr we, LetExpr let |
let.getPat() = pat and
we.getCondition() = let and
scope = we.getLoopBody() and
ord = getPreOrderNumbering(scope, scope)
)
)
)
}
@@ -612,7 +684,7 @@ module Impl {
or
exists(Expr mid |
assignmentExprDescendant(mid) and
getImmediateParent(e) = mid and
getImmediateParentAdj(e) = mid and
not mid instanceof DerefExpr and
not mid instanceof FieldExpr and
not mid instanceof IndexExpr

View File

@@ -328,6 +328,11 @@ private module CertainTypeInference {
let.getInitializer() = n2
)
or
exists(LetExpr let |
let.getPat() = n1 and
let.getScrutinee() = n2
)
or
n1 = n2.(ParenExpr).getExpr()
)
or
@@ -466,11 +471,6 @@ private predicate typeEquality(AstNode n1, TypePath prefix1, AstNode n2, TypePat
or
n1 = n2.(MatchExpr).getAnArm().getExpr()
or
exists(LetExpr let |
n1 = let.getScrutinee() and
n2 = let.getPat()
)
or
exists(MatchExpr me |
n1 = me.getScrutinee() and
n2 = me.getAnArm().getPat()

View File

@@ -13,13 +13,14 @@ edges
| test.rs:5:67:11:5 | { ... } | test.rs:5:5:11:5 | exit fn test_and_if_let (normal) | |
| test.rs:6:9:10:9 | if ... {...} else {...} | test.rs:5:67:11:5 | { ... } | |
| test.rs:6:12:6:12 | a | test.rs:6:12:6:31 | [boolean(false)] ... && ... | false |
| test.rs:6:12:6:12 | a | test.rs:6:17:6:31 | let ... = b | true |
| test.rs:6:12:6:12 | a | test.rs:6:31:6:31 | b | true |
| test.rs:6:12:6:31 | [boolean(false)] ... && ... | test.rs:9:13:9:17 | false | false |
| test.rs:6:12:6:31 | [boolean(true)] ... && ... | test.rs:7:13:7:13 | d | true |
| test.rs:6:17:6:31 | let ... = b | test.rs:6:31:6:31 | b | |
| test.rs:6:21:6:27 | Some(...) | test.rs:6:12:6:31 | [boolean(false)] ... && ... | no-match |
| test.rs:6:17:6:31 | [boolean(false)] let ... = b | test.rs:6:12:6:31 | [boolean(false)] ... && ... | false |
| test.rs:6:17:6:31 | [boolean(true)] let ... = b | test.rs:6:12:6:31 | [boolean(true)] ... && ... | true |
| test.rs:6:21:6:27 | Some(...) | test.rs:6:17:6:31 | [boolean(false)] let ... = b | no-match |
| test.rs:6:21:6:27 | Some(...) | test.rs:6:26:6:26 | d | match |
| test.rs:6:26:6:26 | d | test.rs:6:12:6:31 | [boolean(true)] ... && ... | match |
| test.rs:6:26:6:26 | d | test.rs:6:17:6:31 | [boolean(true)] let ... = b | match |
| test.rs:6:26:6:26 | d | test.rs:6:26:6:26 | d | |
| test.rs:6:31:6:31 | b | test.rs:6:21:6:27 | Some(...) | |
| test.rs:6:33:8:9 | { ... } | test.rs:6:9:10:9 | if ... {...} else {...} | |
@@ -40,13 +41,13 @@ edges
| test.rs:13:59:21:5 | { ... } | test.rs:13:5:21:5 | exit fn test_and_if_let2 (normal) | |
| test.rs:14:9:20:9 | if ... {...} else {...} | test.rs:13:59:21:5 | { ... } | |
| test.rs:14:12:14:12 | a | test.rs:14:12:14:25 | [boolean(false)] ... && ... | false |
| test.rs:14:12:14:12 | a | test.rs:14:17:14:25 | let ... = b | true |
| test.rs:14:12:14:12 | a | test.rs:14:25:14:25 | b | true |
| test.rs:14:12:14:25 | [boolean(false)] ... && ... | test.rs:14:12:15:16 | [boolean(false)] ... && ... | false |
| test.rs:14:12:14:25 | [boolean(true)] ... && ... | test.rs:15:16:15:16 | c | true |
| test.rs:14:12:15:16 | [boolean(false)] ... && ... | test.rs:19:13:19:17 | false | false |
| test.rs:14:12:15:16 | [boolean(true)] ... && ... | test.rs:17:13:17:13 | d | true |
| test.rs:14:17:14:25 | let ... = b | test.rs:14:25:14:25 | b | |
| test.rs:14:21:14:21 | d | test.rs:14:12:14:25 | [boolean(true)] ... && ... | match |
| test.rs:14:17:14:25 | [boolean(true)] let ... = b | test.rs:14:12:14:25 | [boolean(true)] ... && ... | true |
| test.rs:14:21:14:21 | d | test.rs:14:17:14:25 | [boolean(true)] let ... = b | match |
| test.rs:14:21:14:21 | d | test.rs:14:21:14:21 | d | |
| test.rs:14:25:14:25 | b | test.rs:14:21:14:21 | d | |
| test.rs:15:16:15:16 | c | test.rs:14:12:15:16 | [boolean(false)] ... && ... | false |

View File

@@ -118,20 +118,29 @@ dominates
| test.rs:91:17:91:22 | ExprStmt | test.rs:91:17:91:22 | ExprStmt |
| test.rs:97:5:104:5 | enter fn test_while_let | test.rs:97:5:104:5 | enter fn test_while_let |
| test.rs:97:5:104:5 | enter fn test_while_let | test.rs:99:9:103:9 | while ... { ... } |
| test.rs:97:5:104:5 | enter fn test_while_let | test.rs:99:15:99:39 | let ... = ... |
| test.rs:97:5:104:5 | enter fn test_while_let | test.rs:99:15:99:39 | [boolean(false)] let ... = ... |
| test.rs:97:5:104:5 | enter fn test_while_let | test.rs:99:24:99:24 | x |
| test.rs:97:5:104:5 | enter fn test_while_let | test.rs:99:29:99:32 | iter |
| test.rs:97:5:104:5 | enter fn test_while_let | test.rs:100:13:102:13 | if ... {...} |
| test.rs:97:5:104:5 | enter fn test_while_let | test.rs:100:17:100:17 | x |
| test.rs:97:5:104:5 | enter fn test_while_let | test.rs:101:17:101:22 | ExprStmt |
| test.rs:99:9:103:9 | while ... { ... } | test.rs:99:9:103:9 | while ... { ... } |
| test.rs:99:15:99:39 | let ... = ... | test.rs:99:9:103:9 | while ... { ... } |
| test.rs:99:15:99:39 | let ... = ... | test.rs:99:15:99:39 | let ... = ... |
| test.rs:99:15:99:39 | let ... = ... | test.rs:99:24:99:24 | x |
| test.rs:99:15:99:39 | let ... = ... | test.rs:100:13:102:13 | if ... {...} |
| test.rs:99:15:99:39 | let ... = ... | test.rs:101:17:101:22 | ExprStmt |
| test.rs:99:15:99:39 | [boolean(false)] let ... = ... | test.rs:99:15:99:39 | [boolean(false)] let ... = ... |
| test.rs:99:24:99:24 | x | test.rs:99:24:99:24 | x |
| test.rs:99:24:99:24 | x | test.rs:100:13:102:13 | if ... {...} |
| test.rs:99:24:99:24 | x | test.rs:100:17:100:17 | x |
| test.rs:99:24:99:24 | x | test.rs:101:17:101:22 | ExprStmt |
| test.rs:99:29:99:32 | iter | test.rs:99:9:103:9 | while ... { ... } |
| test.rs:99:29:99:32 | iter | test.rs:99:15:99:39 | [boolean(false)] let ... = ... |
| test.rs:99:29:99:32 | iter | test.rs:99:24:99:24 | x |
| test.rs:99:29:99:32 | iter | test.rs:99:29:99:32 | iter |
| test.rs:99:29:99:32 | iter | test.rs:100:13:102:13 | if ... {...} |
| test.rs:99:29:99:32 | iter | test.rs:100:17:100:17 | x |
| test.rs:99:29:99:32 | iter | test.rs:101:17:101:22 | ExprStmt |
| test.rs:100:13:102:13 | if ... {...} | test.rs:100:13:102:13 | if ... {...} |
| test.rs:100:17:100:17 | x | test.rs:100:13:102:13 | if ... {...} |
| test.rs:100:17:100:17 | x | test.rs:100:17:100:17 | x |
| test.rs:100:17:100:17 | x | test.rs:101:17:101:22 | ExprStmt |
| test.rs:101:17:101:22 | ExprStmt | test.rs:101:17:101:22 | ExprStmt |
| test.rs:106:5:113:5 | enter fn test_for | test.rs:106:5:113:5 | enter fn test_for |
| test.rs:106:5:113:5 | enter fn test_for | test.rs:107:9:112:9 | for ... in ... { ... } |
@@ -167,18 +176,30 @@ dominates
| test.rs:140:13:140:19 | ExprStmt | test.rs:140:13:140:19 | ExprStmt |
| test.rs:145:5:151:5 | enter fn test_if_let_else | test.rs:145:5:151:5 | enter fn test_if_let_else |
| test.rs:145:5:151:5 | enter fn test_if_let_else | test.rs:146:9:150:9 | if ... {...} else {...} |
| test.rs:145:5:151:5 | enter fn test_if_let_else | test.rs:146:12:146:26 | [boolean(false)] let ... = a |
| test.rs:145:5:151:5 | enter fn test_if_let_else | test.rs:146:21:146:21 | n |
| test.rs:145:5:151:5 | enter fn test_if_let_else | test.rs:147:13:147:13 | n |
| test.rs:145:5:151:5 | enter fn test_if_let_else | test.rs:149:13:149:13 | 0 |
| test.rs:146:9:150:9 | if ... {...} else {...} | test.rs:146:9:150:9 | if ... {...} else {...} |
| test.rs:146:12:146:26 | [boolean(false)] let ... = a | test.rs:146:12:146:26 | [boolean(false)] let ... = a |
| test.rs:146:12:146:26 | [boolean(false)] let ... = a | test.rs:149:13:149:13 | 0 |
| test.rs:146:21:146:21 | n | test.rs:146:21:146:21 | n |
| test.rs:146:21:146:21 | n | test.rs:147:13:147:13 | n |
| test.rs:147:13:147:13 | n | test.rs:147:13:147:13 | n |
| test.rs:149:13:149:13 | 0 | test.rs:149:13:149:13 | 0 |
| test.rs:153:5:158:5 | enter fn test_if_let | test.rs:153:5:158:5 | enter fn test_if_let |
| test.rs:153:5:158:5 | enter fn test_if_let | test.rs:153:5:158:5 | exit fn test_if_let (normal) |
| test.rs:153:5:158:5 | enter fn test_if_let | test.rs:154:9:156:9 | if ... {...} |
| test.rs:153:5:158:5 | enter fn test_if_let | test.rs:154:12:154:26 | [boolean(false)] let ... = a |
| test.rs:153:5:158:5 | enter fn test_if_let | test.rs:154:21:154:21 | n |
| test.rs:153:5:158:5 | enter fn test_if_let | test.rs:155:13:155:21 | ExprStmt |
| test.rs:153:5:158:5 | exit fn test_if_let (normal) | test.rs:153:5:158:5 | exit fn test_if_let (normal) |
| test.rs:154:9:156:9 | if ... {...} | test.rs:154:9:156:9 | if ... {...} |
| test.rs:154:12:154:26 | [boolean(false)] let ... = a | test.rs:154:9:156:9 | if ... {...} |
| test.rs:154:12:154:26 | [boolean(false)] let ... = a | test.rs:154:12:154:26 | [boolean(false)] let ... = a |
| test.rs:154:21:154:21 | n | test.rs:154:21:154:21 | n |
| test.rs:154:21:154:21 | n | test.rs:155:13:155:21 | ExprStmt |
| test.rs:155:13:155:21 | ExprStmt | test.rs:155:13:155:21 | ExprStmt |
| test.rs:160:5:166:5 | enter fn test_nested_if | test.rs:160:5:166:5 | enter fn test_nested_if |
| test.rs:160:5:166:5 | enter fn test_nested_if | test.rs:161:9:165:9 | if ... {...} else {...} |
| test.rs:160:5:166:5 | enter fn test_nested_if | test.rs:161:13:161:48 | [boolean(false)] if ... {...} else {...} |
@@ -847,15 +868,20 @@ postDominance
| test.rs:97:5:104:5 | enter fn test_while_let | test.rs:97:5:104:5 | enter fn test_while_let |
| test.rs:99:9:103:9 | while ... { ... } | test.rs:97:5:104:5 | enter fn test_while_let |
| test.rs:99:9:103:9 | while ... { ... } | test.rs:99:9:103:9 | while ... { ... } |
| test.rs:99:9:103:9 | while ... { ... } | test.rs:99:15:99:39 | let ... = ... |
| test.rs:99:9:103:9 | while ... { ... } | test.rs:99:15:99:39 | [boolean(false)] let ... = ... |
| test.rs:99:9:103:9 | while ... { ... } | test.rs:99:24:99:24 | x |
| test.rs:99:9:103:9 | while ... { ... } | test.rs:99:29:99:32 | iter |
| test.rs:99:9:103:9 | while ... { ... } | test.rs:100:13:102:13 | if ... {...} |
| test.rs:99:9:103:9 | while ... { ... } | test.rs:100:17:100:17 | x |
| test.rs:99:9:103:9 | while ... { ... } | test.rs:101:17:101:22 | ExprStmt |
| test.rs:99:15:99:39 | let ... = ... | test.rs:97:5:104:5 | enter fn test_while_let |
| test.rs:99:15:99:39 | let ... = ... | test.rs:99:15:99:39 | let ... = ... |
| test.rs:99:15:99:39 | let ... = ... | test.rs:100:13:102:13 | if ... {...} |
| test.rs:99:15:99:39 | [boolean(false)] let ... = ... | test.rs:99:15:99:39 | [boolean(false)] let ... = ... |
| test.rs:99:24:99:24 | x | test.rs:99:24:99:24 | x |
| test.rs:99:29:99:32 | iter | test.rs:97:5:104:5 | enter fn test_while_let |
| test.rs:99:29:99:32 | iter | test.rs:99:29:99:32 | iter |
| test.rs:99:29:99:32 | iter | test.rs:100:13:102:13 | if ... {...} |
| test.rs:100:13:102:13 | if ... {...} | test.rs:100:13:102:13 | if ... {...} |
| test.rs:100:17:100:17 | x | test.rs:99:24:99:24 | x |
| test.rs:100:17:100:17 | x | test.rs:100:17:100:17 | x |
| test.rs:101:17:101:22 | ExprStmt | test.rs:101:17:101:22 | ExprStmt |
| test.rs:106:5:113:5 | enter fn test_for | test.rs:106:5:113:5 | enter fn test_for |
| test.rs:107:9:112:9 | for ... in ... { ... } | test.rs:106:5:113:5 | enter fn test_for |
@@ -888,17 +914,29 @@ postDominance
| test.rs:145:5:151:5 | enter fn test_if_let_else | test.rs:145:5:151:5 | enter fn test_if_let_else |
| test.rs:146:9:150:9 | if ... {...} else {...} | test.rs:145:5:151:5 | enter fn test_if_let_else |
| test.rs:146:9:150:9 | if ... {...} else {...} | test.rs:146:9:150:9 | if ... {...} else {...} |
| test.rs:146:9:150:9 | if ... {...} else {...} | test.rs:146:12:146:26 | [boolean(false)] let ... = a |
| test.rs:146:9:150:9 | if ... {...} else {...} | test.rs:146:21:146:21 | n |
| test.rs:146:9:150:9 | if ... {...} else {...} | test.rs:147:13:147:13 | n |
| test.rs:146:9:150:9 | if ... {...} else {...} | test.rs:149:13:149:13 | 0 |
| test.rs:146:12:146:26 | [boolean(false)] let ... = a | test.rs:146:12:146:26 | [boolean(false)] let ... = a |
| test.rs:146:21:146:21 | n | test.rs:146:21:146:21 | n |
| test.rs:147:13:147:13 | n | test.rs:146:21:146:21 | n |
| test.rs:147:13:147:13 | n | test.rs:147:13:147:13 | n |
| test.rs:149:13:149:13 | 0 | test.rs:146:12:146:26 | [boolean(false)] let ... = a |
| test.rs:149:13:149:13 | 0 | test.rs:149:13:149:13 | 0 |
| test.rs:153:5:158:5 | enter fn test_if_let | test.rs:153:5:158:5 | enter fn test_if_let |
| test.rs:153:5:158:5 | exit fn test_if_let (normal) | test.rs:153:5:158:5 | enter fn test_if_let |
| test.rs:153:5:158:5 | exit fn test_if_let (normal) | test.rs:153:5:158:5 | exit fn test_if_let (normal) |
| test.rs:153:5:158:5 | exit fn test_if_let (normal) | test.rs:154:9:156:9 | if ... {...} |
| test.rs:153:5:158:5 | exit fn test_if_let (normal) | test.rs:154:12:154:26 | [boolean(false)] let ... = a |
| test.rs:153:5:158:5 | exit fn test_if_let (normal) | test.rs:154:21:154:21 | n |
| test.rs:153:5:158:5 | exit fn test_if_let (normal) | test.rs:155:13:155:21 | ExprStmt |
| test.rs:154:9:156:9 | if ... {...} | test.rs:154:9:156:9 | if ... {...} |
| test.rs:154:9:156:9 | if ... {...} | test.rs:154:12:154:26 | [boolean(false)] let ... = a |
| test.rs:154:12:154:26 | [boolean(false)] let ... = a | test.rs:154:12:154:26 | [boolean(false)] let ... = a |
| test.rs:154:21:154:21 | n | test.rs:154:21:154:21 | n |
| test.rs:155:13:155:21 | ExprStmt | test.rs:154:21:154:21 | n |
| test.rs:155:13:155:21 | ExprStmt | test.rs:155:13:155:21 | ExprStmt |
| test.rs:160:5:166:5 | enter fn test_nested_if | test.rs:160:5:166:5 | enter fn test_nested_if |
| test.rs:161:9:165:9 | if ... {...} else {...} | test.rs:160:5:166:5 | enter fn test_nested_if |
| test.rs:161:9:165:9 | if ... {...} else {...} | test.rs:161:9:165:9 | if ... {...} else {...} |
@@ -1462,11 +1500,13 @@ immediateDominator
| test.rs:89:13:89:14 | ExprStmt | test.rs:88:15:88:15 | b |
| test.rs:90:13:92:13 | if ... {...} | test.rs:89:13:89:14 | ExprStmt |
| test.rs:91:17:91:22 | ExprStmt | test.rs:89:13:89:14 | ExprStmt |
| test.rs:99:9:103:9 | while ... { ... } | test.rs:99:15:99:39 | let ... = ... |
| test.rs:99:15:99:39 | let ... = ... | test.rs:97:5:104:5 | enter fn test_while_let |
| test.rs:99:24:99:24 | x | test.rs:99:15:99:39 | let ... = ... |
| test.rs:100:13:102:13 | if ... {...} | test.rs:99:24:99:24 | x |
| test.rs:101:17:101:22 | ExprStmt | test.rs:99:24:99:24 | x |
| test.rs:99:9:103:9 | while ... { ... } | test.rs:99:29:99:32 | iter |
| test.rs:99:15:99:39 | [boolean(false)] let ... = ... | test.rs:99:29:99:32 | iter |
| test.rs:99:24:99:24 | x | test.rs:99:29:99:32 | iter |
| test.rs:99:29:99:32 | iter | test.rs:97:5:104:5 | enter fn test_while_let |
| test.rs:100:13:102:13 | if ... {...} | test.rs:100:17:100:17 | x |
| test.rs:100:17:100:17 | x | test.rs:99:24:99:24 | x |
| test.rs:101:17:101:22 | ExprStmt | test.rs:100:17:100:17 | x |
| test.rs:107:9:112:9 | for ... in ... { ... } | test.rs:107:13:107:13 | i |
| test.rs:107:13:107:13 | i | test.rs:106:5:113:5 | enter fn test_for |
| test.rs:108:13:110:13 | ExprStmt | test.rs:107:13:107:13 | i |
@@ -1478,11 +1518,15 @@ immediateDominator
| test.rs:139:9:141:9 | if b {...} | test.rs:137:5:143:5 | enter fn test_if_without_else |
| test.rs:140:13:140:19 | ExprStmt | test.rs:137:5:143:5 | enter fn test_if_without_else |
| test.rs:146:9:150:9 | if ... {...} else {...} | test.rs:145:5:151:5 | enter fn test_if_let_else |
| test.rs:146:12:146:26 | [boolean(false)] let ... = a | test.rs:145:5:151:5 | enter fn test_if_let_else |
| test.rs:146:21:146:21 | n | test.rs:145:5:151:5 | enter fn test_if_let_else |
| test.rs:149:13:149:13 | 0 | test.rs:145:5:151:5 | enter fn test_if_let_else |
| test.rs:147:13:147:13 | n | test.rs:146:21:146:21 | n |
| test.rs:149:13:149:13 | 0 | test.rs:146:12:146:26 | [boolean(false)] let ... = a |
| test.rs:153:5:158:5 | exit fn test_if_let (normal) | test.rs:153:5:158:5 | enter fn test_if_let |
| test.rs:154:9:156:9 | if ... {...} | test.rs:153:5:158:5 | enter fn test_if_let |
| test.rs:154:9:156:9 | if ... {...} | test.rs:154:12:154:26 | [boolean(false)] let ... = a |
| test.rs:154:12:154:26 | [boolean(false)] let ... = a | test.rs:153:5:158:5 | enter fn test_if_let |
| test.rs:154:21:154:21 | n | test.rs:153:5:158:5 | enter fn test_if_let |
| test.rs:155:13:155:21 | ExprStmt | test.rs:154:21:154:21 | n |
| test.rs:161:9:165:9 | if ... {...} else {...} | test.rs:160:5:166:5 | enter fn test_nested_if |
| test.rs:161:13:161:48 | [boolean(false)] if ... {...} else {...} | test.rs:160:5:166:5 | enter fn test_nested_if |
| test.rs:161:13:161:48 | [boolean(true)] if ... {...} else {...} | test.rs:160:5:166:5 | enter fn test_nested_if |
@@ -1721,13 +1765,20 @@ controls
| test.rs:88:15:88:15 | b | test.rs:91:17:91:22 | ExprStmt | true |
| test.rs:89:13:89:14 | ExprStmt | test.rs:90:13:92:13 | if ... {...} | false |
| test.rs:89:13:89:14 | ExprStmt | test.rs:91:17:91:22 | ExprStmt | true |
| test.rs:99:24:99:24 | x | test.rs:100:13:102:13 | if ... {...} | false |
| test.rs:99:24:99:24 | x | test.rs:100:13:102:13 | if ... {...} | true |
| test.rs:99:24:99:24 | x | test.rs:100:17:100:17 | x | true |
| test.rs:99:24:99:24 | x | test.rs:101:17:101:22 | ExprStmt | true |
| test.rs:100:17:100:17 | x | test.rs:100:13:102:13 | if ... {...} | false |
| test.rs:100:17:100:17 | x | test.rs:101:17:101:22 | ExprStmt | true |
| test.rs:108:13:110:13 | ExprStmt | test.rs:108:13:110:13 | if ... {...} | false |
| test.rs:108:13:110:13 | ExprStmt | test.rs:109:17:109:22 | ExprStmt | true |
| test.rs:129:5:135:5 | enter fn test_if_else | test.rs:131:13:131:13 | 0 | true |
| test.rs:129:5:135:5 | enter fn test_if_else | test.rs:133:13:133:13 | n | false |
| test.rs:137:5:143:5 | enter fn test_if_without_else | test.rs:140:13:140:19 | ExprStmt | true |
| test.rs:146:12:146:26 | [boolean(false)] let ... = a | test.rs:149:13:149:13 | 0 | false |
| test.rs:146:21:146:21 | n | test.rs:147:13:147:13 | n | true |
| test.rs:154:12:154:26 | [boolean(false)] let ... = a | test.rs:154:9:156:9 | if ... {...} | false |
| test.rs:154:21:154:21 | n | test.rs:155:13:155:21 | ExprStmt | true |
| test.rs:160:5:166:5 | enter fn test_nested_if | test.rs:161:22:161:32 | [boolean(false)] { ... } | true |
| test.rs:160:5:166:5 | enter fn test_nested_if | test.rs:161:22:161:32 | [boolean(true)] { ... } | true |
| test.rs:160:5:166:5 | enter fn test_nested_if | test.rs:161:24:161:24 | a | true |
@@ -1911,14 +1962,20 @@ successor
| test.rs:88:15:88:15 | b | test.rs:89:13:89:14 | ExprStmt | true |
| test.rs:89:13:89:14 | ExprStmt | test.rs:90:13:92:13 | if ... {...} | false |
| test.rs:89:13:89:14 | ExprStmt | test.rs:91:17:91:22 | ExprStmt | true |
| test.rs:99:24:99:24 | x | test.rs:100:13:102:13 | if ... {...} | false |
| test.rs:99:24:99:24 | x | test.rs:101:17:101:22 | ExprStmt | true |
| test.rs:99:15:99:39 | [boolean(false)] let ... = ... | test.rs:99:9:103:9 | while ... { ... } | false |
| test.rs:99:24:99:24 | x | test.rs:100:17:100:17 | x | true |
| test.rs:100:17:100:17 | x | test.rs:100:13:102:13 | if ... {...} | false |
| test.rs:100:17:100:17 | x | test.rs:101:17:101:22 | ExprStmt | true |
| test.rs:108:13:110:13 | ExprStmt | test.rs:108:13:110:13 | if ... {...} | false |
| test.rs:108:13:110:13 | ExprStmt | test.rs:109:17:109:22 | ExprStmt | true |
| test.rs:129:5:135:5 | enter fn test_if_else | test.rs:131:13:131:13 | 0 | true |
| test.rs:129:5:135:5 | enter fn test_if_else | test.rs:133:13:133:13 | n | false |
| test.rs:137:5:143:5 | enter fn test_if_without_else | test.rs:139:9:141:9 | if b {...} | false |
| test.rs:137:5:143:5 | enter fn test_if_without_else | test.rs:140:13:140:19 | ExprStmt | true |
| test.rs:146:12:146:26 | [boolean(false)] let ... = a | test.rs:149:13:149:13 | 0 | false |
| test.rs:146:21:146:21 | n | test.rs:147:13:147:13 | n | true |
| test.rs:154:12:154:26 | [boolean(false)] let ... = a | test.rs:154:9:156:9 | if ... {...} | false |
| test.rs:154:21:154:21 | n | test.rs:155:13:155:21 | ExprStmt | true |
| test.rs:160:5:166:5 | enter fn test_nested_if | test.rs:161:24:161:24 | a | true |
| test.rs:160:5:166:5 | enter fn test_nested_if | test.rs:161:41:161:41 | a | false |
| test.rs:161:13:161:48 | [boolean(false)] if ... {...} else {...} | test.rs:164:13:164:13 | 0 | false |
@@ -2058,10 +2115,10 @@ joinBlockPredecessor
| test.rs:88:9:94:9 | while b { ... } | test.rs:91:17:91:22 | ExprStmt | 1 |
| test.rs:88:15:88:15 | b | test.rs:86:5:95:5 | enter fn test_while | 1 |
| test.rs:88:15:88:15 | b | test.rs:90:13:92:13 | if ... {...} | 0 |
| test.rs:99:9:103:9 | while ... { ... } | test.rs:99:15:99:39 | let ... = ... | 0 |
| test.rs:99:9:103:9 | while ... { ... } | test.rs:99:15:99:39 | [boolean(false)] let ... = ... | 0 |
| test.rs:99:9:103:9 | while ... { ... } | test.rs:101:17:101:22 | ExprStmt | 1 |
| test.rs:99:15:99:39 | let ... = ... | test.rs:97:5:104:5 | enter fn test_while_let | 1 |
| test.rs:99:15:99:39 | let ... = ... | test.rs:100:13:102:13 | if ... {...} | 0 |
| test.rs:99:29:99:32 | iter | test.rs:97:5:104:5 | enter fn test_while_let | 1 |
| test.rs:99:29:99:32 | iter | test.rs:100:13:102:13 | if ... {...} | 0 |
| test.rs:107:9:112:9 | for ... in ... { ... } | test.rs:107:13:107:13 | i | 1 |
| test.rs:107:9:112:9 | for ... in ... { ... } | test.rs:109:17:109:22 | ExprStmt | 0 |
| test.rs:107:13:107:13 | i | test.rs:106:5:113:5 | enter fn test_for | 1 |
@@ -2070,10 +2127,10 @@ joinBlockPredecessor
| test.rs:130:9:134:9 | if ... {...} else {...} | test.rs:133:13:133:13 | n | 0 |
| test.rs:139:9:141:9 | if b {...} | test.rs:137:5:143:5 | enter fn test_if_without_else | 1 |
| test.rs:139:9:141:9 | if b {...} | test.rs:140:13:140:19 | ExprStmt | 0 |
| test.rs:146:9:150:9 | if ... {...} else {...} | test.rs:146:21:146:21 | n | 0 |
| test.rs:146:9:150:9 | if ... {...} else {...} | test.rs:149:13:149:13 | 0 | 1 |
| test.rs:146:9:150:9 | if ... {...} else {...} | test.rs:147:13:147:13 | n | 1 |
| test.rs:146:9:150:9 | if ... {...} else {...} | test.rs:149:13:149:13 | 0 | 0 |
| test.rs:153:5:158:5 | exit fn test_if_let (normal) | test.rs:154:9:156:9 | if ... {...} | 1 |
| test.rs:153:5:158:5 | exit fn test_if_let (normal) | test.rs:154:21:154:21 | n | 0 |
| test.rs:153:5:158:5 | exit fn test_if_let (normal) | test.rs:155:13:155:21 | ExprStmt | 0 |
| test.rs:161:9:165:9 | if ... {...} else {...} | test.rs:162:13:162:13 | 1 | 1 |
| test.rs:161:9:165:9 | if ... {...} else {...} | test.rs:164:13:164:13 | 0 | 0 |
| test.rs:161:13:161:48 | [boolean(false)] if ... {...} else {...} | test.rs:161:22:161:32 | [boolean(false)] { ... } | 1 |

View File

@@ -194,20 +194,21 @@ edges
| 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 ... = ... | test.rs:98:24:98:24 | 1 | |
| test.rs:98:13:98:20 | mut iter | test.rs:99:15:99:39 | let ... = ... | match |
| test.rs:98:13:98:20 | mut iter | test.rs:99:29:99:32 | iter | match |
| test.rs:98:17:98:20 | iter | test.rs:98:13:98:20 | mut iter | |
| test.rs:98:24:98:24 | 1 | test.rs:98:27:98:28 | 10 | |
| test.rs:98:24:98:28 | 1..10 | test.rs:98:17: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 ... = ... | test.rs:99:29:99:32 | iter | |
| test.rs:99:19:99:25 | Some(...) | test.rs:99:9:103:9 | while ... { ... } | no-match |
| test.rs:99:15:99:39 | [boolean(false)] let ... = ... | test.rs:99:9:103:9 | while ... { ... } | false |
| test.rs:99:15:99:39 | [boolean(true)] let ... = ... | test.rs:100:17:100:17 | x | true |
| test.rs:99:19:99:25 | Some(...) | test.rs:99:15:99:39 | [boolean(false)] let ... = ... | no-match |
| test.rs:99:19:99:25 | Some(...) | test.rs:99:24:99:24 | x | match |
| test.rs:99:24:99:24 | x | test.rs:99:15:99:39 | [boolean(true)] let ... = ... | match |
| test.rs:99:24:99:24 | x | test.rs:99:24:99:24 | x | |
| 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 | iter.next() | |
| test.rs:99:29:99:39 | iter.next() | test.rs:99:19:99:25 | Some(...) | |
| test.rs:99:41:103:9 | { ... } | test.rs:99:15:99:39 | let ... = ... | |
| test.rs:99:41:103:9 | { ... } | test.rs:99:29:99:32 | iter | |
| 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 |
@@ -308,14 +309,15 @@ edges
| test.rs:145:5:151:5 | exit fn test_if_let_else (normal) | test.rs:145:5:151:5 | exit fn test_if_let_else | |
| test.rs:145:25:145:25 | a | test.rs:145:25:145:25 | a | |
| test.rs:145:25:145:25 | a | test.rs:145:25:145:38 | ...: Option::<...> | match |
| test.rs:145:25:145:38 | ...: Option::<...> | test.rs:146:12:146:26 | let ... = a | |
| test.rs:145:25:145:38 | ...: Option::<...> | test.rs:146:26:146:26 | a | |
| test.rs:145:48:151:5 | { ... } | test.rs:145:5:151:5 | exit fn test_if_let_else (normal) | |
| test.rs:146:9:150:9 | if ... {...} else {...} | test.rs:145:48:151:5 | { ... } | |
| test.rs:146:12:146:26 | let ... = a | test.rs:146:26:146:26 | a | |
| test.rs:146:12:146:26 | [boolean(false)] let ... = a | test.rs:149:13:149:13 | 0 | false |
| test.rs:146:12:146:26 | [boolean(true)] let ... = a | test.rs:147:13:147:13 | n | true |
| test.rs:146:16:146:22 | Some(...) | test.rs:146:12:146:26 | [boolean(false)] let ... = a | no-match |
| test.rs:146:16:146:22 | Some(...) | test.rs:146:21:146:21 | n | match |
| test.rs:146:16:146:22 | Some(...) | test.rs:149:13:149:13 | 0 | no-match |
| test.rs:146:21:146:21 | n | test.rs:146:12:146:26 | [boolean(true)] let ... = a | match |
| test.rs:146:21:146:21 | n | test.rs:146:21:146:21 | n | |
| test.rs:146:21:146:21 | n | test.rs:147:13:147:13 | n | match |
| test.rs:146:26:146:26 | a | test.rs:146:16:146:22 | Some(...) | |
| test.rs:146:28:148:9 | { ... } | test.rs:146:9:150:9 | if ... {...} else {...} | |
| test.rs:147:13:147:13 | n | test.rs:146:28:148:9 | { ... } | |
@@ -327,13 +329,14 @@ edges
| test.rs:153:20:153:20 | a | test.rs:153:20:153:33 | ...: Option::<...> | match |
| test.rs:153:20:153:33 | ...: Option::<...> | test.rs:154:9:156:9 | ExprStmt | |
| test.rs:153:43:158:5 | { ... } | test.rs:153:5:158:5 | exit fn test_if_let (normal) | |
| test.rs:154:9:156:9 | ExprStmt | test.rs:154:12:154:26 | let ... = a | |
| test.rs:154:9:156:9 | ExprStmt | test.rs:154:26:154:26 | a | |
| test.rs:154:9:156:9 | if ... {...} | test.rs:157:9:157:9 | 0 | |
| test.rs:154:12:154:26 | let ... = a | test.rs:154:26:154:26 | a | |
| test.rs:154:16:154:22 | Some(...) | test.rs:154:9:156:9 | if ... {...} | no-match |
| test.rs:154:12:154:26 | [boolean(false)] let ... = a | test.rs:154:9:156:9 | if ... {...} | false |
| test.rs:154:12:154:26 | [boolean(true)] let ... = a | test.rs:155:13:155:21 | ExprStmt | true |
| test.rs:154:16:154:22 | Some(...) | test.rs:154:12:154:26 | [boolean(false)] let ... = a | no-match |
| test.rs:154:16:154:22 | Some(...) | test.rs:154:21:154:21 | n | match |
| test.rs:154:21:154:21 | n | test.rs:154:12:154:26 | [boolean(true)] let ... = a | match |
| test.rs:154:21:154:21 | n | test.rs:154:21:154:21 | n | |
| test.rs:154:21:154:21 | n | test.rs:155:13:155:21 | ExprStmt | match |
| test.rs:154:26:154:26 | a | test.rs:154:16:154:22 | Some(...) | |
| test.rs:155:13:155:20 | return n | test.rs:153:5:158:5 | exit fn test_if_let (normal) | return |
| test.rs:155:13:155:21 | ExprStmt | test.rs:155:20:155:20 | n | |

View File

@@ -1,3 +0,0 @@
deadEnd
| main.rs:30:12:30:12 | x |
| main.rs:255:17:255:17 | n |

View File

@@ -30,9 +30,17 @@ localStep
| main.rs:26:12:26:12 | [SSA] x | main.rs:27:14:27:14 | x |
| main.rs:26:12:26:12 | x | main.rs:26:12:26:12 | [SSA] x |
| main.rs:26:12:26:12 | x | main.rs:26:12:26:12 | x |
| main.rs:26:16:26:16 | s | main.rs:26:12:26:12 | x |
| main.rs:26:16:26:16 | s | main.rs:30:16:30:16 | s |
| main.rs:26:18:28:5 | { ... } | main.rs:26:5:28:5 | if ... {...} |
| main.rs:30:12:30:12 | [SSA] x | main.rs:32:18:32:18 | x |
| main.rs:30:12:30:12 | x | main.rs:30:12:30:12 | [SSA] x |
| main.rs:30:12:30:12 | x | main.rs:30:12:30:12 | x |
| main.rs:30:16:30:16 | s | main.rs:30:12:30:12 | x |
| main.rs:32:18:32:18 | [post] x | main.rs:36:14:36:14 | x |
| main.rs:32:18:32:18 | x | main.rs:36:14:36:14 | x |
| main.rs:33:13:33:16 | true | main.rs:31:12:34:9 | { ... } |
| main.rs:35:5:37:5 | { ... } | main.rs:30:5:37:5 | if ... {...} |
| main.rs:40:18:40:21 | [SSA] cond | main.rs:43:16:43:19 | cond |
| main.rs:40:18:40:21 | cond | main.rs:40:18:40:21 | [SSA] cond |
| main.rs:40:18:40:21 | cond | main.rs:40:18:40:21 | cond |
@@ -294,7 +302,15 @@ localStep
| main.rs:254:9:254:10 | s1 | main.rs:254:9:254:10 | [SSA] s1 |
| main.rs:254:9:254:10 | s1 | main.rs:254:9:254:10 | s1 |
| main.rs:254:14:254:29 | Some(...) | main.rs:254:9:254:10 | s1 |
| main.rs:255:5:262:5 | if ... {...} | main.rs:253:25:263:1 | { ... } |
| main.rs:255:17:255:17 | [SSA] n | main.rs:257:18:257:18 | n |
| main.rs:255:17:255:17 | n | main.rs:255:17:255:17 | [SSA] n |
| main.rs:255:17:255:17 | n | main.rs:255:17:255:17 | n |
| main.rs:255:22:255:23 | s1 | main.rs:255:12:255:18 | Some(...) |
| main.rs:257:18:257:18 | [post] n | main.rs:261:14:261:14 | n |
| main.rs:257:18:257:18 | n | main.rs:261:14:261:14 | n |
| main.rs:258:13:258:16 | true | main.rs:256:12:259:9 | { ... } |
| main.rs:260:5:262:5 | { ... } | main.rs:255:5:262:5 | if ... {...} |
| main.rs:266:9:266:10 | [SSA] s1 | main.rs:267:10:267:11 | s1 |
| main.rs:266:9:266:10 | s1 | main.rs:266:9:266:10 | [SSA] s1 |
| main.rs:266:9:266:10 | s1 | main.rs:266:9:266:10 | s1 |

View File

@@ -11,7 +11,12 @@ models
| 10 | Summary: <core::result::Result>::ok; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue.Field[core::option::Option::Some(0)]; value |
edges
| main.rs:23:9:23:9 | s | main.rs:24:10:24:10 | s | provenance | |
| main.rs:23:9:23:9 | s | main.rs:26:12:26:12 | x | provenance | |
| main.rs:23:9:23:9 | s | main.rs:30:12:30:12 | x | provenance | |
| main.rs:23:13:23:21 | source(...) | main.rs:23:9:23:9 | s | provenance | |
| main.rs:26:12:26:12 | x | main.rs:27:14:27:14 | x | provenance | |
| main.rs:30:12:30:12 | x | main.rs:32:18:32:18 | x | provenance | |
| main.rs:30:12:30:12 | x | main.rs:36:14:36:14 | x | provenance | |
| main.rs:41:9:41:9 | a | main.rs:43:9:43:9 | c | provenance | |
| main.rs:41:13:41:21 | source(...) | main.rs:41:9:41:9 | a | provenance | |
| main.rs:43:9:43:9 | c | main.rs:44:10:44:10 | c | provenance | |
@@ -99,6 +104,12 @@ edges
| main.rs:243:11:243:12 | s1 [Some] | main.rs:244:9:244:15 | Some(...) [Some] | provenance | |
| main.rs:244:9:244:15 | Some(...) [Some] | main.rs:244:14:244:14 | n | provenance | |
| main.rs:244:14:244:14 | n | main.rs:244:25:244:25 | n | provenance | |
| main.rs:254:9:254:10 | s1 [Some] | main.rs:255:12:255:18 | Some(...) [Some] | provenance | |
| main.rs:254:14:254:29 | Some(...) [Some] | main.rs:254:9:254:10 | s1 [Some] | provenance | |
| main.rs:254:19:254:28 | source(...) | main.rs:254:14:254:29 | Some(...) [Some] | provenance | |
| main.rs:255:12:255:18 | Some(...) [Some] | main.rs:255:17:255:17 | n | provenance | |
| main.rs:255:17:255:17 | n | main.rs:257:18:257:18 | n | provenance | |
| main.rs:255:17:255:17 | n | main.rs:261:14:261:14 | n | provenance | |
| main.rs:266:9:266:10 | s1 [Some] | main.rs:267:10:267:20 | s1.unwrap() | provenance | MaD:2 |
| main.rs:266:14:266:29 | Some(...) [Some] | main.rs:266:9:266:10 | s1 [Some] | provenance | |
| main.rs:266:19:266:28 | source(...) | main.rs:266:14:266:29 | Some(...) [Some] | provenance | |
@@ -240,6 +251,11 @@ nodes
| main.rs:23:9:23:9 | s | semmle.label | s |
| main.rs:23:13:23:21 | source(...) | semmle.label | source(...) |
| main.rs:24:10:24:10 | s | semmle.label | s |
| main.rs:26:12:26:12 | x | semmle.label | x |
| main.rs:27:14:27:14 | x | semmle.label | x |
| main.rs:30:12:30:12 | x | semmle.label | x |
| main.rs:32:18:32:18 | x | semmle.label | x |
| main.rs:36:14:36:14 | x | semmle.label | x |
| main.rs:41:9:41:9 | a | semmle.label | a |
| main.rs:41:13:41:21 | source(...) | semmle.label | source(...) |
| main.rs:43:9:43:9 | c | semmle.label | c |
@@ -345,6 +361,13 @@ nodes
| main.rs:244:9:244:15 | Some(...) [Some] | semmle.label | Some(...) [Some] |
| main.rs:244:14:244:14 | n | semmle.label | n |
| main.rs:244:25:244:25 | n | semmle.label | n |
| main.rs:254:9:254:10 | s1 [Some] | semmle.label | s1 [Some] |
| main.rs:254:14:254:29 | Some(...) [Some] | semmle.label | Some(...) [Some] |
| main.rs:254:19:254:28 | source(...) | semmle.label | source(...) |
| main.rs:255:12:255:18 | Some(...) [Some] | semmle.label | Some(...) [Some] |
| main.rs:255:17:255:17 | n | semmle.label | n |
| main.rs:257:18:257:18 | n | semmle.label | n |
| main.rs:261:14:261:14 | n | semmle.label | n |
| main.rs:266:9:266:10 | s1 [Some] | semmle.label | s1 [Some] |
| main.rs:266:14:266:29 | Some(...) [Some] | semmle.label | Some(...) [Some] |
| main.rs:266:19:266:28 | source(...) | semmle.label | source(...) |
@@ -512,6 +535,9 @@ testFailures
#select
| main.rs:19:10:19:18 | source(...) | main.rs:19:10:19:18 | source(...) | main.rs:19:10:19:18 | source(...) | $@ | main.rs:19:10:19:18 | source(...) | source(...) |
| main.rs:24:10:24:10 | s | main.rs:23:13:23:21 | source(...) | main.rs:24:10:24:10 | s | $@ | main.rs:23:13:23:21 | source(...) | source(...) |
| main.rs:27:14:27:14 | x | main.rs:23:13:23:21 | source(...) | main.rs:27:14:27:14 | x | $@ | main.rs:23:13:23:21 | source(...) | source(...) |
| main.rs:32:18:32:18 | x | main.rs:23:13:23:21 | source(...) | main.rs:32:18:32:18 | x | $@ | main.rs:23:13:23:21 | source(...) | source(...) |
| main.rs:36:14:36:14 | x | main.rs:23:13:23:21 | source(...) | main.rs:36:14:36:14 | x | $@ | main.rs:23:13:23:21 | source(...) | source(...) |
| main.rs:44:10:44:10 | c | main.rs:41:13:41:21 | source(...) | main.rs:44:10:44:10 | c | $@ | main.rs:41:13:41:21 | source(...) | source(...) |
| main.rs:53:10:53:10 | b | main.rs:48:13:48:21 | source(...) | main.rs:53:10:53:10 | b | $@ | main.rs:48:13:48:21 | source(...) | source(...) |
| main.rs:64:10:64:10 | b | main.rs:62:15:62:23 | source(...) | main.rs:64:10:64:10 | b | $@ | main.rs:62:15:62:23 | source(...) | source(...) |
@@ -531,6 +557,8 @@ testFailures
| main.rs:218:18:218:18 | x | main.rs:212:27:212:36 | source(...) | main.rs:218:18:218:18 | x | $@ | main.rs:212:27:212:36 | source(...) | source(...) |
| main.rs:231:33:231:33 | n | main.rs:228:27:228:36 | source(...) | main.rs:231:33:231:33 | n | $@ | main.rs:228:27:228:36 | source(...) | source(...) |
| main.rs:244:25:244:25 | n | main.rs:241:19:241:28 | source(...) | main.rs:244:25:244:25 | n | $@ | main.rs:241:19:241:28 | source(...) | source(...) |
| main.rs:257:18:257:18 | n | main.rs:254:19:254:28 | source(...) | main.rs:257:18:257:18 | n | $@ | main.rs:254:19:254:28 | source(...) | source(...) |
| main.rs:261:14:261:14 | n | main.rs:254:19:254:28 | source(...) | main.rs:261:14:261:14 | n | $@ | main.rs:254:19:254:28 | source(...) | source(...) |
| main.rs:267:10:267:20 | s1.unwrap() | main.rs:266:19:266:28 | source(...) | main.rs:267:10:267:20 | s1.unwrap() | $@ | main.rs:266:19:266:28 | source(...) | source(...) |
| main.rs:272:10:272:24 | s1.unwrap_or(...) | main.rs:271:19:271:28 | source(...) | main.rs:272:10:272:24 | s1.unwrap_or(...) | $@ | main.rs:271:19:271:28 | source(...) | source(...) |
| main.rs:275:10:275:33 | s2.unwrap_or(...) | main.rs:275:23:275:32 | source(...) | main.rs:275:10:275:33 | s2.unwrap_or(...) | $@ | main.rs:275:23:275:32 | source(...) | source(...) |

View File

@@ -24,16 +24,16 @@ fn variable_usage() {
sink(s); // $ hasValueFlow=2
if let x = s {
sink(x); // $ MISSING: hasValueFlow=2
sink(x); // $ hasValueFlow=2
};
if let x = s
&& {
sink(x); // $ MISSING: hasValueFlow=2
sink(x); // $ hasValueFlow=2
true
}
{
sink(x); // $ MISSING: hasValueFlow=2
sink(x); // $ hasValueFlow=2
};
}
@@ -254,11 +254,11 @@ fn option_chained_let() {
let s1 = Some(source(45));
if let Some(n) = s1
&& {
sink(n); // $ MISSING: hasValueFlow=45
sink(n); // $ hasValueFlow=45
true
}
{
sink(n); // $ MISSING: hasValueFlow=45
sink(n); // $ hasValueFlow=45
}
}

View File

@@ -80,7 +80,7 @@ async fn test_reqwest() -> Result<(), reqwest::Error> {
let mut request1 = reqwest::get("example.com").await?; // $ Alert[rust/summary/taint-sources]
sink(request1.chunk().await?.unwrap()); // $ hasTaintFlow="example.com"
while let Some(chunk) = request1.chunk().await? {
sink(chunk); // $ MISSING: hasTaintFlow="example.com"
sink(chunk); // $ hasTaintFlow="example.com"
}
Ok(())
@@ -273,7 +273,7 @@ fn test_io_stdin() -> std::io::Result<()> {
let mut reader_split = std::io::BufReader::new(std::io::stdin()).split(b','); // $ Alert[rust/summary/taint-sources]
sink(reader_split.next().unwrap().unwrap()); // $ hasTaintFlow
while let Some(chunk) = reader_split.next() {
sink(chunk.unwrap()); // $ MISSING: hasTaintFlow
sink(chunk.unwrap()); // $ hasTaintFlow
}
}

View File

@@ -62,7 +62,7 @@ async fn test_futures_rustls_futures_io() -> io::Result<()> {
let buffer = pinned.poll_fill_buf(&mut cx);
if let Poll::Ready(Ok(buf)) = buffer {
sink(&buffer); // $ hasTaintFlow=url
sink(buf); // $ MISSING: hasTaintFlow=url
sink(buf); // $ hasTaintFlow=url
}
// using the `AsyncBufRead` trait (alternative syntax)
@@ -116,7 +116,7 @@ async fn test_futures_rustls_futures_io() -> io::Result<()> {
let buffer = pinned.poll_fill_buf(&mut cx);
sink(&buffer); // $ hasTaintFlow=url
if let Poll::Ready(Ok(buf)) = buffer {
sink(buf); // $ MISSING: hasTaintFlow=url
sink(buf); // $ hasTaintFlow=url
}
}

View File

@@ -1,5 +0,0 @@
deadEnd
| main.rs:280:17:280:17 | x |
| main.rs:296:17:296:17 | x |
| main.rs:315:20:315:20 | x |
| main.rs:335:20:335:20 | x |

View File

@@ -211,17 +211,18 @@ edges
| main.rs:88:19:95:1 | { ... } | main.rs:88:1:95:1 | exit fn let_pattern3 (normal) | |
| main.rs:89:5:89:42 | let ... = ... | main.rs:89:14:89:17 | Some | |
| main.rs:89:9:89:10 | s1 | main.rs:89:9:89:10 | s1 | |
| main.rs:89:9:89:10 | s1 | main.rs:91:8:92:12 | let ... = s1 | match |
| main.rs:89:9:89:10 | s1 | main.rs:92:11:92:12 | s1 | match |
| main.rs:89:14:89:17 | Some | main.rs:89:19:89:30 | ...::from | |
| main.rs:89:14:89:41 | Some(...) | main.rs:89:9:89:10 | s1 | |
| main.rs:89:19:89:30 | ...::from | main.rs:89:32:89:39 | "Hello!" | |
| main.rs:89:19:89:40 | ...::from(...) | main.rs:89:14:89:41 | Some(...) | |
| main.rs:89:32:89:39 | "Hello!" | main.rs:89:19:89:40 | ...::from(...) | |
| main.rs:91:5:94:5 | if ... {...} | main.rs:88:19:95:1 | { ... } | |
| main.rs:91:8:92:12 | let ... = s1 | main.rs:92:11:92:12 | s1 | |
| main.rs:91:12:91:23 | Some(...) | main.rs:91:5:94:5 | if ... {...} | no-match |
| main.rs:91:8:92:12 | [boolean(false)] let ... = s1 | main.rs:91:5:94:5 | if ... {...} | false |
| main.rs:91:8:92:12 | [boolean(true)] let ... = s1 | main.rs:93:9:93:22 | ExprStmt | true |
| main.rs:91:12:91:23 | Some(...) | main.rs:91:8:92:12 | [boolean(false)] let ... = s1 | no-match |
| main.rs:91:12:91:23 | Some(...) | main.rs:91:21:91:22 | s2 | match |
| main.rs:91:17:91:22 | ref s2 | main.rs:93:9:93:22 | ExprStmt | match |
| main.rs:91:17:91:22 | ref s2 | main.rs:91:8:92:12 | [boolean(true)] let ... = s1 | match |
| main.rs:91:21:91:22 | s2 | main.rs:91:17:91:22 | ref s2 | |
| main.rs:92:11:92:12 | s1 | main.rs:91:12:91:23 | Some(...) | |
| main.rs:92:14:94:5 | { ... } | main.rs:91:5:94:5 | if ... {...} | |
@@ -268,20 +269,21 @@ edges
| main.rs:110:19:117:1 | { ... } | main.rs:110:1:117:1 | exit fn let_pattern5 (normal) | |
| main.rs:111:5:111:42 | let ... = ... | main.rs:111:14:111:17 | Some | |
| main.rs:111:9:111:10 | s1 | main.rs:111:9:111:10 | s1 | |
| main.rs:111:9:111:10 | s1 | main.rs:113:11:114:12 | let ... = s1 | match |
| main.rs:111:9:111:10 | s1 | main.rs:114:11:114:12 | s1 | match |
| main.rs:111:14:111:17 | Some | main.rs:111:19:111:30 | ...::from | |
| main.rs:111:14:111:41 | Some(...) | main.rs:111:9:111:10 | s1 | |
| main.rs:111:19:111:30 | ...::from | main.rs:111:32:111:39 | "Hello!" | |
| main.rs:111:19:111:40 | ...::from(...) | main.rs:111:14:111:41 | Some(...) | |
| main.rs:111:32:111:39 | "Hello!" | main.rs:111:19:111:40 | ...::from(...) | |
| main.rs:113:5:116:5 | while ... { ... } | main.rs:110:19:117:1 | { ... } | |
| main.rs:113:11:114:12 | let ... = s1 | main.rs:114:11:114:12 | s1 | |
| main.rs:113:15:113:26 | Some(...) | main.rs:113:5:116:5 | while ... { ... } | no-match |
| main.rs:113:11:114:12 | [boolean(false)] let ... = s1 | main.rs:113:5:116:5 | while ... { ... } | false |
| main.rs:113:11:114:12 | [boolean(true)] let ... = s1 | main.rs:115:9:115:22 | ExprStmt | true |
| main.rs:113:15:113:26 | Some(...) | main.rs:113:11:114:12 | [boolean(false)] let ... = s1 | no-match |
| main.rs:113:15:113:26 | Some(...) | main.rs:113:24:113:25 | s2 | match |
| main.rs:113:20:113:25 | ref s2 | main.rs:115:9:115:22 | ExprStmt | match |
| main.rs:113:20:113:25 | ref s2 | main.rs:113:11:114:12 | [boolean(true)] let ... = s1 | match |
| main.rs:113:24:113:25 | s2 | main.rs:113:20:113:25 | ref s2 | |
| main.rs:114:11:114:12 | s1 | main.rs:113:15:113:26 | Some(...) | |
| main.rs:114:14:116:5 | { ... } | main.rs:113:11:114:12 | let ... = s1 | |
| main.rs:114:14:116:5 | { ... } | main.rs:114:11:114:12 | s1 | |
| main.rs:115:9:115:17 | print_str | main.rs:115:19:115:20 | s2 | |
| main.rs:115:9:115:21 | print_str(...) | main.rs:114:14:116:5 | { ... } | |
| main.rs:115:9:115:22 | ExprStmt | main.rs:115:9:115:17 | print_str | |
@@ -593,15 +595,16 @@ edges
| main.rs:250:48:250:50 | a11 | main.rs:250:48:250:50 | a11 | |
| main.rs:251:12:257:9 | { ... } | main.rs:248:5:259:5 | match either { ... } | |
| main.rs:252:13:252:21 | print_i64 | main.rs:252:23:252:25 | a11 | |
| main.rs:252:13:252:26 | print_i64(...) | main.rs:253:16:254:15 | let ... = e | |
| main.rs:252:13:252:26 | print_i64(...) | main.rs:254:15:254:15 | e | |
| main.rs:252:13:252:27 | ExprStmt | main.rs:252:13:252:21 | print_i64 | |
| main.rs:252:23:252:25 | a11 | main.rs:252:13:252:26 | print_i64(...) | |
| main.rs:253:13:256:13 | if ... {...} | main.rs:251:12:257:9 | { ... } | |
| main.rs:253:16:254:15 | let ... = e | main.rs:254:15:254:15 | e | |
| main.rs:253:20:253:36 | ...::Left(...) | main.rs:253:13:256:13 | if ... {...} | no-match |
| main.rs:253:16:254:15 | [boolean(false)] let ... = e | main.rs:253:13:256:13 | if ... {...} | false |
| main.rs:253:16:254:15 | [boolean(true)] let ... = e | main.rs:255:17:255:32 | ExprStmt | true |
| main.rs:253:20:253:36 | ...::Left(...) | main.rs:253:16:254:15 | [boolean(false)] let ... = e | no-match |
| main.rs:253:20:253:36 | ...::Left(...) | main.rs:253:33:253:35 | a12 | match |
| main.rs:253:33:253:35 | a12 | main.rs:253:16:254:15 | [boolean(true)] let ... = e | match |
| main.rs:253:33:253:35 | a12 | main.rs:253:33:253:35 | a12 | |
| main.rs:253:33:253:35 | a12 | main.rs:255:17:255:32 | ExprStmt | match |
| main.rs:254:15:254:15 | e | main.rs:253:20:253:36 | ...::Left(...) | |
| main.rs:254:17:256:13 | { ... } | main.rs:253:13:256:13 | if ... {...} | |
| main.rs:255:17:255:25 | print_i64 | main.rs:255:28:255:30 | a12 | |
@@ -644,39 +647,138 @@ edges
| main.rs:273:16:273:29 | print_i64(...) | main.rs:271:5:274:5 | match fv { ... } | |
| main.rs:273:26:273:28 | a13 | main.rs:273:16:273:29 | print_i64(...) | |
| main.rs:277:1:291:1 | enter fn match_pattern10 | main.rs:279:5:279:20 | let ... = ... | |
| main.rs:277:1:291:1 | exit fn match_pattern10 (normal) | main.rs:277:1:291:1 | exit fn match_pattern10 | |
| main.rs:278:22:291:1 | { ... } | main.rs:277:1:291:1 | exit fn match_pattern10 (normal) | |
| main.rs:279:5:279:20 | let ... = ... | main.rs:279:12:279:15 | Some | |
| main.rs:279:9:279:9 | x | main.rs:279:9:279:9 | x | |
| main.rs:279:9:279:9 | x | main.rs:280:8:281:7 | let ... = x | match |
| main.rs:279:9:279:9 | x | main.rs:281:7:281:7 | x | match |
| main.rs:279:12:279:15 | Some | main.rs:279:17:279:18 | 42 | |
| main.rs:279:12:279:19 | Some(...) | main.rs:279:9:279:9 | x | |
| main.rs:279:17:279:18 | 42 | main.rs:279:12:279:19 | Some(...) | |
| main.rs:280:8:281:7 | let ... = x | main.rs:281:7:281:7 | x | |
| main.rs:280:5:290:5 | if ... {...} else {...} | main.rs:278:22:291:1 | { ... } | |
| main.rs:280:8:281:7 | [boolean(false)] let ... = x | main.rs:280:8:283:9 | [boolean(false)] ... && ... | false |
| main.rs:280:8:281:7 | [boolean(true)] let ... = x | main.rs:283:5:283:5 | x | true |
| main.rs:280:8:283:9 | [boolean(false)] ... && ... | main.rs:287:9:288:14 | let ... = x | false |
| main.rs:280:8:283:9 | [boolean(true)] ... && ... | main.rs:285:9:285:21 | ExprStmt | true |
| main.rs:280:12:280:18 | Some(...) | main.rs:280:8:281:7 | [boolean(false)] let ... = x | no-match |
| main.rs:280:12:280:18 | Some(...) | main.rs:280:17:280:17 | x | match |
| main.rs:280:17:280:17 | x | main.rs:280:8:281:7 | [boolean(true)] let ... = x | match |
| main.rs:280:17:280:17 | x | main.rs:280:17:280:17 | x | |
| main.rs:281:7:281:7 | x | main.rs:280:12:280:18 | Some(...) | |
| main.rs:283:5:283:5 | x | main.rs:283:9:283:9 | 0 | |
| main.rs:283:5:283:9 | ... > ... | main.rs:280:8:283:9 | [boolean(false)] ... && ... | false |
| main.rs:283:5:283:9 | ... > ... | main.rs:280:8:283:9 | [boolean(true)] ... && ... | true |
| main.rs:283:9:283:9 | 0 | main.rs:283:5:283:9 | ... > ... | |
| main.rs:284:5:286:5 | { ... } | main.rs:280:5:290:5 | if ... {...} else {...} | |
| main.rs:285:9:285:17 | print_i64 | main.rs:285:19:285:19 | x | |
| main.rs:285:9:285:20 | print_i64(...) | main.rs:284:5:286:5 | { ... } | |
| main.rs:285:9:285:21 | ExprStmt | main.rs:285:9:285:17 | print_i64 | |
| main.rs:285:19:285:19 | x | main.rs:285:9:285:20 | print_i64(...) | |
| main.rs:286:12:290:5 | { ... } | main.rs:280:5:290:5 | if ... {...} else {...} | |
| main.rs:287:9:288:14 | let ... = x | main.rs:288:13:288:13 | x | |
| main.rs:287:13:287:13 | x | main.rs:287:13:287:13 | x | |
| main.rs:287:13:287:13 | x | main.rs:289:9:289:30 | ExprStmt | match |
| main.rs:288:13:288:13 | x | main.rs:287:13:287:13 | x | |
| main.rs:289:9:289:17 | print_i64 | main.rs:289:19:289:19 | x | |
| main.rs:289:9:289:29 | print_i64(...) | main.rs:286:12:290:5 | { ... } | |
| main.rs:289:9:289:30 | ExprStmt | main.rs:289:9:289:17 | print_i64 | |
| main.rs:289:19:289:19 | x | main.rs:289:19:289:28 | x.unwrap() | |
| main.rs:289:19:289:28 | x.unwrap() | main.rs:289:9:289:29 | print_i64(...) | |
| main.rs:293:1:310:1 | enter fn match_pattern11 | main.rs:295:5:295:21 | let ... = ... | |
| main.rs:293:1:310:1 | exit fn match_pattern11 (normal) | main.rs:293:1:310:1 | exit fn match_pattern11 | |
| main.rs:294:22:310:1 | { ... } | main.rs:293:1:310:1 | exit fn match_pattern11 (normal) | |
| main.rs:295:5:295:21 | let ... = ... | main.rs:295:13:295:16 | Some | |
| main.rs:295:9:295:9 | x | main.rs:295:9:295:9 | x | |
| main.rs:295:9:295:9 | x | main.rs:296:8:297:7 | let ... = x | match |
| main.rs:295:9:295:9 | x | main.rs:297:7:297:7 | x | match |
| main.rs:295:13:295:16 | Some | main.rs:295:18:295:19 | 42 | |
| main.rs:295:13:295:20 | Some(...) | main.rs:295:9:295:9 | x | |
| main.rs:295:18:295:19 | 42 | main.rs:295:13:295:20 | Some(...) | |
| main.rs:296:8:297:7 | let ... = x | main.rs:297:7:297:7 | x | |
| main.rs:296:5:309:5 | if ... {...} else {...} | main.rs:294:22:310:1 | { ... } | |
| main.rs:296:8:297:7 | [boolean(false)] let ... = x | main.rs:296:8:300:13 | [boolean(false)] ... && ... | false |
| main.rs:296:8:297:7 | [boolean(true)] let ... = x | main.rs:300:7:300:10 | Some | true |
| main.rs:296:8:300:13 | [boolean(false)] ... && ... | main.rs:296:8:302:9 | [boolean(false)] ... && ... | false |
| main.rs:296:8:300:13 | [boolean(true)] ... && ... | main.rs:302:5:302:5 | x | true |
| main.rs:296:8:302:9 | [boolean(false)] ... && ... | main.rs:306:9:307:14 | let ... = x | false |
| main.rs:296:8:302:9 | [boolean(true)] ... && ... | main.rs:304:9:304:21 | ExprStmt | true |
| main.rs:296:12:296:18 | Some(...) | main.rs:296:8:297:7 | [boolean(false)] let ... = x | no-match |
| main.rs:296:12:296:18 | Some(...) | main.rs:296:17:296:17 | x | match |
| main.rs:296:17:296:17 | x | main.rs:296:8:297:7 | [boolean(true)] let ... = x | match |
| main.rs:296:17:296:17 | x | main.rs:296:17:296:17 | x | |
| main.rs:297:7:297:7 | x | main.rs:296:12:296:18 | Some(...) | |
| main.rs:299:5:300:13 | [boolean(false)] let ... = ... | main.rs:296:8:300:13 | [boolean(false)] ... && ... | false |
| main.rs:299:5:300:13 | [boolean(true)] let ... = ... | main.rs:296:8:300:13 | [boolean(true)] ... && ... | true |
| main.rs:299:9:299:15 | Some(...) | main.rs:299:5:300:13 | [boolean(false)] let ... = ... | no-match |
| main.rs:299:9:299:15 | Some(...) | main.rs:299:14:299:14 | x | match |
| main.rs:299:14:299:14 | x | main.rs:299:5:300:13 | [boolean(true)] let ... = ... | match |
| main.rs:299:14:299:14 | x | main.rs:299:14:299:14 | x | |
| main.rs:300:7:300:10 | Some | main.rs:300:12:300:12 | x | |
| main.rs:300:7:300:13 | Some(...) | main.rs:299:9:299:15 | Some(...) | |
| main.rs:300:12:300:12 | x | main.rs:300:7:300:13 | Some(...) | |
| main.rs:302:5:302:5 | x | main.rs:302:9:302:9 | 0 | |
| main.rs:302:5:302:9 | ... > ... | main.rs:296:8:302:9 | [boolean(false)] ... && ... | false |
| main.rs:302:5:302:9 | ... > ... | main.rs:296:8:302:9 | [boolean(true)] ... && ... | true |
| main.rs:302:9:302:9 | 0 | main.rs:302:5:302:9 | ... > ... | |
| main.rs:303:5:305:5 | { ... } | main.rs:296:5:309:5 | if ... {...} else {...} | |
| main.rs:304:9:304:17 | print_i64 | main.rs:304:19:304:19 | x | |
| main.rs:304:9:304:20 | print_i64(...) | main.rs:303:5:305:5 | { ... } | |
| main.rs:304:9:304:21 | ExprStmt | main.rs:304:9:304:17 | print_i64 | |
| main.rs:304:19:304:19 | x | main.rs:304:9:304:20 | print_i64(...) | |
| main.rs:305:12:309:5 | { ... } | main.rs:296:5:309:5 | if ... {...} else {...} | |
| main.rs:306:9:307:14 | let ... = x | main.rs:307:13:307:13 | x | |
| main.rs:306:13:306:13 | x | main.rs:306:13:306:13 | x | |
| main.rs:306:13:306:13 | x | main.rs:308:9:308:30 | ExprStmt | match |
| main.rs:307:13:307:13 | x | main.rs:306:13:306:13 | x | |
| main.rs:308:9:308:17 | print_i64 | main.rs:308:19:308:19 | x | |
| main.rs:308:9:308:29 | print_i64(...) | main.rs:305:12:309:5 | { ... } | |
| main.rs:308:9:308:30 | ExprStmt | main.rs:308:9:308:17 | print_i64 | |
| main.rs:308:19:308:19 | x | main.rs:308:19:308:28 | x.unwrap() | |
| main.rs:308:19:308:28 | x.unwrap() | main.rs:308:9:308:29 | print_i64(...) | |
| main.rs:312:1:328:1 | enter fn match_pattern12 | main.rs:314:5:314:21 | let ... = ... | |
| main.rs:312:1:328:1 | exit fn match_pattern12 (normal) | main.rs:312:1:328:1 | exit fn match_pattern12 | |
| main.rs:313:22:328:1 | { ... } | main.rs:312:1:328:1 | exit fn match_pattern12 (normal) | |
| main.rs:314:5:314:21 | let ... = ... | main.rs:314:13:314:16 | Some | |
| main.rs:314:9:314:9 | x | main.rs:314:9:314:9 | x | |
| main.rs:314:9:314:9 | x | main.rs:315:5:325:5 | ExprStmt | match |
| main.rs:314:13:314:16 | Some | main.rs:314:18:314:19 | 42 | |
| main.rs:314:13:314:20 | Some(...) | main.rs:314:9:314:9 | x | |
| main.rs:314:18:314:19 | 42 | main.rs:314:13:314:20 | Some(...) | |
| main.rs:315:5:325:5 | ExprStmt | main.rs:315:11:316:7 | let ... = x | |
| main.rs:315:11:316:7 | let ... = x | main.rs:316:7:316:7 | x | |
| main.rs:315:5:325:5 | ExprStmt | main.rs:316:7:316:7 | x | |
| main.rs:315:5:325:5 | while ... { ... } | main.rs:327:5:327:26 | ExprStmt | |
| main.rs:315:11:316:7 | [boolean(false)] let ... = x | main.rs:315:11:319:13 | [boolean(false)] ... && ... | false |
| main.rs:315:11:316:7 | [boolean(true)] let ... = x | main.rs:319:7:319:10 | Some | true |
| main.rs:315:11:319:13 | [boolean(false)] ... && ... | main.rs:315:11:321:9 | [boolean(false)] ... && ... | false |
| main.rs:315:11:319:13 | [boolean(true)] ... && ... | main.rs:321:5:321:5 | x | true |
| main.rs:315:11:321:9 | [boolean(false)] ... && ... | main.rs:315:5:325:5 | while ... { ... } | false |
| main.rs:315:11:321:9 | [boolean(true)] ... && ... | main.rs:323:9:323:21 | ExprStmt | true |
| main.rs:315:15:315:21 | Some(...) | main.rs:315:11:316:7 | [boolean(false)] let ... = x | no-match |
| main.rs:315:15:315:21 | Some(...) | main.rs:315:20:315:20 | x | match |
| main.rs:315:20:315:20 | x | main.rs:315:11:316:7 | [boolean(true)] let ... = x | match |
| main.rs:315:20:315:20 | x | main.rs:315:20:315:20 | x | |
| main.rs:316:7:316:7 | x | main.rs:315:15:315:21 | Some(...) | |
| main.rs:318:5:319:13 | [boolean(false)] let ... = ... | main.rs:315:11:319:13 | [boolean(false)] ... && ... | false |
| main.rs:318:5:319:13 | [boolean(true)] let ... = ... | main.rs:315:11:319:13 | [boolean(true)] ... && ... | true |
| main.rs:318:9:318:15 | Some(...) | main.rs:318:5:319:13 | [boolean(false)] let ... = ... | no-match |
| main.rs:318:9:318:15 | Some(...) | main.rs:318:14:318:14 | x | match |
| main.rs:318:14:318:14 | x | main.rs:318:5:319:13 | [boolean(true)] let ... = ... | match |
| main.rs:318:14:318:14 | x | main.rs:318:14:318:14 | x | |
| main.rs:319:7:319:10 | Some | main.rs:319:12:319:12 | x | |
| main.rs:319:7:319:13 | Some(...) | main.rs:318:9:318:15 | Some(...) | |
| main.rs:319:12:319:12 | x | main.rs:319:7:319:13 | Some(...) | |
| main.rs:321:5:321:5 | x | main.rs:321:9:321:9 | 0 | |
| main.rs:321:5:321:9 | ... > ... | main.rs:315:11:321:9 | [boolean(false)] ... && ... | false |
| main.rs:321:5:321:9 | ... > ... | main.rs:315:11:321:9 | [boolean(true)] ... && ... | true |
| main.rs:321:9:321:9 | 0 | main.rs:321:5:321:9 | ... > ... | |
| main.rs:323:9:323:17 | print_i64 | main.rs:323:19:323:19 | x | |
| main.rs:323:9:323:20 | print_i64(...) | main.rs:324:9:324:14 | ExprStmt | |
| main.rs:323:9:323:21 | ExprStmt | main.rs:323:9:323:17 | print_i64 | |
| main.rs:323:19:323:19 | x | main.rs:323:9:323:20 | print_i64(...) | |
| main.rs:324:9:324:13 | break | main.rs:315:5:325:5 | while ... { ... } | break |
| main.rs:324:9:324:14 | ExprStmt | main.rs:324:9:324:13 | break | |
| main.rs:327:5:327:13 | print_i64 | main.rs:327:15:327:15 | x | |
| main.rs:327:5:327:25 | print_i64(...) | main.rs:313:22:328:1 | { ... } | |
| main.rs:327:5:327:26 | ExprStmt | main.rs:327:5:327:13 | print_i64 | |
| main.rs:327:15:327:15 | x | main.rs:327:15:327:24 | x.unwrap() | |
| main.rs:327:15:327:24 | x.unwrap() | main.rs:327:5:327:25 | print_i64(...) | |
| main.rs:330:1:342:1 | enter fn match_pattern13 | main.rs:332:5:332:21 | let ... = ... | |
| main.rs:330:1:342:1 | exit fn match_pattern13 (normal) | main.rs:330:1:342:1 | exit fn match_pattern13 | |
| main.rs:331:22:342:1 | { ... } | main.rs:330:1:342:1 | exit fn match_pattern13 (normal) | |
@@ -692,10 +794,18 @@ edges
| main.rs:334:9:334:15 | Some(...) | main.rs:334:14:334:14 | x | match |
| main.rs:334:9:334:15 | Some(...) | main.rs:338:9:338:9 | _ | no-match |
| main.rs:334:14:334:14 | x | main.rs:334:14:334:14 | x | |
| main.rs:334:14:334:14 | x | main.rs:335:16:336:18 | let ... = x | match |
| main.rs:335:16:336:18 | let ... = x | main.rs:336:18:336:18 | x | |
| main.rs:334:14:334:14 | x | main.rs:336:18:336:18 | x | match |
| main.rs:335:16:336:18 | [boolean(true)] let ... = x | main.rs:337:19:337:19 | x | true |
| main.rs:335:16:337:23 | [boolean(false)] ... && ... | main.rs:338:9:338:9 | _ | false |
| main.rs:335:16:337:23 | [boolean(true)] ... && ... | main.rs:337:28:337:29 | TupleExpr | true |
| main.rs:335:20:335:20 | x | main.rs:335:16:336:18 | [boolean(true)] let ... = x | match |
| main.rs:335:20:335:20 | x | main.rs:335:20:335:20 | x | |
| main.rs:336:18:336:18 | x | main.rs:335:20:335:20 | x | |
| main.rs:337:19:337:19 | x | main.rs:337:23:337:23 | 0 | |
| main.rs:337:19:337:23 | ... > ... | main.rs:335:16:337:23 | [boolean(false)] ... && ... | false |
| main.rs:337:19:337:23 | ... > ... | main.rs:335:16:337:23 | [boolean(true)] ... && ... | true |
| main.rs:337:23:337:23 | 0 | main.rs:337:19:337:23 | ... > ... | |
| main.rs:337:28:337:29 | TupleExpr | main.rs:333:5:339:5 | match x { ... } | |
| main.rs:338:9:338:9 | _ | main.rs:338:14:338:15 | TupleExpr | match |
| main.rs:338:14:338:15 | TupleExpr | main.rs:333:5:339:5 | match x { ... } | |
| main.rs:341:5:341:13 | print_i64 | main.rs:341:15:341:15 | x | |
@@ -708,16 +818,17 @@ edges
| main.rs:345:22:359:1 | { ... } | main.rs:344:1:359:1 | exit fn match_pattern14 (normal) | |
| main.rs:346:5:346:19 | let ... = ... | main.rs:346:13:346:14 | Ok | |
| main.rs:346:9:346:9 | x | main.rs:346:9:346:9 | x | |
| main.rs:346:9:346:9 | x | main.rs:347:8:348:7 | let ... = x | match |
| main.rs:346:9:346:9 | x | main.rs:348:7:348:7 | x | match |
| main.rs:346:13:346:14 | Ok | main.rs:346:16:346:17 | 42 | |
| main.rs:346:13:346:18 | Ok(...) | main.rs:346:9:346:9 | x | |
| main.rs:346:16:346:17 | 42 | main.rs:346:13:346:18 | Ok(...) | |
| main.rs:347:5:358:5 | if ... {...} else {...} | main.rs:345:22:359:1 | { ... } | |
| main.rs:347:8:348:7 | let ... = x | main.rs:348:7:348:7 | x | |
| main.rs:347:8:348:7 | [boolean(false)] let ... = x | main.rs:353:7:353:7 | x | false |
| main.rs:347:8:348:7 | [boolean(true)] let ... = x | main.rs:350:9:350:21 | ExprStmt | true |
| main.rs:347:12:347:17 | Err(...) | main.rs:347:8:348:7 | [boolean(false)] let ... = x | no-match |
| main.rs:347:12:347:17 | Err(...) | main.rs:347:16:347:16 | x | match |
| main.rs:347:12:347:17 | Err(...) | main.rs:352:13:353:7 | let ... = x | no-match |
| main.rs:347:16:347:16 | x | main.rs:347:8:348:7 | [boolean(true)] let ... = x | match |
| main.rs:347:16:347:16 | x | main.rs:347:16:347:16 | x | |
| main.rs:347:16:347:16 | x | main.rs:350:9:350:21 | ExprStmt | match |
| main.rs:348:7:348:7 | x | main.rs:347:12:347:17 | Err(...) | |
| main.rs:349:5:351:5 | { ... } | main.rs:347:5:358:5 | if ... {...} else {...} | |
| main.rs:350:9:350:17 | print_i64 | main.rs:350:19:350:19 | x | |
@@ -725,11 +836,12 @@ edges
| main.rs:350:9:350:21 | ExprStmt | main.rs:350:9:350:17 | print_i64 | |
| main.rs:350:19:350:19 | x | main.rs:350:9:350:20 | print_i64(...) | |
| main.rs:352:10:358:5 | if ... {...} else {...} | main.rs:347:5:358:5 | if ... {...} else {...} | |
| main.rs:352:13:353:7 | let ... = x | main.rs:353:7:353:7 | x | |
| main.rs:352:13:353:7 | [boolean(false)] let ... = x | main.rs:357:9:357:30 | ExprStmt | false |
| main.rs:352:13:353:7 | [boolean(true)] let ... = x | main.rs:355:9:355:21 | ExprStmt | true |
| main.rs:352:17:352:21 | Ok(...) | main.rs:352:13:353:7 | [boolean(false)] let ... = x | no-match |
| main.rs:352:17:352:21 | Ok(...) | main.rs:352:20:352:20 | x | match |
| main.rs:352:17:352:21 | Ok(...) | main.rs:357:9:357:30 | ExprStmt | no-match |
| main.rs:352:20:352:20 | x | main.rs:352:13:353:7 | [boolean(true)] let ... = x | match |
| main.rs:352:20:352:20 | x | main.rs:352:20:352:20 | x | |
| main.rs:352:20:352:20 | x | main.rs:355:9:355:21 | ExprStmt | match |
| main.rs:353:7:353:7 | x | main.rs:352:17:352:21 | Ok(...) | |
| main.rs:354:5:356:5 | { ... } | main.rs:352:10:358:5 | if ... {...} else {...} | |
| main.rs:355:9:355:17 | print_i64 | main.rs:355:19:355:19 | x | |

View File

@@ -76,10 +76,18 @@ definition
| main.rs:272:79:272:81 | a13 | main.rs:272:9:272:109 | a13 |
| main.rs:272:106:272:108 | a13 | main.rs:272:9:272:109 | a13 |
| main.rs:279:9:279:9 | x | main.rs:279:9:279:9 | x |
| main.rs:280:17:280:17 | x | main.rs:280:17:280:17 | x |
| main.rs:287:13:287:13 | x | main.rs:287:13:287:13 | x |
| main.rs:295:9:295:9 | x | main.rs:295:9:295:9 | x |
| main.rs:296:17:296:17 | x | main.rs:296:17:296:17 | x |
| main.rs:299:14:299:14 | x | main.rs:299:14:299:14 | x |
| main.rs:306:13:306:13 | x | main.rs:306:13:306:13 | x |
| main.rs:314:9:314:9 | x | main.rs:314:9:314:9 | x |
| main.rs:315:20:315:20 | x | main.rs:315:20:315:20 | x |
| main.rs:318:14:318:14 | x | main.rs:318:14:318:14 | x |
| main.rs:332:9:332:9 | x | main.rs:332:9:332:9 | x |
| main.rs:334:14:334:14 | x | main.rs:334:14:334:14 | x |
| main.rs:335:20:335:20 | x | main.rs:335:20:335:20 | x |
| main.rs:346:9:346:9 | x | main.rs:346:9:346:9 | x |
| main.rs:347:16:347:16 | x | main.rs:347:16:347:16 | x |
| main.rs:352:20:352:20 | x | main.rs:352:20:352:20 | x |
@@ -245,11 +253,25 @@ read
| main.rs:270:9:270:10 | fv | main.rs:270:9:270:10 | fv | main.rs:271:11:271:12 | fv |
| main.rs:272:9:272:109 | SSA phi(a13) | main.rs:272:9:272:109 | a13 | main.rs:273:26:273:28 | a13 |
| main.rs:279:9:279:9 | x | main.rs:279:9:279:9 | x | main.rs:281:7:281:7 | x |
| main.rs:279:9:279:9 | x | main.rs:279:9:279:9 | x | main.rs:288:13:288:13 | x |
| main.rs:280:17:280:17 | x | main.rs:280:17:280:17 | x | main.rs:283:5:283:5 | x |
| main.rs:280:17:280:17 | x | main.rs:280:17:280:17 | x | main.rs:285:19:285:19 | x |
| main.rs:287:13:287:13 | x | main.rs:287:13:287:13 | x | main.rs:289:19:289:19 | x |
| main.rs:295:9:295:9 | x | main.rs:295:9:295:9 | x | main.rs:297:7:297:7 | x |
| main.rs:295:9:295:9 | x | main.rs:295:9:295:9 | x | main.rs:307:13:307:13 | x |
| main.rs:296:17:296:17 | x | main.rs:296:17:296:17 | x | main.rs:300:12:300:12 | x |
| main.rs:299:14:299:14 | x | main.rs:299:14:299:14 | x | main.rs:302:5:302:5 | x |
| main.rs:299:14:299:14 | x | main.rs:299:14:299:14 | x | main.rs:304:19:304:19 | x |
| main.rs:306:13:306:13 | x | main.rs:306:13:306:13 | x | main.rs:308:19:308:19 | x |
| main.rs:314:9:314:9 | x | main.rs:314:9:314:9 | x | main.rs:316:7:316:7 | x |
| main.rs:314:9:314:9 | x | main.rs:314:9:314:9 | x | main.rs:327:15:327:15 | x |
| main.rs:315:20:315:20 | x | main.rs:315:20:315:20 | x | main.rs:319:12:319:12 | x |
| main.rs:318:14:318:14 | x | main.rs:318:14:318:14 | x | main.rs:321:5:321:5 | x |
| main.rs:318:14:318:14 | x | main.rs:318:14:318:14 | x | main.rs:323:19:323:19 | x |
| main.rs:332:9:332:9 | x | main.rs:332:9:332:9 | x | main.rs:333:11:333:11 | x |
| main.rs:332:9:332:9 | x | main.rs:332:9:332:9 | x | main.rs:341:15:341:15 | x |
| main.rs:334:14:334:14 | x | main.rs:334:14:334:14 | x | main.rs:336:18:336:18 | x |
| main.rs:335:20:335:20 | x | main.rs:335:20:335:20 | x | main.rs:337:19:337:19 | x |
| main.rs:346:9:346:9 | x | main.rs:346:9:346:9 | x | main.rs:348:7:348:7 | x |
| main.rs:346:9:346:9 | x | main.rs:346:9:346:9 | x | main.rs:353:7:353:7 | x |
| main.rs:346:9:346:9 | x | main.rs:346:9:346:9 | x | main.rs:357:19:357:19 | x |
@@ -425,10 +447,18 @@ firstRead
| main.rs:270:9:270:10 | fv | main.rs:270:9:270:10 | fv | main.rs:271:11:271:12 | fv |
| main.rs:272:9:272:109 | SSA phi(a13) | main.rs:272:9:272:109 | a13 | main.rs:273:26:273:28 | a13 |
| main.rs:279:9:279:9 | x | main.rs:279:9:279:9 | x | main.rs:281:7:281:7 | x |
| main.rs:280:17:280:17 | x | main.rs:280:17:280:17 | x | main.rs:283:5:283:5 | x |
| main.rs:287:13:287:13 | x | main.rs:287:13:287:13 | x | main.rs:289:19:289:19 | x |
| main.rs:295:9:295:9 | x | main.rs:295:9:295:9 | x | main.rs:297:7:297:7 | x |
| main.rs:296:17:296:17 | x | main.rs:296:17:296:17 | x | main.rs:300:12:300:12 | x |
| main.rs:299:14:299:14 | x | main.rs:299:14:299:14 | x | main.rs:302:5:302:5 | x |
| main.rs:306:13:306:13 | x | main.rs:306:13:306:13 | x | main.rs:308:19:308:19 | x |
| main.rs:314:9:314:9 | x | main.rs:314:9:314:9 | x | main.rs:316:7:316:7 | x |
| main.rs:315:20:315:20 | x | main.rs:315:20:315:20 | x | main.rs:319:12:319:12 | x |
| main.rs:318:14:318:14 | x | main.rs:318:14:318:14 | x | main.rs:321:5:321:5 | x |
| main.rs:332:9:332:9 | x | main.rs:332:9:332:9 | x | main.rs:333:11:333:11 | x |
| main.rs:334:14:334:14 | x | main.rs:334:14:334:14 | x | main.rs:336:18:336:18 | x |
| main.rs:335:20:335:20 | x | main.rs:335:20:335:20 | x | main.rs:337:19:337:19 | x |
| main.rs:346:9:346:9 | x | main.rs:346:9:346:9 | x | main.rs:348:7:348:7 | x |
| main.rs:347:16:347:16 | x | main.rs:347:16:347:16 | x | main.rs:350:19:350:19 | x |
| main.rs:352:20:352:20 | x | main.rs:352:20:352:20 | x | main.rs:355:19:355:19 | x |
@@ -530,6 +560,12 @@ adjacentReads
| main.rs:220:9:220:10 | tv | main.rs:220:9:220:10 | tv | main.rs:221:11:221:12 | tv | main.rs:225:11:225:12 | tv |
| main.rs:220:9:220:10 | tv | main.rs:220:9:220:10 | tv | main.rs:225:11:225:12 | tv | main.rs:229:11:229:12 | tv |
| main.rs:238:9:238:44 | [match(true)] SSA phi(a7) | main.rs:238:9:238:44 | a7 | main.rs:239:16:239:17 | a7 | main.rs:240:26:240:27 | a7 |
| main.rs:279:9:279:9 | x | main.rs:279:9:279:9 | x | main.rs:281:7:281:7 | x | main.rs:288:13:288:13 | x |
| main.rs:280:17:280:17 | x | main.rs:280:17:280:17 | x | main.rs:283:5:283:5 | x | main.rs:285:19:285:19 | x |
| main.rs:295:9:295:9 | x | main.rs:295:9:295:9 | x | main.rs:297:7:297:7 | x | main.rs:307:13:307:13 | x |
| main.rs:299:14:299:14 | x | main.rs:299:14:299:14 | x | main.rs:302:5:302:5 | x | main.rs:304:19:304:19 | x |
| main.rs:314:9:314:9 | x | main.rs:314:9:314:9 | x | main.rs:316:7:316:7 | x | main.rs:327:15:327:15 | x |
| main.rs:318:14:318:14 | x | main.rs:318:14:318:14 | x | main.rs:321:5:321:5 | x | main.rs:323:19:323:19 | x |
| main.rs:332:9:332:9 | x | main.rs:332:9:332:9 | x | main.rs:333:11:333:11 | x | main.rs:341:15:341:15 | x |
| main.rs:346:9:346:9 | x | main.rs:346:9:346:9 | x | main.rs:348:7:348:7 | x | main.rs:353:7:353:7 | x |
| main.rs:346:9:346:9 | x | main.rs:346:9:346:9 | x | main.rs:353:7:353:7 | x | main.rs:357:19:357:19 | x |
@@ -590,15 +626,15 @@ phi
| main.rs:726:17:728:9 | SSA phi(x) | main.rs:723:13:723:13 | x | main.rs:724:19:729:5 | <captured entry> x |
| main.rs:726:17:728:9 | SSA phi(x) | main.rs:723:13:723:13 | x | main.rs:727:13:727:13 | x |
phiReadNode
| main.rs:113:11:114:12 | SSA phi read(s1) | main.rs:111:9:111:10 | s1 |
| main.rs:114:11:114:12 | SSA phi read(s1) | main.rs:111:9:111:10 | s1 |
| main.rs:605:13:610:5 | SSA phi read(x) | main.rs:603:9:603:9 | x |
phiReadNodeFirstRead
| main.rs:113:11:114:12 | SSA phi read(s1) | main.rs:111:9:111:10 | s1 | main.rs:114:11:114:12 | s1 |
| main.rs:114:11:114:12 | SSA phi read(s1) | main.rs:111:9:111:10 | s1 | main.rs:114:11:114:12 | s1 |
| main.rs:605:13:610:5 | SSA phi read(x) | main.rs:603:9:603:9 | x | main.rs:615:19:615:19 | x |
| main.rs:605:13:610:5 | SSA phi read(x) | main.rs:603:9:603:9 | x | main.rs:617:19:617:19 | x |
phiReadInput
| main.rs:113:11:114:12 | SSA phi read(s1) | main.rs:111:9:111:10 | s1 |
| main.rs:113:11:114:12 | SSA phi read(s1) | main.rs:114:11:114:12 | SSA read(s1) |
| main.rs:114:11:114:12 | SSA phi read(s1) | main.rs:111:9:111:10 | s1 |
| main.rs:114:11:114:12 | SSA phi read(s1) | main.rs:114:11:114:12 | SSA read(s1) |
| main.rs:605:13:610:5 | SSA phi read(x) | main.rs:607:19:607:19 | SSA read(x) |
| main.rs:605:13:610:5 | SSA phi read(x) | main.rs:609:19:609:19 | SSA read(x) |
ultimateDef
@@ -659,9 +695,12 @@ assigns
| main.rs:246:9:246:14 | either | main.rs:246:18:246:33 | ...::Left(...) |
| main.rs:270:9:270:10 | fv | main.rs:270:14:270:35 | ...::Second(...) |
| main.rs:279:9:279:9 | x | main.rs:279:12:279:19 | Some(...) |
| main.rs:287:13:287:13 | x | main.rs:288:13:288:13 | x |
| main.rs:295:9:295:9 | x | main.rs:295:13:295:20 | Some(...) |
| main.rs:306:13:306:13 | x | main.rs:307:13:307:13 | x |
| main.rs:314:9:314:9 | x | main.rs:314:13:314:20 | Some(...) |
| main.rs:332:9:332:9 | x | main.rs:332:13:332:20 | Some(...) |
| main.rs:335:20:335:20 | x | main.rs:336:18:336:18 | x |
| main.rs:346:9:346:9 | x | main.rs:346:13:346:18 | Ok(...) |
| main.rs:416:9:416:23 | example_closure | main.rs:417:9:418:9 | \|...\| x |
| main.rs:419:9:419:10 | n1 | main.rs:420:9:420:26 | example_closure(...) |

View File

@@ -280,9 +280,9 @@ fn match_pattern10() {
if let Some(x) // x2
= x // $ read_access=x1
&&
x > 0 // $ MISSING: read_access=x2 $ SPURIOUS: read_access=x1
x > 0 // $ read_access=x2
{
print_i64(x); // $ MISSING: read_access=x2 $ SPURIOUS: read_access=x1
print_i64(x); // $ read_access=x2
} else {
let x = // x3
x; // $ read_access=x1
@@ -297,11 +297,11 @@ fn match_pattern11() {
= x // $ read_access=x1
&&
let Some(x) // x3
= Some(x) // $ MISSING: read_access=x2 $ SPURIOUS: read_access=x1
= Some(x) // $ read_access=x2
&&
x > 0 // $ MISSING: read_access=x3 $ SPURIOUS: read_access=x1
x > 0 // $ read_access=x3
{
print_i64(x); // $ MISSING: read_access=x3 $ SPURIOUS: read_access=x1
print_i64(x); // $ read_access=x3
} else {
let x = // x4
x; // $ read_access=x1
@@ -316,11 +316,11 @@ fn match_pattern12() {
= x // $ read_access=x1
&&
let Some(x) // x3
= Some(x) // $ MISSING: read_access=x2 $ SPURIOUS: read_access=x1
= Some(x) // $ read_access=x2
&&
x > 0 // $ MISSING: read_access=x3 $ SPURIOUS: read_access=x1
x > 0 // $ read_access=x3
{
print_i64(x); // $ MISSING: read_access=x3 $ SPURIOUS: read_access=x1
print_i64(x); // $ read_access=x3
break;
}
@@ -334,7 +334,7 @@ fn match_pattern13() {
Some(x) // x2
if let x // x3
= x // $ read_access=x2
&& x > 0 => (), // $ MISSING: read_access=x3 $ SPURIOUS: read_access=x2
&& x > 0 => (), // $ read_access=x3
_ => ()
}

View File

@@ -202,24 +202,24 @@ variableAccess
| main.rs:271:11:271:12 | fv | main.rs:270:9:270:10 | fv |
| main.rs:273:26:273:28 | a13 | main.rs:272:9:272:109 | a13 |
| main.rs:281:7:281:7 | x | main.rs:279:9:279:9 | x |
| main.rs:283:5:283:5 | x | main.rs:279:9:279:9 | x |
| main.rs:285:19:285:19 | x | main.rs:279:9:279:9 | x |
| main.rs:283:5:283:5 | x | main.rs:280:17:280:17 | x |
| main.rs:285:19:285:19 | x | main.rs:280:17:280:17 | x |
| main.rs:288:13:288:13 | x | main.rs:279:9:279:9 | x |
| main.rs:289:19:289:19 | x | main.rs:287:13:287:13 | x |
| main.rs:297:7:297:7 | x | main.rs:295:9:295:9 | x |
| main.rs:300:12:300:12 | x | main.rs:295:9:295:9 | x |
| main.rs:302:5:302:5 | x | main.rs:295:9:295:9 | x |
| main.rs:304:19:304:19 | x | main.rs:295:9:295:9 | x |
| main.rs:300:12:300:12 | x | main.rs:296:17:296:17 | x |
| main.rs:302:5:302:5 | x | main.rs:299:14:299:14 | x |
| main.rs:304:19:304:19 | x | main.rs:299:14:299:14 | x |
| main.rs:307:13:307:13 | x | main.rs:295:9:295:9 | x |
| main.rs:308:19:308:19 | x | main.rs:306:13:306:13 | x |
| main.rs:316:7:316:7 | x | main.rs:314:9:314:9 | x |
| main.rs:319:12:319:12 | x | main.rs:314:9:314:9 | x |
| main.rs:321:5:321:5 | x | main.rs:314:9:314:9 | x |
| main.rs:323:19:323:19 | x | main.rs:314:9:314:9 | x |
| main.rs:319:12:319:12 | x | main.rs:315:20:315:20 | x |
| main.rs:321:5:321:5 | x | main.rs:318:14:318:14 | x |
| main.rs:323:19:323:19 | x | main.rs:318:14:318:14 | x |
| main.rs:327:15:327:15 | x | main.rs:314:9:314:9 | x |
| main.rs:333:11:333:11 | x | main.rs:332:9:332:9 | x |
| main.rs:336:18:336:18 | x | main.rs:334:14:334:14 | x |
| main.rs:337:19:337:19 | x | main.rs:334:14:334:14 | x |
| main.rs:337:19:337:19 | x | main.rs:335:20:335:20 | x |
| main.rs:341:15:341:15 | x | main.rs:332:9:332:9 | x |
| main.rs:348:7:348:7 | x | main.rs:346:9:346:9 | x |
| main.rs:350:19:350:19 | x | main.rs:347:16:347:16 | x |
@@ -426,24 +426,24 @@ variableReadAccess
| main.rs:271:11:271:12 | fv | main.rs:270:9:270:10 | fv |
| main.rs:273:26:273:28 | a13 | main.rs:272:9:272:109 | a13 |
| main.rs:281:7:281:7 | x | main.rs:279:9:279:9 | x |
| main.rs:283:5:283:5 | x | main.rs:279:9:279:9 | x |
| main.rs:285:19:285:19 | x | main.rs:279:9:279:9 | x |
| main.rs:283:5:283:5 | x | main.rs:280:17:280:17 | x |
| main.rs:285:19:285:19 | x | main.rs:280:17:280:17 | x |
| main.rs:288:13:288:13 | x | main.rs:279:9:279:9 | x |
| main.rs:289:19:289:19 | x | main.rs:287:13:287:13 | x |
| main.rs:297:7:297:7 | x | main.rs:295:9:295:9 | x |
| main.rs:300:12:300:12 | x | main.rs:295:9:295:9 | x |
| main.rs:302:5:302:5 | x | main.rs:295:9:295:9 | x |
| main.rs:304:19:304:19 | x | main.rs:295:9:295:9 | x |
| main.rs:300:12:300:12 | x | main.rs:296:17:296:17 | x |
| main.rs:302:5:302:5 | x | main.rs:299:14:299:14 | x |
| main.rs:304:19:304:19 | x | main.rs:299:14:299:14 | x |
| main.rs:307:13:307:13 | x | main.rs:295:9:295:9 | x |
| main.rs:308:19:308:19 | x | main.rs:306:13:306:13 | x |
| main.rs:316:7:316:7 | x | main.rs:314:9:314:9 | x |
| main.rs:319:12:319:12 | x | main.rs:314:9:314:9 | x |
| main.rs:321:5:321:5 | x | main.rs:314:9:314:9 | x |
| main.rs:323:19:323:19 | x | main.rs:314:9:314:9 | x |
| main.rs:319:12:319:12 | x | main.rs:315:20:315:20 | x |
| main.rs:321:5:321:5 | x | main.rs:318:14:318:14 | x |
| main.rs:323:19:323:19 | x | main.rs:318:14:318:14 | x |
| main.rs:327:15:327:15 | x | main.rs:314:9:314:9 | x |
| main.rs:333:11:333:11 | x | main.rs:332:9:332:9 | x |
| main.rs:336:18:336:18 | x | main.rs:334:14:334:14 | x |
| main.rs:337:19:337:19 | x | main.rs:334:14:334:14 | x |
| main.rs:337:19:337:19 | x | main.rs:335:20:335:20 | x |
| main.rs:341:15:341:15 | x | main.rs:332:9:332:9 | x |
| main.rs:348:7:348:7 | x | main.rs:346:9:346:9 | x |
| main.rs:350:19:350:19 | x | main.rs:347:16:347:16 | x |
@@ -584,6 +584,7 @@ variableInitializer
| main.rs:306:13:306:13 | x | main.rs:307:13:307:13 | x |
| main.rs:314:9:314:9 | x | main.rs:314:13:314:20 | Some(...) |
| main.rs:332:9:332:9 | x | main.rs:332:13:332:20 | Some(...) |
| main.rs:335:20:335:20 | x | main.rs:336:18:336:18 | x |
| main.rs:346:9:346:9 | x | main.rs:346:13:346:18 | Ok(...) |
| main.rs:416:9:416:23 | example_closure | main.rs:417:9:418:9 | \|...\| x |
| main.rs:419:9:419:10 | n1 | main.rs:420:9:420:26 | example_closure(...) |

View File

@@ -11,6 +11,7 @@
| lifetime.rs:172:13:172:15 | ptr | lifetime.rs:187:12:187:21 | &my_local1 | lifetime.rs:172:13:172:15 | ptr | Access of a pointer to $@ after its lifetime has ended. | lifetime.rs:186:6:186:14 | my_local1 | my_local1 |
| lifetime.rs:255:14:255:17 | prev | lifetime.rs:251:10:251:19 | &my_local2 | lifetime.rs:255:14:255:17 | prev | Access of a pointer to $@ after its lifetime has ended. | lifetime.rs:242:7:242:15 | my_local2 | my_local2 |
| lifetime.rs:310:31:310:32 | e1 | lifetime.rs:272:30:272:32 | &e1 | lifetime.rs:310:31:310:32 | e1 | Access of a pointer to $@ after its lifetime has ended. | lifetime.rs:271:6:271:7 | e1 | e1 |
| lifetime.rs:314:23:314:24 | p2 | lifetime.rs:279:28:279:30 | &v2 | lifetime.rs:314:23:314:24 | p2 | Access of a pointer to $@ after its lifetime has ended. | lifetime.rs:278:6:278:7 | v2 | v2 |
| lifetime.rs:317:13:317:18 | result | lifetime.rs:289:25:289:26 | &x | lifetime.rs:317:13:317:18 | result | Access of a pointer to $@ after its lifetime has ended. | lifetime.rs:289:17:289:17 | x | x |
| lifetime.rs:411:16:411:17 | p1 | lifetime.rs:383:31:383:37 | &raw mut my_pair | lifetime.rs:411:16:411:17 | p1 | Access of a pointer to $@ after its lifetime has ended. | lifetime.rs:382:11:382:17 | my_pair | my_pair |
| lifetime.rs:416:16:416:17 | p1 | lifetime.rs:383:31:383:37 | &raw mut my_pair | lifetime.rs:416:16:416:17 | p1 | Access of a pointer to $@ after its lifetime has ended. | lifetime.rs:382:11:382:17 | my_pair | my_pair |
@@ -123,14 +124,22 @@ edges
| lifetime.rs:270:47:275:1 | { ... } | lifetime.rs:303:11:303:31 | get_pointer_to_enum(...) | provenance | |
| lifetime.rs:272:6:272:11 | result | lifetime.rs:270:47:275:1 | { ... } | provenance | |
| lifetime.rs:272:30:272:32 | &e1 | lifetime.rs:272:6:272:11 | result | provenance | |
| lifetime.rs:277:41:282:1 | { ... } [Pointer] | lifetime.rs:304:11:304:31 | get_pointer_in_enum(...) [Pointer] | provenance | |
| lifetime.rs:279:6:279:7 | e2 [Pointer] | lifetime.rs:277:41:282:1 | { ... } [Pointer] | provenance | |
| lifetime.rs:279:11:279:31 | ...::Pointer(...) [Pointer] | lifetime.rs:279:6:279:7 | e2 [Pointer] | provenance | |
| lifetime.rs:279:28:279:30 | &v2 | lifetime.rs:279:11:279:31 | ...::Pointer(...) [Pointer] | provenance | |
| lifetime.rs:284:46:300:1 | { ... } | lifetime.rs:305:15:305:37 | get_pointer_from_enum(...) | provenance | |
| lifetime.rs:288:2:288:7 | result | lifetime.rs:284:46:300:1 | { ... } | provenance | |
| lifetime.rs:288:2:288:7 | result | lifetime.rs:295:13:295:18 | result | provenance | |
| lifetime.rs:289:25:289:26 | &x | lifetime.rs:288:2:288:7 | result | provenance | |
| lifetime.rs:303:6:303:7 | e1 | lifetime.rs:310:31:310:32 | e1 | provenance | |
| lifetime.rs:303:11:303:31 | get_pointer_to_enum(...) | lifetime.rs:303:6:303:7 | e1 | provenance | |
| lifetime.rs:304:6:304:7 | e2 [Pointer] | lifetime.rs:313:10:313:29 | ...::Pointer(...) [Pointer] | provenance | |
| lifetime.rs:304:11:304:31 | get_pointer_in_enum(...) [Pointer] | lifetime.rs:304:6:304:7 | e2 [Pointer] | provenance | |
| lifetime.rs:305:6:305:11 | result | lifetime.rs:317:13:317:18 | result | provenance | |
| lifetime.rs:305:15:305:37 | get_pointer_from_enum(...) | lifetime.rs:305:6:305:11 | result | provenance | |
| lifetime.rs:313:10:313:29 | ...::Pointer(...) [Pointer] | lifetime.rs:313:27:313:28 | p2 | provenance | |
| lifetime.rs:313:27:313:28 | p2 | lifetime.rs:314:23:314:24 | p2 | provenance | |
| lifetime.rs:383:3:383:4 | p1 | lifetime.rs:388:15:388:16 | p1 | provenance | |
| lifetime.rs:383:3:383:4 | p1 | lifetime.rs:391:15:391:16 | p1 | provenance | |
| lifetime.rs:383:3:383:4 | p1 | lifetime.rs:399:6:399:7 | p1 | provenance | |
@@ -323,15 +332,24 @@ nodes
| lifetime.rs:270:47:275:1 | { ... } | semmle.label | { ... } |
| lifetime.rs:272:6:272:11 | result | semmle.label | result |
| lifetime.rs:272:30:272:32 | &e1 | semmle.label | &e1 |
| lifetime.rs:277:41:282:1 | { ... } [Pointer] | semmle.label | { ... } [Pointer] |
| lifetime.rs:279:6:279:7 | e2 [Pointer] | semmle.label | e2 [Pointer] |
| lifetime.rs:279:11:279:31 | ...::Pointer(...) [Pointer] | semmle.label | ...::Pointer(...) [Pointer] |
| lifetime.rs:279:28:279:30 | &v2 | semmle.label | &v2 |
| lifetime.rs:284:46:300:1 | { ... } | semmle.label | { ... } |
| lifetime.rs:288:2:288:7 | result | semmle.label | result |
| lifetime.rs:289:25:289:26 | &x | semmle.label | &x |
| lifetime.rs:295:13:295:18 | result | semmle.label | result |
| lifetime.rs:303:6:303:7 | e1 | semmle.label | e1 |
| lifetime.rs:303:11:303:31 | get_pointer_to_enum(...) | semmle.label | get_pointer_to_enum(...) |
| lifetime.rs:304:6:304:7 | e2 [Pointer] | semmle.label | e2 [Pointer] |
| lifetime.rs:304:11:304:31 | get_pointer_in_enum(...) [Pointer] | semmle.label | get_pointer_in_enum(...) [Pointer] |
| lifetime.rs:305:6:305:11 | result | semmle.label | result |
| lifetime.rs:305:15:305:37 | get_pointer_from_enum(...) | semmle.label | get_pointer_from_enum(...) |
| lifetime.rs:310:31:310:32 | e1 | semmle.label | e1 |
| lifetime.rs:313:10:313:29 | ...::Pointer(...) [Pointer] | semmle.label | ...::Pointer(...) [Pointer] |
| lifetime.rs:313:27:313:28 | p2 | semmle.label | p2 |
| lifetime.rs:314:23:314:24 | p2 | semmle.label | p2 |
| lifetime.rs:317:13:317:18 | result | semmle.label | result |
| lifetime.rs:383:3:383:4 | p1 | semmle.label | p1 |
| lifetime.rs:383:31:383:37 | &raw mut my_pair | semmle.label | &raw mut my_pair |

View File

@@ -276,7 +276,7 @@ pub fn get_pointer_to_enum() -> *const MyEnum {
pub fn get_pointer_in_enum() -> MyEnum2 {
let v2 = 2;
let e2 = MyEnum2::Pointer(&v2); // $ MISSING: Source[rust/access-after-lifetime-ended]=v2
let e2 = MyEnum2::Pointer(&v2); // $ Source[rust/access-after-lifetime-ended]=v2
e2
} // (v2 goes out of scope, so the contained pointer is dangling)
@@ -311,7 +311,7 @@ pub fn test_enums() {
println!(" v1 = {v1} (!)"); // corrupt in practice
}
if let MyEnum2::Pointer(p2) = e2 {
let v2 = unsafe { *p2 }; // $ MISSING: Alert[rust/access-after-lifetime-ended]=v2
let v2 = unsafe { *p2 }; // $ Alert[rust/access-after-lifetime-ended]=v2
println!(" v2 = {v2} (!)"); // corrupt in practice
}
let v3 = *result; // $ Alert[rust/access-after-lifetime-ended]=match_x

View File

@@ -1,2 +0,0 @@
deadEnd
| main.rs:376:17:376:17 | m |

View File

@@ -12,6 +12,7 @@
| main.rs:117:9:117:10 | is | Variable $@ is assigned a value that is never used. | main.rs:117:9:117:10 | is | is |
| main.rs:140:13:140:17 | total | Variable $@ is assigned a value that is never used. | main.rs:140:13:140:17 | total | total |
| main.rs:285:13:285:17 | total | Variable $@ is assigned a value that is never used. | main.rs:253:13:253:17 | total | total |
| main.rs:322:12:322:12 | j | Variable $@ is assigned a value that is never used. | main.rs:322:12:322:12 | j | j |
| main.rs:382:9:382:9 | x | Variable $@ is assigned a value that is never used. | main.rs:382:9:382:9 | x | x |
| main.rs:390:17:390:17 | x | Variable $@ is assigned a value that is never used. | main.rs:390:17:390:17 | x | x |
| main.rs:536:9:536:20 | var_in_macro | Variable $@ is assigned a value that is never used. | main.rs:536:9:536:20 | var_in_macro | var_in_macro |

View File

@@ -8,13 +8,11 @@
| main.rs:292:22:292:24 | val | Variable 'val' is not used. |
| main.rs:299:24:299:26 | val | Variable 'val' is not used. |
| main.rs:307:13:307:15 | num | Variable 'num' is not used. |
| main.rs:322:12:322:12 | j | Variable 'j' is not used. |
| main.rs:342:25:342:25 | y | Variable 'y' is not used. |
| main.rs:345:28:345:28 | a | Variable 'a' is not used. |
| main.rs:348:9:348:9 | p | Variable 'p' is not used. |
| main.rs:366:9:366:13 | right | Variable 'right' is not used. |
| main.rs:372:9:372:14 | right2 | Variable 'right2' is not used. |
| main.rs:376:17:376:17 | m | Variable 'm' is not used. |
| main.rs:383:13:383:13 | y | Variable 'y' is not used. |
| main.rs:391:21:391:21 | y | Variable 'y' is not used. |
| main.rs:436:26:436:28 | val | Variable 'val' is not used. |

View File

@@ -319,7 +319,7 @@ fn if_lets_matches() {
No => {}
}
if let j = Yes { // $ Alert[rust/unused-variable]
if let j = Yes { // $ Alert[rust/unused-value]
}
if let k = Yes {
@@ -373,7 +373,7 @@ fn if_lets_matches() {
pair;
_ = left2;
if let Some(m) = Some(10) // $ SPURIOUS: Alert[rust/unused-variable]
if let Some(m) = Some(10)
&& m > 0
{}
}

View File

@@ -160,7 +160,7 @@ impl<T> MyOption<T> {
}
// summary=<test::option::MyOption>::inspect;Argument[self];ReturnValue;value;dfc-generated
// MISSING: Due to `ref` pattern.
// summary=<test::option::MyOption>::inspect;Argument[self].Field[test::option::MyOption::MySome(0)];Argument[0].Parameter[0].Reference;value;dfc-generated
pub fn inspect<F: FnOnce(&T)>(self, f: F) -> Self {
if let MySome(ref x) = self {
f(x);
@@ -253,7 +253,8 @@ impl<T> MyOption<T> {
}
}
// MISSING: Reference passed to predicate
// summary=<test::option::MyOption>::filter;Argument[self].Field[test::option::MyOption::MySome(0)];Argument[0].Parameter[0].Reference;value;dfc-generated
// summary=<test::option::MyOption>::filter;Argument[self].Field[test::option::MyOption::MySome(0)];ReturnValue.Field[test::option::MyOption::MySome(0)];value;dfc-generated
pub fn filter<P>(self, predicate: P) -> Self
where
P: FnOnce(&T) -> bool,