Merge branch 'main' into rust-type-inference-tweaks

This commit is contained in:
Simon Friis Vindum
2025-03-17 13:18:45 +01:00
270 changed files with 5231 additions and 4686 deletions

View File

@@ -504,7 +504,7 @@ lib/codeql/rust/elements/internal/generated/ConstParam.qll 310342603959a4d521418
lib/codeql/rust/elements/internal/generated/ContinueExpr.qll e2010feb14fb6edeb83a991d9357e50edb770172ddfde2e8670b0d3e68169f28 48d09d661e1443002f6d22b8710e22c9c36d9daa9cde09c6366a61e960d717cb
lib/codeql/rust/elements/internal/generated/Crate.qll 2d7124b095738cb13dca8e1c402986ae575062f19104c331a6928dd86f8f01e6 8cd20d12e3a5f9202a12c81479fb9d2741109eb0b74c1541c6aa4258501b0478
lib/codeql/rust/elements/internal/generated/DynTraitTypeRepr.qll a9d540717af1f00dbea1c683fd6b846cddfb2968c7f3e021863276f123337787 1972efb9bca7aae9a9708ca6dcf398e5e8c6d2416a07d525dba1649b80fbe4d1
lib/codeql/rust/elements/internal/generated/Element.qll fb483b636180c699181c8aff83bc471b2c416206694f7028c671015918547663 542d1b9ae80c997974c94db3655887186df3921a8fa3f565eaf292dcfdac3c4c
lib/codeql/rust/elements/internal/generated/Element.qll 69ce882811f2bef7e0a93c0a24494dd16120a108ba4180d455344e29144a98c4 7781bc5c69b5b08775902fcb97cb23f85359ef2303545afe9d44301b19024b3a
lib/codeql/rust/elements/internal/generated/Enum.qll 4f4cbc9cd758c20d476bc767b916c62ba434d1750067d0ffb63e0821bb95ec86 3da735d54022add50cec0217bbf8ec4cf29b47f4851ee327628bcdd6454989d0
lib/codeql/rust/elements/internal/generated/Expr.qll 5fa34f2ed21829a1509417440dae42d416234ff43433002974328e7aabb8f30f 46f3972c7413b7db28a3ea8acb5a50a74b6dd9b658e8725f6953a8829ac912f8
lib/codeql/rust/elements/internal/generated/ExprStmt.qll d1112230015fbeb216b43407a268dc2ccd0f9e0836ab2dca4800c51b38fa1d7d 4a80562dcc55efa5e72c6c3b1d6747ab44fe494e76faff2b8f6e9f10a4b08b5b

View File

@@ -126,8 +126,11 @@ private predicate cannotCauseMatchFailure(Pat pat) {
pat instanceof RangePat or
// Identifier patterns that are in fact path patterns can cause failures. For
// instance `None`. Only if an `@ ...` part is present can we be sure that
// it's an actual identifier pattern.
pat = any(IdentPat p | p.hasPat()) or
// it's an actual identifier pattern. As a heuristic, if the identifier starts
// with a lower case letter, then we assume that it's an identifier. This
// works for code that follows the Rust naming convention for enums and
// constants.
pat = any(IdentPat p | p.hasPat() or p.getName().getText().charAt(0).isLowercase()) or
pat instanceof WildcardPat or
pat instanceof RestPat or
pat instanceof RefPat or

View File

@@ -6,7 +6,8 @@
private import rust
private import codeql.dataflow.DataFlow
private import internal.DataFlowImpl as DataFlowImpl
private import DataFlowImpl::Node as Node
private import internal.Node as Node
private import internal.Content as Content
/**
* Provides classes for performing local (intra-procedural) and global
@@ -23,9 +24,23 @@ module DataFlow {
final class PostUpdateNode = Node::PostUpdateNodePublic;
final class Content = DataFlowImpl::Content;
final class Content = Content::Content;
final class ContentSet = DataFlowImpl::ContentSet;
final class FieldContent = Content::FieldContent;
final class TuplePositionContent = Content::TuplePositionContent;
final class TupleFieldContent = Content::TupleFieldContent;
final class RecordFieldContent = Content::RecordFieldContent;
final class ReferenceContent = Content::ReferenceContent;
final class ElementContent = Content::ElementContent;
final class FutureContent = Content::FutureContent;
final class ContentSet = Content::ContentSet;
/**
* Holds if data flows from `nodeFrom` to `nodeTo` in exactly one local

View File

@@ -0,0 +1,239 @@
/**
* Provides the `Content` class and subclasses thereof.
*/
private import rust
private import codeql.rust.controlflow.CfgNodes
private import DataFlowImpl
/**
* A path to a value contained in an object. For example a field name of a struct.
*/
abstract class Content extends TContent {
/** Gets a textual representation of this content. */
abstract string toString();
/** Gets the location of this content. */
abstract Location getLocation();
}
/** A field belonging to either a variant or a struct. */
abstract class FieldContent extends Content {
/** Gets an access to this field. */
pragma[nomagic]
abstract FieldExprCfgNode getAnAccess();
}
/** A tuple field belonging to either a variant or a struct. */
class TupleFieldContent extends FieldContent, TTupleFieldContent {
private TupleField field;
TupleFieldContent() { this = TTupleFieldContent(field) }
/** Holds if this field belongs to an enum variant. */
predicate isVariantField(Variant v, int pos) { field.isVariantField(v, pos) }
/** Holds if this field belongs to a struct. */
predicate isStructField(Struct s, int pos) { field.isStructField(s, pos) }
override FieldExprCfgNode getAnAccess() { field = result.getFieldExpr().getTupleField() }
final override string toString() {
exists(Variant v, int pos, string vname |
this.isVariantField(v, pos) and
vname = v.getName().getText() and
// only print indices when the arity is > 1
if exists(v.getTupleField(1)) then result = vname + "(" + pos + ")" else result = vname
)
or
exists(Struct s, int pos, string sname |
this.isStructField(s, pos) and
sname = s.getName().getText() and
// only print indices when the arity is > 1
if exists(s.getTupleField(1)) then result = sname + "(" + pos + ")" else result = sname
)
}
final override Location getLocation() { result = field.getLocation() }
}
/** A record field belonging to either a variant or a struct. */
class RecordFieldContent extends FieldContent, TRecordFieldContent {
private RecordField field;
RecordFieldContent() { this = TRecordFieldContent(field) }
/** Holds if this field belongs to an enum variant. */
predicate isVariantField(Variant v, string name) { field.isVariantField(v, name) }
/** Holds if this field belongs to a struct. */
predicate isStructField(Struct s, string name) { field.isStructField(s, name) }
override FieldExprCfgNode getAnAccess() { field = result.getFieldExpr().getRecordField() }
final override string toString() {
exists(Variant v, string name, string vname |
this.isVariantField(v, name) and
vname = v.getName().getText() and
// only print field when the arity is > 1
if strictcount(v.getRecordField(_)) > 1 then result = vname + "." + name else result = vname
)
or
exists(Struct s, string name, string sname |
this.isStructField(s, name) and
sname = s.getName().getText() and
// only print field when the arity is > 1
if strictcount(s.getRecordField(_)) > 1 then result = sname + "." + name else result = sname
)
}
final override Location getLocation() { result = field.getLocation() }
}
/** A captured variable. */
final class CapturedVariableContent extends Content, TCapturedVariableContent {
private Variable v;
CapturedVariableContent() { this = TCapturedVariableContent(v) }
/** Gets the captured variable. */
Variable getVariable() { result = v }
override string toString() { result = "captured " + v }
override Location getLocation() { result = v.getLocation() }
}
/** A value referred to by a reference. */
final class ReferenceContent extends Content, TReferenceContent {
override string toString() { result = "&ref" }
override Location getLocation() { result instanceof EmptyLocation }
}
/**
* An element in a collection where we do not track the specific collection
* type nor the placement of the element in the collection. Therefore the
* collection should be one where the elements are reasonably homogeneous,
* i.e., if one is tainted all elements are considered tainted.
*
* Examples include the elements of a set, array, vector, or stack.
*/
final class ElementContent extends Content, TElementContent {
override string toString() { result = "element" }
override Location getLocation() { result instanceof EmptyLocation }
}
/**
* A value that a future resolves to.
*/
final class FutureContent extends Content, TFutureContent {
override string toString() { result = "future" }
override Location getLocation() { result instanceof EmptyLocation }
}
/**
* Content stored at a position in a tuple.
*
* NOTE: Unlike `struct`s and `enum`s tuples are structural and not nominal,
* hence we don't store a canonical path for them.
*/
final class TuplePositionContent extends FieldContent, TTuplePositionContent {
private int pos;
TuplePositionContent() { this = TTuplePositionContent(pos) }
/** Gets the index of this tuple position. */
int getPosition() { result = pos }
override FieldExprCfgNode getAnAccess() {
// TODO: limit to tuple types
result.getNameRef().getText().toInt() = pos
}
override string toString() { result = "tuple." + pos.toString() }
override Location getLocation() { result instanceof EmptyLocation }
}
/**
* A content for the index of an argument to at function call.
*
* Used by the model generator to create flow summaries for higher-order
* functions.
*/
final class FunctionCallArgumentContent extends Content, TFunctionCallArgumentContent {
private int pos;
FunctionCallArgumentContent() { this = TFunctionCallArgumentContent(pos) }
int getPosition() { result = pos }
override string toString() { result = "function argument at " + pos }
override Location getLocation() { result instanceof EmptyLocation }
}
/**
* A content for the return value of function call.
*
* Used by the model generator to create flow summaries for higher-order
* functions.
*/
final class FunctionCallReturnContent extends Content, TFunctionCallReturnContent {
override string toString() { result = "function return" }
override Location getLocation() { result instanceof EmptyLocation }
}
/** A value that represents a set of `Content`s. */
abstract class ContentSet extends TContentSet {
/** Gets a textual representation of this element. */
abstract string toString();
/** Gets a content that may be stored into when storing into this set. */
abstract Content getAStoreContent();
/** Gets a content that may be read from when reading from this set. */
abstract Content getAReadContent();
}
final class SingletonContentSet extends ContentSet, TSingletonContentSet {
private Content c;
SingletonContentSet() { this = TSingletonContentSet(c) }
Content getContent() { result = c }
override string toString() { result = c.toString() }
override Content getAStoreContent() { result = c }
override Content getAReadContent() { result = c }
}
private import codeql.rust.internal.CachedStages
cached
newtype TContent =
TTupleFieldContent(TupleField field) { Stages::DataFlowStage::ref() } or
TRecordFieldContent(RecordField field) or
// TODO: Remove once library types are extracted
TVariantInLibTupleFieldContent(VariantInLib::VariantInLib v, int pos) { pos = v.getAPosition() } or
TElementContent() or
TFutureContent() or
TTuplePositionContent(int pos) {
pos in [0 .. max([
any(TuplePat pat).getNumberOfFields(),
any(FieldExpr access).getNameRef().getText().toInt()
]
)]
} or
TFunctionCallReturnContent() or
TFunctionCallArgumentContent(int pos) {
pos in [0 .. any(CallExpr c).getArgList().getNumberOfArgs() - 1]
} or
TCapturedVariableContent(VariableCapture::CapturedVariable v) or
TReferenceContent()

View File

@@ -1,6 +1,7 @@
import codeql.rust.dataflow.DataFlow::DataFlow as DataFlow
private import rust
private import codeql.rust.dataflow.internal.DataFlowImpl
private import codeql.rust.dataflow.internal.Node as Node
private import codeql.rust.dataflow.internal.TaintTrackingImpl
private import codeql.dataflow.internal.DataFlowImplConsistency

File diff suppressed because it is too large Load Diff

View File

@@ -7,6 +7,7 @@ private import codeql.dataflow.internal.FlowSummaryImpl
private import codeql.dataflow.internal.AccessPathSyntax as AccessPath
private import codeql.rust.dataflow.internal.DataFlowImpl
private import codeql.rust.dataflow.FlowSummary
private import Content
module Input implements InputSig<Location, RustDataFlow> {
private import codeql.rust.elements.internal.CallExprBaseImpl::Impl as CallExprBaseImpl

View File

@@ -0,0 +1,480 @@
/**
* Provides the `Node` class and subclasses thereof.
*
* Classes with names ending in `Public` are exposed as `final` aliases in the
* public `DataFlow` API, so they should not expose internal implementation details.
*/
private import codeql.util.Boolean
private import codeql.dataflow.DataFlow
private import codeql.dataflow.internal.DataFlowImpl
private import rust
private import SsaImpl as SsaImpl
private import codeql.rust.controlflow.ControlFlowGraph
private import codeql.rust.controlflow.CfgNodes
private import codeql.rust.dataflow.Ssa
private import codeql.rust.dataflow.FlowSummary
private import Node as Node
private import DataFlowImpl
private import FlowSummaryImpl as FlowSummaryImpl
/** An element, viewed as a node in a data flow graph. */
abstract class NodePublic extends TNode {
/** Gets the location of this node. */
abstract Location getLocation();
/** Gets a textual representation of this node. */
abstract string toString();
/**
* Gets the expression that corresponds to this node, if any.
*/
ExprCfgNode asExpr() { none() }
/**
* Gets the parameter that corresponds to this node, if any.
*/
ParamBase asParameter() { result = this.(SourceParameterNode).getParameter().getParamBase() }
/**
* Gets the pattern that corresponds to this node, if any.
*/
PatCfgNode asPat() { none() }
}
abstract class Node extends NodePublic {
/** Gets the enclosing callable. */
DataFlowCallable getEnclosingCallable() { result = TCfgScope(this.getCfgScope()) }
/** Do not call: use `getEnclosingCallable()` instead. */
abstract CfgScope getCfgScope();
/**
* Gets the control flow node that corresponds to this data flow node.
*/
CfgNode getCfgNode() { none() }
}
/** A node type that is not implemented. */
final class NaNode extends Node {
NaNode() { none() }
override CfgScope getCfgScope() { none() }
override string toString() { result = "N/A" }
override Location getLocation() { none() }
}
/** A data flow node used to model flow summaries. */
class FlowSummaryNode extends Node, TFlowSummaryNode {
FlowSummaryImpl::Private::SummaryNode getSummaryNode() { this = TFlowSummaryNode(result) }
/** Gets the summarized callable that this node belongs to, if any. */
FlowSummaryImpl::Public::SummarizedCallable getSummarizedCallable() {
result = this.getSummaryNode().getSummarizedCallable()
}
/** Gets the AST source node that this node belongs to, if any */
FlowSummaryImpl::Public::SourceElement getSourceElement() {
result = this.getSummaryNode().getSourceElement()
}
/** Gets the AST sink node that this node belongs to, if any */
FlowSummaryImpl::Public::SinkElement getSinkElement() {
result = this.getSummaryNode().getSinkElement()
}
/** Holds is this node is a source node of kind `kind`. */
predicate isSource(string kind, string model) {
this.getSummaryNode().(FlowSummaryImpl::Private::SourceOutputNode).isEntry(kind, model)
}
/** Holds is this node is a sink node of kind `kind`. */
predicate isSink(string kind, string model) {
this.getSummaryNode().(FlowSummaryImpl::Private::SinkInputNode).isExit(kind, model)
}
override CfgScope getCfgScope() {
result = this.getSummaryNode().getSourceElement().getEnclosingCfgScope()
or
result = this.getSummaryNode().getSinkElement().getEnclosingCfgScope()
}
override DataFlowCallable getEnclosingCallable() {
result.asLibraryCallable() = this.getSummarizedCallable()
or
result.asCfgScope() = this.getCfgScope()
}
override Location getLocation() {
exists(this.getSummarizedCallable()) and
result instanceof EmptyLocation
or
result = this.getSourceElement().getLocation()
or
result = this.getSinkElement().getLocation()
}
override string toString() { result = this.getSummaryNode().toString() }
}
/** A data flow node that corresponds directly to a CFG node for an AST node. */
abstract class AstCfgFlowNode extends Node {
AstCfgNode n;
final override CfgNode getCfgNode() { result = n }
final override CfgScope getCfgScope() { result = n.getAstNode().getEnclosingCfgScope() }
final override Location getLocation() { result = n.getAstNode().getLocation() }
final override string toString() { result = n.getAstNode().toString() }
}
/**
* A node in the data flow graph that corresponds to an expression in the
* AST.
*
* Note that because of control flow splitting, one `Expr` may correspond
* to multiple `ExprNode`s, just like it may correspond to multiple
* `ControlFlow::Node`s.
*/
class ExprNode extends AstCfgFlowNode, TExprNode {
override ExprCfgNode n;
ExprNode() { this = TExprNode(n) }
override ExprCfgNode asExpr() { result = n }
}
final class PatNode extends AstCfgFlowNode, TPatNode {
override PatCfgNode n;
PatNode() { this = TPatNode(n) }
override PatCfgNode asPat() { result = n }
}
/** A data flow node that corresponds to a name node in the CFG. */
final class NameNode extends AstCfgFlowNode, TNameNode {
override NameCfgNode n;
NameNode() { this = TNameNode(n) }
NameCfgNode asName() { result = n }
}
/**
* The value of a parameter at function entry, viewed as a node in a data
* flow graph.
*/
abstract class ParameterNode extends Node {
/** Holds if this node is a parameter of `c` at position `pos`. */
abstract predicate isParameterOf(DataFlowCallable c, ParameterPosition pos);
}
final class SourceParameterNode extends AstCfgFlowNode, ParameterNode, TSourceParameterNode {
override ParamBaseCfgNode n;
SourceParameterNode() { this = TSourceParameterNode(n) }
override predicate isParameterOf(DataFlowCallable c, ParameterPosition pos) {
n.getAstNode() = pos.getParameterIn(c.asCfgScope().(Callable).getParamList())
}
/** Get the parameter position of this parameter. */
ParameterPosition getPosition() { this.isParameterOf(_, result) }
/** Gets the parameter in the CFG that this node corresponds to. */
ParamBaseCfgNode getParameter() { result = n }
}
/** A parameter for a library callable with a flow summary. */
final class SummaryParameterNode extends ParameterNode, FlowSummaryNode {
private ParameterPosition pos_;
SummaryParameterNode() {
FlowSummaryImpl::Private::summaryParameterNode(this.getSummaryNode(), pos_)
}
override predicate isParameterOf(DataFlowCallable c, ParameterPosition pos) {
this.getSummarizedCallable() = c.asLibraryCallable() and pos = pos_
}
}
/**
* The run-time representation of a closure itself at function entry, viewed
* as a node in a data flow graph.
*/
final class ClosureParameterNode extends ParameterNode, TClosureSelfReferenceNode {
private CfgScope cfgScope;
ClosureParameterNode() { this = TClosureSelfReferenceNode(cfgScope) }
final override CfgScope getCfgScope() { result = cfgScope }
override predicate isParameterOf(DataFlowCallable c, ParameterPosition pos) {
cfgScope = c.asCfgScope() and pos.isClosureSelf()
}
override Location getLocation() { result = cfgScope.getLocation() }
override string toString() { result = "closure self in " + cfgScope }
}
abstract class ArgumentNode extends Node {
abstract predicate isArgumentOf(DataFlowCall call, RustDataFlow::ArgumentPosition pos);
}
final class ExprArgumentNode extends ArgumentNode, ExprNode {
private CallExprBaseCfgNode call_;
private RustDataFlow::ArgumentPosition pos_;
ExprArgumentNode() { isArgumentForCall(n, call_, pos_) }
override predicate isArgumentOf(DataFlowCall call, RustDataFlow::ArgumentPosition pos) {
call.asCallBaseExprCfgNode() = call_ and pos = pos_
}
}
/**
* The receiver of a method call _after_ any implicit borrow or dereferencing
* has taken place.
*/
final class ReceiverNode extends ArgumentNode, TReceiverNode {
private MethodCallExprCfgNode n;
ReceiverNode() { this = TReceiverNode(n, false) }
ExprCfgNode getReceiver() { result = n.getReceiver() }
MethodCallExprCfgNode getMethodCall() { result = n }
override predicate isArgumentOf(DataFlowCall call, RustDataFlow::ArgumentPosition pos) {
call.asMethodCallExprCfgNode() = n and pos = TSelfParameterPosition()
}
override CfgScope getCfgScope() { result = n.getAstNode().getEnclosingCfgScope() }
override Location getLocation() { result = this.getReceiver().getLocation() }
override string toString() { result = "receiver for " + this.getReceiver() }
}
final class SummaryArgumentNode extends FlowSummaryNode, ArgumentNode {
private FlowSummaryImpl::Private::SummaryNode receiver;
private RustDataFlow::ArgumentPosition pos_;
SummaryArgumentNode() {
FlowSummaryImpl::Private::summaryArgumentNode(receiver, this.getSummaryNode(), pos_)
}
override predicate isArgumentOf(DataFlowCall call, RustDataFlow::ArgumentPosition pos) {
call.isSummaryCall(_, receiver) and pos = pos_
}
}
/**
* A data flow node that represents the run-time representation of a closure
* passed into the closure body at an invocation.
*/
final class ClosureArgumentNode extends ArgumentNode, ExprNode {
private CallExprCfgNode call_;
ClosureArgumentNode() { lambdaCallExpr(call_, _, this.asExpr()) }
override predicate isArgumentOf(DataFlowCall call, RustDataFlow::ArgumentPosition pos) {
call.asCallExprCfgNode() = call_ and
pos.isClosureSelf()
}
}
/** An SSA node. */
class SsaNode extends Node, TSsaNode {
SsaImpl::DataFlowIntegration::SsaNode node;
SsaNode() { this = TSsaNode(node) }
override CfgScope getCfgScope() { result = node.getBasicBlock().getScope() }
/** Gets the definition this node corresponds to, if any. */
SsaImpl::Definition asDefinition() {
result = node.(SsaImpl::DataFlowIntegration::SsaDefinitionNode).getDefinition()
}
override Location getLocation() { result = node.getLocation() }
override string toString() { result = "[SSA] " + node.toString() }
}
/** A data flow node that represents a value returned by a callable. */
abstract class ReturnNode extends Node {
abstract ReturnKind getKind();
}
final class ExprReturnNode extends ExprNode, ReturnNode {
ExprReturnNode() { this.getCfgNode().getASuccessor() instanceof AnnotatedExitCfgNode }
override ReturnKind getKind() { result = TNormalReturnKind() }
}
final class SummaryReturnNode extends FlowSummaryNode, ReturnNode {
private ReturnKind rk;
SummaryReturnNode() { FlowSummaryImpl::Private::summaryReturnNode(this.getSummaryNode(), rk) }
override ReturnKind getKind() { result = rk }
}
/** A data flow node that represents the output of a call. */
abstract class OutNode extends Node {
/** Gets the underlying call for this node. */
abstract DataFlowCall getCall(ReturnKind kind);
}
final private class ExprOutNode extends ExprNode, OutNode {
ExprOutNode() { this.asExpr() instanceof CallExprBaseCfgNode }
/** Gets the underlying call CFG node that includes this out node. */
override DataFlowCall getCall(ReturnKind kind) {
result.asCallBaseExprCfgNode() = this.getCfgNode() and
kind = TNormalReturnKind()
}
}
final class SummaryOutNode extends FlowSummaryNode, OutNode {
private DataFlowCall call;
private ReturnKind kind_;
SummaryOutNode() {
exists(FlowSummaryImpl::Private::SummaryNode receiver |
call.isSummaryCall(_, receiver) and
FlowSummaryImpl::Private::summaryOutNode(receiver, this.getSummaryNode(), kind_)
)
}
override DataFlowCall getCall(ReturnKind kind) { result = call and kind = kind_ }
}
/**
* A synthesized data flow node representing a closure object that tracks
* captured variables.
*/
class CaptureNode extends Node, TCaptureNode {
private VariableCapture::Flow::SynthesizedCaptureNode cn;
CaptureNode() { this = TCaptureNode(cn) }
VariableCapture::Flow::SynthesizedCaptureNode getSynthesizedCaptureNode() { result = cn }
override CfgScope getCfgScope() { result = cn.getEnclosingCallable() }
override Location getLocation() { result = cn.getLocation() }
override string toString() { result = cn.toString() }
}
/**
* A node associated with an object after an operation that might have
* changed its state.
*
* This can be either the argument to a callable after the callable returns
* (which might have mutated the argument), or the qualifier of a field after
* an update to the field.
*
* Nodes corresponding to AST elements, for example `ExprNode`, usually refer
* to the value before the update.
*/
abstract class PostUpdateNodePublic extends NodePublic {
/** Gets the node before the state update. */
abstract NodePublic getPreUpdateNode();
}
abstract class PostUpdateNode extends PostUpdateNodePublic, Node {
override string toString() { result = "[post] " + this.getPreUpdateNode().toString() }
}
final class ExprPostUpdateNode extends PostUpdateNode, TExprPostUpdateNode {
private ExprCfgNode n;
ExprPostUpdateNode() { this = TExprPostUpdateNode(n) }
override Node getPreUpdateNode() { result = TExprNode(n) }
override CfgScope getCfgScope() { result = n.getScope() }
override Location getLocation() { result = n.getLocation() }
}
final class ReceiverPostUpdateNode extends PostUpdateNode, TReceiverNode {
private MethodCallExprCfgNode n;
ReceiverPostUpdateNode() { this = TReceiverNode(n, true) }
override Node getPreUpdateNode() { result = TReceiverNode(n, false) }
override CfgScope getCfgScope() { result = n.getAstNode().getEnclosingCfgScope() }
override Location getLocation() { result = n.getReceiver().getLocation() }
}
final class SummaryPostUpdateNode extends FlowSummaryNode, PostUpdateNode {
private FlowSummaryNode pre;
SummaryPostUpdateNode() {
FlowSummaryImpl::Private::summaryPostUpdateNode(this.getSummaryNode(), pre.getSummaryNode())
}
override Node getPreUpdateNode() { result = pre }
final override string toString() { result = PostUpdateNode.super.toString() }
}
private class CapturePostUpdateNode extends PostUpdateNode, CaptureNode {
private CaptureNode pre;
CapturePostUpdateNode() {
VariableCapture::Flow::capturePostUpdateNode(this.getSynthesizedCaptureNode(),
pre.getSynthesizedCaptureNode())
}
override Node getPreUpdateNode() { result = pre }
final override string toString() { result = PostUpdateNode.super.toString() }
}
final class CastNode = NaNode;
private import codeql.rust.internal.CachedStages
cached
newtype TNode =
TExprNode(ExprCfgNode n) { Stages::DataFlowStage::ref() } or
TSourceParameterNode(ParamBaseCfgNode p) or
TPatNode(PatCfgNode p) or
TNameNode(NameCfgNode n) { n.getName() = any(Variable v).getName() } or
TExprPostUpdateNode(ExprCfgNode e) {
isArgumentForCall(e, _, _)
or
lambdaCallExpr(_, _, e)
or
lambdaCreationExpr(e.getExpr(), _)
or
// Whenever `&mut e` has a post-update node we also create one for `e`.
// E.g., for `e` in `f(..., &mut e, ...)` or `*(&mut e) = ...`.
e = any(RefExprCfgNode ref | ref.isMut() and exists(TExprPostUpdateNode(ref))).getExpr()
or
e =
[
any(IndexExprCfgNode i).getBase(), any(FieldExprCfgNode access).getExpr(),
any(TryExprCfgNode try).getExpr(),
any(PrefixExprCfgNode pe | pe.getOperatorName() = "*").getExpr(),
any(AwaitExprCfgNode a).getExpr(), any(MethodCallExprCfgNode mc).getReceiver()
]
} or
TReceiverNode(MethodCallExprCfgNode mc, Boolean isPost) or
TSsaNode(SsaImpl::DataFlowIntegration::SsaNode node) or
TFlowSummaryNode(FlowSummaryImpl::Private::SummaryNode sn) or
TClosureSelfReferenceNode(CfgScope c) { lambdaCreationExpr(c, _) } or
TCaptureNode(VariableCapture::Flow::SynthesizedCaptureNode cn)

View File

@@ -4,6 +4,8 @@ private import codeql.rust.controlflow.CfgNodes
private import codeql.rust.dataflow.DataFlow
private import codeql.rust.dataflow.FlowSummary
private import DataFlowImpl
private import Node as Node
private import Content
private import FlowSummaryImpl as FlowSummaryImpl
private import codeql.rust.internal.CachedStages

View File

@@ -22,6 +22,6 @@ module Impl {
* ```
*/
class ArrayListExpr extends Generated::ArrayListExpr {
override string toString() { result = "[...]" }
override string toStringImpl() { result = "[...]" }
}
}

View File

@@ -21,7 +21,7 @@ module Impl {
* ```
*/
class ArrayRepeatExpr extends Generated::ArrayRepeatExpr {
override string toString() {
override string toStringImpl() {
result =
"[" + this.getRepeatOperand().toAbbreviatedString() + "; " +
this.getRepeatLength().toAbbreviatedString() + "]"

View File

@@ -22,6 +22,6 @@ module Impl {
* ```
*/
class AwaitExpr extends Generated::AwaitExpr {
override string toString() { result = "await " + this.getExpr().toAbbreviatedString() }
override string toStringImpl() { result = "await " + this.getExpr().toAbbreviatedString() }
}
}

View File

@@ -25,6 +25,6 @@ module Impl {
* ```
*/
class BecomeExpr extends Generated::BecomeExpr {
override string toString() { result = "become " + this.getExpr().toAbbreviatedString() }
override string toStringImpl() { result = "become " + this.getExpr().toAbbreviatedString() }
}
}

View File

@@ -23,6 +23,6 @@ module Impl {
* ```
*/
class BinaryExpr extends Generated::BinaryExpr {
override string toString() { result = "... " + this.getOperatorName() + " ..." }
override string toStringImpl() { result = "... " + this.getOperatorName() + " ..." }
}
}

View File

@@ -22,6 +22,6 @@ module Impl {
* ```
*/
class BoxPat extends Generated::BoxPat {
override string toString() { result = "box " + this.getPat().toAbbreviatedString() }
override string toStringImpl() { result = "box " + this.getPat().toAbbreviatedString() }
}
}

View File

@@ -104,14 +104,14 @@ module Impl {
)
}
override string toString() {
override string toStringImpl() {
result = strictconcat(int i | | this.toStringPart(i), " " order by i)
}
private string toStringPart(int index) {
index = 0 and result = "break"
or
index = 1 and result = this.getLifetime().toString()
index = 1 and result = this.getLifetime().toStringImpl()
or
index = 2 and result = this.getExpr().toAbbreviatedString()
}

View File

@@ -34,7 +34,7 @@ module Impl {
* ```
*/
class CallExpr extends Generated::CallExpr {
override string toString() { result = this.getFunction().toAbbreviatedString() + "(...)" }
override string toStringImpl() { result = this.getFunction().toAbbreviatedString() + "(...)" }
override Callable getStaticTarget() { result = getResolvedFunction(this) }

View File

@@ -19,7 +19,7 @@ module Impl {
* ```
*/
class CastExpr extends Generated::CastExpr {
override string toString() {
override string toStringImpl() {
result =
this.getExpr().toAbbreviatedString() + " as " + this.getTypeRepr().toAbbreviatedString()
}

View File

@@ -25,6 +25,6 @@ module Impl {
* ```
*/
class ClosureExpr extends Generated::ClosureExpr {
override string toString() { result = "|...| " + this.getBody().toAbbreviatedString() }
override string toStringImpl() { result = "|...| " + this.getBody().toAbbreviatedString() }
}
}

View File

@@ -20,7 +20,7 @@ module Impl {
* ```
*/
class Comment extends Generated::Comment {
override string toString() {
override string toStringImpl() {
result = this.getCommentMarker() + "..." + this.getCommentEndMarker()
}

View File

@@ -49,7 +49,7 @@ module Impl {
* ```
*/
class ContinueExpr extends Generated::ContinueExpr {
override string toString() {
override string toStringImpl() {
result = strictconcat(int i | | this.toStringPart(i), " " order by i)
}

View File

@@ -14,7 +14,9 @@ module Impl {
private import rust
class Crate extends Generated::Crate {
override string toString() { result = strictconcat(int i | | this.toStringPart(i) order by i) }
override string toStringImpl() {
result = strictconcat(int i | | this.toStringPart(i) order by i)
}
private string toStringPart(int i) {
i = 0 and result = "Crate("

View File

@@ -12,13 +12,13 @@ private import codeql.rust.elements.internal.generated.Element
*/
module Impl {
class Element extends Generated::Element {
override string toString() { result = this.getAPrimaryQlClass() }
override string toStringImpl() { result = this.getAPrimaryQlClass() }
/**
* INTERNAL: Do not use.
*
* Returns a string suitable to be inserted into the name of the parent. Typically `"..."`,
* but may be overridden by subclasses.
*
* INTERNAL: Do not use.
*/
string toAbbreviatedString() { result = "..." }

View File

@@ -19,6 +19,6 @@ module Impl {
* ```
*/
class Enum extends Generated::Enum {
override string toString() { result = "enum " + this.getName().getText() }
override string toStringImpl() { result = "enum " + this.getName().getText() }
}
}

View File

@@ -12,7 +12,7 @@ private import codeql.rust.elements.internal.generated.ExtractorStep
*/
module Impl {
class ExtractorStep extends Generated::ExtractorStep {
override string toString() {
override string toStringImpl() {
result = this.getAction() + "(" + this.getFile().getAbsolutePath() + ")"
or
not this.hasFile() and result = this.getAction()

View File

@@ -28,7 +28,7 @@ module Impl {
/** Gets the tuple field that this access references, if any. */
TupleField getTupleField() { result = TypeInference::resolveTupleFieldExpr(this) }
override string toString() {
override string toStringImpl() {
exists(string abbr, string name |
abbr = this.getExpr().toAbbreviatedString() and
name = this.getNameRef().getText() and

View File

@@ -36,7 +36,7 @@ module Impl {
FormatArgument() { this = Synth::TFormatArgument(parent, index, kind, name, _, offset) }
override string toString() { result = name }
override string toStringImpl() { result = name }
override Format getParent() { result = Synth::TFormat(parent, index, _, _) }

View File

@@ -36,7 +36,7 @@ module Impl {
Format() { this = Synth::TFormat(parent, index, text, offset) }
override string toString() { result = text }
override string toStringImpl() { result = text }
override FormatArgsExpr getParent() { result = Synth::convertFormatArgsExprFromRaw(parent) }

View File

@@ -29,7 +29,7 @@ module Impl {
override Location getLocation() { result = argument.getLocation() }
override string toString() { result = this.getName() }
override string toStringImpl() { result = this.getName() }
/** Gets the name of the variable */
string getName() { result = argument.getName() }

View File

@@ -25,6 +25,6 @@ module Impl {
* ```
*/
class Function extends Generated::Function {
override string toString() { result = "fn " + this.getName().getText() }
override string toStringImpl() { result = "fn " + this.getName().getText() }
}
}

View File

@@ -21,7 +21,7 @@ module Impl {
* ```
*/
class GenericArgList extends Generated::GenericArgList {
override string toString() { result = this.toAbbreviatedString() }
override string toStringImpl() { result = this.toAbbreviatedString() }
override string toAbbreviatedString() { result = "<...>" }

View File

@@ -21,7 +21,7 @@ module Impl {
* ```
*/
class GenericParamList extends Generated::GenericParamList {
override string toString() { result = this.toAbbreviatedString() }
override string toStringImpl() { result = this.toAbbreviatedString() }
override string toAbbreviatedString() { result = "<...>" }

View File

@@ -28,7 +28,7 @@ module Impl {
* ```
*/
class IdentPat extends Generated::IdentPat {
override string toString() {
override string toStringImpl() {
result = strictconcat(int i | | this.toStringPart(i), " " order by i)
}

View File

@@ -28,7 +28,9 @@ module Impl {
* ```
*/
class IfExpr extends Generated::IfExpr {
override string toString() { result = concat(int i | | this.toStringPart(i), " " order by i) }
override string toStringImpl() {
result = concat(int i | | this.toStringPart(i), " " order by i)
}
private string toStringPart(int index) {
index = 0 and result = "if"

View File

@@ -19,7 +19,7 @@ module Impl {
* ```
*/
class Impl extends Generated::Impl {
override string toString() {
override string toStringImpl() {
exists(string trait |
(
trait = this.getTrait().toAbbreviatedString() + " for "

View File

@@ -20,7 +20,7 @@ module Impl {
* ```
*/
class IndexExpr extends Generated::IndexExpr {
override string toString() {
override string toStringImpl() {
result =
this.getBase().toAbbreviatedString() + "[" + this.getIndex().toAbbreviatedString() + "]"
}

View File

@@ -19,7 +19,7 @@ module Impl {
* ```
*/
class InferTypeRepr extends Generated::InferTypeRepr {
override string toString() { result = this.toAbbreviatedString() }
override string toStringImpl() { result = this.toAbbreviatedString() }
override string toAbbreviatedString() { result = "_" }
}

View File

@@ -22,7 +22,7 @@ module Impl {
* ```
*/
class Label extends Generated::Label {
override string toString() { result = this.getText() }
override string toStringImpl() { result = this.getText() }
override string toAbbreviatedString() { result = this.getText() }

View File

@@ -16,7 +16,7 @@ module Impl {
* The base class for expressions that can be labeled (`LoopExpr`, `ForExpr`, `WhileExpr` or `BlockExpr`).
*/
class LabelableExpr extends Generated::LabelableExpr {
final override string toString() {
final override string toStringImpl() {
result = strictconcat(int i | | this.toStringPart(i), " " order by i)
}

View File

@@ -19,7 +19,7 @@ module Impl {
* ```
*/
class LetElse extends Generated::LetElse {
override string toString() { result = this.toAbbreviatedString() }
override string toStringImpl() { result = this.toAbbreviatedString() }
override string toAbbreviatedString() { result = "else {...}" }
}

View File

@@ -21,7 +21,9 @@ module Impl {
* ```
*/
class LetExpr extends Generated::LetExpr {
override string toString() { result = concat(int i | | this.toStringPart(i), " " order by i) }
override string toStringImpl() {
result = concat(int i | | this.toStringPart(i), " " order by i)
}
private string toStringPart(int index) {
index = 0 and result = "let"

View File

@@ -26,7 +26,7 @@ module Impl {
* ```
*/
class LetStmt extends Generated::LetStmt {
override string toString() {
override string toStringImpl() {
result = strictconcat(int i | | this.toStringPart(i), " " order by i)
}

View File

@@ -19,7 +19,7 @@ module Impl {
* ```
*/
class Lifetime extends Generated::Lifetime {
override string toString() {
override string toStringImpl() {
result = "'" + this.getText()
or
not this.hasText() and result = "'_"

View File

@@ -26,7 +26,7 @@ module Impl {
* ```
*/
class LiteralExpr extends Generated::LiteralExpr {
override string toString() { result = this.getTrimmedText() }
override string toStringImpl() { result = this.getTrimmedText() }
override string toAbbreviatedString() { result = this.getTrimmedText() }

View File

@@ -22,7 +22,7 @@ module Impl {
* ```
*/
class LiteralPat extends Generated::LiteralPat {
override string toString() { result = this.toAbbreviatedString() }
override string toStringImpl() { result = this.toAbbreviatedString() }
override string toAbbreviatedString() { result = this.getLiteral().getTrimmedText() }
}

View File

@@ -19,6 +19,6 @@ module Impl {
* ```
*/
class MacroCall extends Generated::MacroCall {
override string toString() { result = this.getPath().toAbbreviatedString() + "!..." }
override string toStringImpl() { result = this.getPath().toAbbreviatedString() + "!..." }
}
}

View File

@@ -28,7 +28,9 @@ module Impl {
* ```
*/
class MatchArm extends Generated::MatchArm {
override string toString() { result = concat(int i | | this.toStringPart(i), " " order by i) }
override string toStringImpl() {
result = concat(int i | | this.toStringPart(i), " " order by i)
}
private string toStringPart(int index) {
index = 0 and result = this.getPat().toAbbreviatedString()

View File

@@ -28,7 +28,7 @@ module Impl {
* ```
*/
class MatchExpr extends Generated::MatchExpr {
override string toString() {
override string toStringImpl() {
result = "match " + this.getScrutinee().toAbbreviatedString() + " { ... }"
}

View File

@@ -42,11 +42,11 @@ module Impl {
)
}
override string toString() {
override string toStringImpl() {
exists(string base, string separator |
base = this.getReceiver().toAbbreviatedString() and
(if base = "..." then separator = " ." else separator = ".") and
result = base + separator + this.getNameRef().toString() + "(...)"
result = base + separator + this.getNameRef().toStringImpl() + "(...)"
)
}
}

View File

@@ -24,6 +24,6 @@ module Impl {
* ```
*/
class Module extends Generated::Module {
override string toString() { result = "mod " + this.getName() }
override string toStringImpl() { result = "mod " + this.getName() }
}
}

View File

@@ -19,6 +19,6 @@ module Impl {
* ```
*/
class Name extends Generated::Name {
override string toString() { result = this.getText() }
override string toStringImpl() { result = this.getText() }
}
}

View File

@@ -19,6 +19,6 @@ module Impl {
* ```
*/
class NameRef extends Generated::NameRef {
override string toString() { result = this.getText() }
override string toStringImpl() { result = this.getText() }
}
}

View File

@@ -19,7 +19,7 @@ module Impl {
* ```
*/
class NeverTypeRepr extends Generated::NeverTypeRepr {
override string toString() { result = this.toAbbreviatedString() }
override string toStringImpl() { result = this.toAbbreviatedString() }
override string toAbbreviatedString() { result = "!" }
}

View File

@@ -21,7 +21,7 @@ module Impl {
* ```
*/
class OrPat extends Generated::OrPat {
override string toString() {
override string toStringImpl() {
result = concat(int i | | this.getPat(i).toAbbreviatedString(), " | " order by i)
}

View File

@@ -21,7 +21,7 @@ module Impl {
* ```
*/
class Param extends Generated::Param {
override string toString() { result = concat(int i | | this.toStringPart(i) order by i) }
override string toStringImpl() { result = concat(int i | | this.toStringPart(i) order by i) }
private string toStringPart(int index) {
index = 0 and result = this.getPat().toAbbreviatedString()

View File

@@ -19,6 +19,6 @@ module Impl {
* ```
*/
class ParenExpr extends Generated::ParenExpr {
override string toString() { result = "(" + this.getExpr().toAbbreviatedString() + ")" }
override string toStringImpl() { result = "(" + this.getExpr().toAbbreviatedString() + ")" }
}
}

View File

@@ -19,6 +19,6 @@ module Impl {
* ```
*/
class ParenPat extends Generated::ParenPat {
override string toString() { result = "(" + this.getPat().toAbbreviatedString() + ")" }
override string toStringImpl() { result = "(" + this.getPat().toAbbreviatedString() + ")" }
}
}

View File

@@ -19,6 +19,6 @@ module Impl {
* ```
*/
class ParenTypeRepr extends Generated::ParenTypeRepr {
override string toString() { result = "(" + this.getTypeRepr().toAbbreviatedString() + ")" }
override string toStringImpl() { result = "(" + this.getTypeRepr().toAbbreviatedString() + ")" }
}
}

View File

@@ -22,8 +22,8 @@ module Impl {
* ```
*/
class PathExpr extends Generated::PathExpr {
override string toString() { result = this.toAbbreviatedString() }
override string toStringImpl() { result = this.toAbbreviatedString() }
override string toAbbreviatedString() { result = this.getPath().toString() }
override string toAbbreviatedString() { result = this.getPath().toStringImpl() }
}
}

View File

@@ -20,12 +20,19 @@ module Impl {
* ```
*/
class Path extends Generated::Path {
override string toString() { result = this.toAbbreviatedString() }
override string toStringImpl() { result = this.toAbbreviatedString() }
override string toAbbreviatedString() {
if this.hasQualifier()
then result = "...::" + this.getPart().toAbbreviatedString()
else result = this.getPart().toAbbreviatedString()
result = strictconcat(int i | | this.toAbbreviatedStringPart(i) order by i)
}
private string toAbbreviatedStringPart(int index) {
index = 0 and
this.hasQualifier() and
result = "...::"
or
index = 1 and
result = this.getPart().toAbbreviatedString()
}
/**

View File

@@ -22,7 +22,7 @@ module Impl {
* ```
*/
class PathPat extends Generated::PathPat {
override string toString() { result = this.toAbbreviatedString() }
override string toStringImpl() { result = this.toAbbreviatedString() }
override string toAbbreviatedString() { result = this.getPath().toAbbreviatedString() }
}

View File

@@ -16,7 +16,7 @@ module Impl {
* A path segment, which is one part of a whole path.
*/
class PathSegment extends Generated::PathSegment {
override string toString() { result = this.toAbbreviatedString() }
override string toStringImpl() { result = this.toAbbreviatedString() }
override string toAbbreviatedString() {
result = strictconcat(int i | | this.toAbbreviatedStringPart(i), "::" order by i)

View File

@@ -20,7 +20,7 @@ module Impl {
* ```
*/
class PathTypeRepr extends Generated::PathTypeRepr {
override string toString() { result = this.toAbbreviatedString() }
override string toStringImpl() { result = this.toAbbreviatedString() }
override string toAbbreviatedString() { result = this.getPath().toAbbreviatedString() }
}

View File

@@ -21,6 +21,6 @@ module Impl {
* ```
*/
class PrefixExpr extends Generated::PrefixExpr {
override string toString() { result = this.getOperatorName() + " ..." }
override string toStringImpl() { result = this.getOperatorName() + " ..." }
}
}

View File

@@ -24,7 +24,7 @@ module Impl {
* ```
*/
class RangeExpr extends Generated::RangeExpr {
override string toString() { result = concat(int i | | this.toStringPart(i) order by i) }
override string toStringImpl() { result = concat(int i | | this.toStringPart(i) order by i) }
private string toStringPart(int index) {
index = 0 and result = this.getStartAbbreviation()

View File

@@ -22,7 +22,7 @@ module Impl {
* ```
*/
class RecordExprField extends Generated::RecordExprField {
override string toString() { result = concat(int i | | this.toStringPart(i) order by i) }
override string toStringImpl() { result = concat(int i | | this.toStringPart(i) order by i) }
private string toStringPart(int index) {
index = 0 and result = this.getNameRef().getText()

View File

@@ -25,7 +25,7 @@ module Impl {
* ```
*/
class RecordExpr extends Generated::RecordExpr {
override string toString() { result = this.getPath().toString() + " {...}" }
override string toStringImpl() { result = this.getPath().toStringImpl() + " {...}" }
/** Gets the record expression for the field `name`. */
pragma[nomagic]

View File

@@ -21,7 +21,7 @@ module Impl {
* ```
*/
class RecordPatField extends Generated::RecordPatField {
override string toString() { result = concat(int i | | this.toStringPart(i) order by i) }
override string toStringImpl() { result = concat(int i | | this.toStringPart(i) order by i) }
private string toStringPart(int index) {
index = 0 and result = this.getNameRef().getText()

View File

@@ -25,7 +25,7 @@ module Impl {
* ```
*/
class RecordPat extends Generated::RecordPat {
override string toString() { result = this.getPath().toAbbreviatedString() + " {...}" }
override string toStringImpl() { result = this.getPath().toAbbreviatedString() + " {...}" }
pragma[nomagic]
private PathResolution::ItemNode getResolvedPath(string name) {

View File

@@ -22,7 +22,7 @@ module Impl {
* ```
*/
class RefExpr extends Generated::RefExpr {
override string toString() {
override string toStringImpl() {
result = "&" + concat(int i | | this.getSpecPart(i), " " order by i)
}

View File

@@ -22,7 +22,7 @@ module Impl {
* ```
*/
class RefPat extends Generated::RefPat {
override string toString() {
override string toStringImpl() {
result = "&" + concat(int i | | this.getSpecPart(i), " " order by i)
}

View File

@@ -19,7 +19,7 @@ module Impl {
* ```
*/
class RestPat extends Generated::RestPat {
override string toString() { result = this.toAbbreviatedString() }
override string toStringImpl() { result = this.toAbbreviatedString() }
override string toAbbreviatedString() { result = ".." }
}

View File

@@ -26,7 +26,9 @@ module Impl {
* ```
*/
class ReturnExpr extends Generated::ReturnExpr {
override string toString() { result = concat(int i | | this.toStringPart(i), " " order by i) }
override string toStringImpl() {
result = concat(int i | | this.toStringPart(i), " " order by i)
}
private string toStringPart(int index) {
index = 0 and result = "return"

View File

@@ -20,7 +20,7 @@ module Impl {
* ```
*/
class Struct extends Generated::Struct {
override string toString() { result = "struct " + this.getName().getText() }
override string toStringImpl() { result = "struct " + this.getName().getText() }
/** Gets the record field named `name`, if any. */
pragma[nomagic]

View File

@@ -25,6 +25,6 @@ module Impl {
* ```
*/
class Trait extends Generated::Trait {
override string toString() { result = "trait " + this.getName().getText() }
override string toStringImpl() { result = "trait " + this.getName().getText() }
}
}

View File

@@ -26,7 +26,7 @@ module Impl {
* ```
*/
class TupleStructPat extends Generated::TupleStructPat {
override string toString() { result = this.getPath().toAbbreviatedString() + "(...)" }
override string toStringImpl() { result = this.getPath().toAbbreviatedString() + "(...)" }
pragma[nomagic]
private PathResolution::ItemNode getResolvedPath(int pos) {

View File

@@ -26,6 +26,6 @@ module Impl {
override string toAbbreviatedString() { result = this.getName().getText() }
override string toString() { result = this.getName().getText() }
override string toStringImpl() { result = this.getName().getText() }
}
}

View File

@@ -19,7 +19,7 @@ module Impl {
* ```
*/
class UnderscoreExpr extends Generated::UnderscoreExpr {
override string toString() { result = this.toAbbreviatedString() }
override string toStringImpl() { result = this.toAbbreviatedString() }
override string toAbbreviatedString() { result = "_" }
}

View File

@@ -19,6 +19,6 @@ module Impl {
* ```
*/
class Union extends Generated::Union {
override string toString() { result = "union " + this.getName().getText() }
override string toStringImpl() { result = "union " + this.getName().getText() }
}
}

View File

@@ -594,7 +594,7 @@ module Impl {
/** Holds if this access is a capture. */
predicate isCapture() { this.getEnclosingCfgScope() != v.getEnclosingCfgScope() }
override string toString() { result = name }
override string toStringImpl() { result = name }
override string getAPrimaryQlClass() { result = "VariableAccess" }
}

View File

@@ -20,7 +20,7 @@ module Impl {
* ```
*/
class Variant extends Generated::Variant {
override string toString() { result = this.getName().getText() }
override string toStringImpl() { result = this.getName().getText() }
/** Gets the record field named `name`, if any. */
pragma[nomagic]

View File

@@ -19,7 +19,7 @@ module Impl {
* ```
*/
class WildcardPat extends Generated::WildcardPat {
override string toString() { result = this.toAbbreviatedString() }
override string toStringImpl() { result = this.toAbbreviatedString() }
override string toAbbreviatedString() { result = "_" }
}

View File

@@ -23,7 +23,15 @@ module Generated {
/**
* Gets the string representation of this element.
*/
string toString() { none() } // overridden by subclasses
cached
final string toString() { result = this.toStringImpl() }
/**
* INTERNAL: Do not use.
*
* Gets the string representation of this element.
*/
abstract string toStringImpl();
/**
* Gets the name of a primary CodeQL class to which this element belongs.

View File

@@ -131,6 +131,8 @@ module Stages {
cached
module DataFlowStage {
private import codeql.rust.dataflow.internal.DataFlowImpl
private import codeql.rust.dataflow.internal.Node
private import codeql.rust.dataflow.internal.Content
private import codeql.rust.dataflow.internal.TaintTrackingImpl
/**
@@ -152,6 +154,10 @@ module Stages {
exists(Node n)
or
RustTaintTracking::defaultAdditionalTaintStep(_, _, _)
or
exists(DataFlowCall call)
or
exists(Content content)
}
}
}

View File

@@ -14,7 +14,7 @@ private import codeql.rust.security.SensitiveData
private import codeql.rust.dataflow.DataFlow
private import codeql.rust.dataflow.FlowSource
private import codeql.rust.dataflow.FlowSink
private import codeql.rust.dataflow.internal.DataFlowImpl
private import codeql.rust.dataflow.internal.Node as Node
/**
* Provides default sources, sinks and sanitizers for detecting "use of a broken or weak

View File

@@ -8,6 +8,7 @@ private import codeql.dataflow.test.InlineFlowTest
private import codeql.rust.controlflow.CfgNodes
private import codeql.rust.dataflow.DataFlow
private import codeql.rust.dataflow.internal.DataFlowImpl
private import codeql.rust.dataflow.internal.Node as Node
private import codeql.rust.dataflow.internal.TaintTrackingImpl
private import codeql.rust.dataflow.internal.ModelsAsData as MaD
private import internal.InlineExpectationsTestImpl as InlineExpectationsTestImpl

View File

@@ -17,7 +17,6 @@ import rust
import codeql.rust.security.CleartextLoggingExtensions
import codeql.rust.dataflow.DataFlow
import codeql.rust.dataflow.TaintTracking
import codeql.rust.dataflow.internal.DataFlowImpl
/**
* A taint-tracking configuration for cleartext logging vulnerabilities.
@@ -44,7 +43,7 @@ module CleartextLoggingConfig implements DataFlow::ConfigSig {
predicate allowImplicitRead(DataFlow::Node node, DataFlow::ContentSet c) {
// flow out from tuple content at sinks.
isSink(node) and
c.getAReadContent() instanceof TuplePositionContent
c.getAReadContent() instanceof DataFlow::TuplePositionContent
}
}

View File

@@ -3,6 +3,8 @@ private import rust
private import rust as R
private import codeql.rust.dataflow.DataFlow
private import codeql.rust.dataflow.internal.DataFlowImpl
private import codeql.rust.dataflow.internal.Node as Node
private import codeql.rust.dataflow.internal.Content
private import codeql.rust.dataflow.FlowSource as FlowSource
private import codeql.rust.dataflow.FlowSink as FlowSink
private import codeql.rust.dataflow.internal.TaintTrackingImpl

View File

@@ -19,7 +19,6 @@ edges
| 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: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(false)] ... && ... | no-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:26:6:26 | d | |
| test.rs:6:31:6:31 | b | test.rs:6:21:6:27 | Some(...) | |
@@ -47,7 +46,6 @@ edges
| 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(false)] ... && ... | no-match |
| test.rs:14:21:14:21 | d | test.rs:14:12:14:25 | [boolean(true)] ... && ... | 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 | |

View File

@@ -121,23 +121,17 @@ dominates
| 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:24:99:24 | x |
| 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:100:17:100:17 | x |
| test.rs:99:15:99:39 | let ... = ... | test.rs:101:17:101:22 | ExprStmt |
| 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: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 ... { ... } |
@@ -174,23 +168,17 @@ dominates
| 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: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: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: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: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 {...} |
@@ -518,26 +506,18 @@ dominates
| test.rs:326:5:332:5 | enter fn test_match | test.rs:326:5:332:5 | enter fn test_match |
| test.rs:326:5:332:5 | enter fn test_match | test.rs:327:9:331:9 | match maybe_digit { ... } |
| test.rs:326:5:332:5 | enter fn test_match | test.rs:328:26:328:26 | x |
| test.rs:326:5:332:5 | enter fn test_match | test.rs:328:32:328:32 | x |
| test.rs:326:5:332:5 | enter fn test_match | test.rs:328:42:328:42 | x |
| test.rs:326:5:332:5 | enter fn test_match | test.rs:329:13:329:27 | ...::Some(...) |
| test.rs:326:5:332:5 | enter fn test_match | test.rs:329:26:329:26 | x |
| test.rs:326:5:332:5 | enter fn test_match | test.rs:329:32:329:32 | x |
| test.rs:326:5:332:5 | enter fn test_match | test.rs:330:13:330:24 | ...::None |
| test.rs:327:9:331:9 | match maybe_digit { ... } | test.rs:327:9:331:9 | match maybe_digit { ... } |
| test.rs:328:26:328:26 | x | test.rs:328:26:328:26 | x |
| test.rs:328:26:328:26 | x | test.rs:328:32:328:32 | x |
| test.rs:328:26:328:26 | x | test.rs:328:42:328:42 | x |
| test.rs:328:32:328:32 | x | test.rs:328:32:328:32 | x |
| test.rs:328:32:328:32 | x | test.rs:328:42:328:42 | x |
| test.rs:328:42:328:42 | x | test.rs:328:42:328:42 | x |
| test.rs:329:13:329:27 | ...::Some(...) | test.rs:329:13:329:27 | ...::Some(...) |
| test.rs:329:13:329:27 | ...::Some(...) | test.rs:329:26:329:26 | x |
| test.rs:329:13:329:27 | ...::Some(...) | test.rs:329:32:329:32 | x |
| test.rs:329:13:329:27 | ...::Some(...) | test.rs:330:13:330:24 | ...::None |
| test.rs:329:26:329:26 | x | test.rs:329:26:329:26 | x |
| test.rs:329:26:329:26 | x | test.rs:329:32:329:32 | x |
| test.rs:329:32:329:32 | x | test.rs:329:32:329:32 | x |
| test.rs:330:13:330:24 | ...::None | test.rs:330:13:330:24 | ...::None |
| test.rs:334:5:343:5 | enter fn test_match_with_return_in_scrutinee | test.rs:334:5:343:5 | enter fn test_match_with_return_in_scrutinee |
| test.rs:334:5:343:5 | enter fn test_match_with_return_in_scrutinee | test.rs:334:5:343:5 | exit fn test_match_with_return_in_scrutinee (normal) |
@@ -545,7 +525,6 @@ dominates
| test.rs:334:5:343:5 | enter fn test_match_with_return_in_scrutinee | test.rs:336:13:336:21 | ExprStmt |
| test.rs:334:5:343:5 | enter fn test_match_with_return_in_scrutinee | test.rs:338:13:338:23 | maybe_digit |
| test.rs:334:5:343:5 | enter fn test_match_with_return_in_scrutinee | test.rs:340:26:340:26 | x |
| test.rs:334:5:343:5 | enter fn test_match_with_return_in_scrutinee | test.rs:340:32:340:32 | x |
| test.rs:334:5:343:5 | enter fn test_match_with_return_in_scrutinee | test.rs:341:13:341:24 | ...::None |
| test.rs:334:5:343:5 | exit fn test_match_with_return_in_scrutinee (normal) | test.rs:334:5:343:5 | exit fn test_match_with_return_in_scrutinee (normal) |
| test.rs:335:9:342:9 | match ... { ... } | test.rs:335:9:342:9 | match ... { ... } |
@@ -553,18 +532,14 @@ dominates
| test.rs:338:13:338:23 | maybe_digit | test.rs:335:9:342:9 | match ... { ... } |
| test.rs:338:13:338:23 | maybe_digit | test.rs:338:13:338:23 | maybe_digit |
| test.rs:338:13:338:23 | maybe_digit | test.rs:340:26:340:26 | x |
| test.rs:338:13:338:23 | maybe_digit | test.rs:340:32:340:32 | x |
| test.rs:338:13:338:23 | maybe_digit | test.rs:341:13:341:24 | ...::None |
| test.rs:340:26:340:26 | x | test.rs:340:26:340:26 | x |
| test.rs:340:26:340:26 | x | test.rs:340:32:340:32 | x |
| test.rs:340:32:340:32 | x | test.rs:340:32:340:32 | x |
| test.rs:341:13:341:24 | ...::None | test.rs:341:13:341:24 | ...::None |
| test.rs:345:5:350:5 | enter fn test_match_and | test.rs:345:5:350:5 | enter fn test_match_and |
| test.rs:345:5:350:5 | enter fn test_match_and | test.rs:346:9:349:18 | ... && ... |
| test.rs:345:5:350:5 | enter fn test_match_and | test.rs:346:10:349:9 | [boolean(false)] match r { ... } |
| test.rs:345:5:350:5 | enter fn test_match_and | test.rs:346:10:349:9 | [boolean(true)] match r { ... } |
| test.rs:345:5:350:5 | enter fn test_match_and | test.rs:347:18:347:18 | a |
| test.rs:345:5:350:5 | enter fn test_match_and | test.rs:347:24:347:24 | a |
| test.rs:345:5:350:5 | enter fn test_match_and | test.rs:348:13:348:13 | _ |
| test.rs:345:5:350:5 | enter fn test_match_and | test.rs:349:15:349:18 | cond |
| test.rs:346:9:349:18 | ... && ... | test.rs:346:9:349:18 | ... && ... |
@@ -573,40 +548,27 @@ dominates
| test.rs:346:10:349:9 | [boolean(true)] match r { ... } | test.rs:349:15:349:18 | cond |
| test.rs:347:18:347:18 | a | test.rs:346:10:349:9 | [boolean(true)] match r { ... } |
| test.rs:347:18:347:18 | a | test.rs:347:18:347:18 | a |
| test.rs:347:18:347:18 | a | test.rs:347:24:347:24 | a |
| test.rs:347:18:347:18 | a | test.rs:349:15:349:18 | cond |
| test.rs:347:24:347:24 | a | test.rs:346:10:349:9 | [boolean(true)] match r { ... } |
| test.rs:347:24:347:24 | a | test.rs:347:24:347:24 | a |
| test.rs:347:24:347:24 | a | test.rs:349:15:349:18 | cond |
| test.rs:348:13:348:13 | _ | test.rs:348:13:348:13 | _ |
| test.rs:349:15:349:18 | cond | test.rs:349:15:349:18 | cond |
| test.rs:352:5:357:5 | enter fn test_match_with_no_arms | test.rs:352:5:357:5 | enter fn test_match_with_no_arms |
| test.rs:352:5:357:5 | enter fn test_match_with_no_arms | test.rs:353:9:356:9 | match r { ... } |
| test.rs:352:5:357:5 | enter fn test_match_with_no_arms | test.rs:354:16:354:20 | value |
| test.rs:352:5:357:5 | enter fn test_match_with_no_arms | test.rs:354:26:354:30 | value |
| test.rs:352:5:357:5 | enter fn test_match_with_no_arms | test.rs:355:13:355:22 | Err(...) |
| test.rs:353:9:356:9 | match r { ... } | test.rs:353:9:356:9 | match r { ... } |
| test.rs:354:16:354:20 | value | test.rs:354:16:354:20 | value |
| test.rs:354:16:354:20 | value | test.rs:354:26:354:30 | value |
| test.rs:354:26:354:30 | value | test.rs:354:26:354:30 | value |
| test.rs:355:13:355:22 | Err(...) | test.rs:355:13:355:22 | Err(...) |
| test.rs:362:5:365:5 | enter fn test_let_match | test.rs:362:5:365:5 | enter fn test_let_match |
| test.rs:362:5:365:5 | enter fn test_let_match | test.rs:363:18:363:18 | n |
| test.rs:362:5:365:5 | enter fn test_let_match | test.rs:363:39:363:53 | MacroStmts |
| test.rs:362:5:365:5 | enter fn test_let_match | test.rs:364:9:364:9 | n |
| test.rs:363:18:363:18 | n | test.rs:363:18:363:18 | n |
| test.rs:363:18:363:18 | n | test.rs:364:9:364:9 | n |
| test.rs:363:39:363:53 | MacroStmts | test.rs:363:39:363:53 | MacroStmts |
| test.rs:364:9:364:9 | n | test.rs:364:9:364:9 | n |
| test.rs:367:5:373:5 | enter fn test_let_with_return | test.rs:367:5:373:5 | enter fn test_let_with_return |
| test.rs:367:5:373:5 | enter fn test_let_with_return | test.rs:367:5:373:5 | exit fn test_let_with_return (normal) |
| test.rs:367:5:373:5 | enter fn test_let_with_return | test.rs:369:18:369:20 | ret |
| test.rs:367:5:373:5 | enter fn test_let_with_return | test.rs:369:26:369:28 | ret |
| test.rs:367:5:373:5 | enter fn test_let_with_return | test.rs:370:13:370:16 | None |
| test.rs:367:5:373:5 | exit fn test_let_with_return (normal) | test.rs:367:5:373:5 | exit fn test_let_with_return (normal) |
| test.rs:369:18:369:20 | ret | test.rs:369:18:369:20 | ret |
| test.rs:369:18:369:20 | ret | test.rs:369:26:369:28 | ret |
| test.rs:369:26:369:28 | ret | test.rs:369:26:369:28 | ret |
| test.rs:370:13:370:16 | None | test.rs:370:13:370:16 | None |
| test.rs:378:5:381:5 | enter fn empty_tuple_pattern | test.rs:378:5:381:5 | enter fn empty_tuple_pattern |
| test.rs:387:5:391:5 | enter fn empty_struct_pattern | test.rs:387:5:391:5 | enter fn empty_struct_pattern |
@@ -729,12 +691,9 @@ dominates
| test.rs:456:13:456:13 | _ | test.rs:456:13:456:13 | _ |
| test.rs:460:5:465:5 | enter fn irrefutable_pattern_and_dead_code | test.rs:460:5:465:5 | enter fn irrefutable_pattern_and_dead_code |
| test.rs:460:5:465:5 | enter fn irrefutable_pattern_and_dead_code | test.rs:461:9:464:9 | match pair { ... } |
| test.rs:460:5:465:5 | enter fn irrefutable_pattern_and_dead_code | test.rs:462:18:462:34 | MyStruct {...} |
| test.rs:460:5:465:5 | enter fn irrefutable_pattern_and_dead_code | test.rs:462:32:462:32 | _ |
| test.rs:460:5:465:5 | enter fn irrefutable_pattern_and_dead_code | test.rs:463:13:463:13 | _ |
| test.rs:461:9:464:9 | match pair { ... } | test.rs:461:9:464:9 | match pair { ... } |
| test.rs:462:18:462:34 | MyStruct {...} | test.rs:462:18:462:34 | MyStruct {...} |
| test.rs:462:18:462:34 | MyStruct {...} | test.rs:462:32:462:32 | _ |
| test.rs:462:32:462:32 | _ | test.rs:462:32:462:32 | _ |
| test.rs:463:13:463:13 | _ | test.rs:463:13:463:13 | _ |
| test.rs:475:5:481:5 | enter fn enum_pattern | test.rs:475:5:481:5 | enter fn enum_pattern |
@@ -805,12 +764,9 @@ dominates
| test.rs:584:1:592:1 | enter fn labelled_block2 | test.rs:585:18:591:5 | 'block: { ... } |
| test.rs:584:1:592:1 | enter fn labelled_block2 | test.rs:587:18:587:18 | y |
| test.rs:584:1:592:1 | enter fn labelled_block2 | test.rs:588:13:588:27 | ExprStmt |
| test.rs:584:1:592:1 | enter fn labelled_block2 | test.rs:590:9:590:9 | 0 |
| test.rs:585:18:591:5 | 'block: { ... } | test.rs:585:18:591:5 | 'block: { ... } |
| test.rs:587:18:587:18 | y | test.rs:587:18:587:18 | y |
| test.rs:587:18:587:18 | y | test.rs:590:9:590:9 | 0 |
| test.rs:588:13:588:27 | ExprStmt | test.rs:588:13:588:27 | ExprStmt |
| test.rs:590:9:590:9 | 0 | test.rs:590:9:590:9 | 0 |
| test.rs:594:1:600:1 | enter fn test_nested_function2 | test.rs:594:1:600:1 | enter fn test_nested_function2 |
| test.rs:596:5:598:5 | enter fn nested | test.rs:596:5:598:5 | enter fn nested |
| test.rs:611:5:613:5 | enter fn new | test.rs:611:5:613:5 | enter fn new |
@@ -903,14 +859,12 @@ postDominance
| test.rs:99:9:103:9 | while ... { ... } | test.rs:99:15:99:39 | let ... = ... |
| test.rs:99:9:103:9 | while ... { ... } | test.rs:99:24:99:24 | x |
| 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:24:99:24 | x | test.rs:99:24:99:24 | x |
| test.rs:100:13:102:13 | if ... {...} | test.rs:100:13:102:13 | if ... {...} |
| 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 |
@@ -944,20 +898,16 @@ postDominance
| 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: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: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: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: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: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: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 {...} |
@@ -1258,18 +1208,14 @@ postDominance
| test.rs:327:9:331:9 | match maybe_digit { ... } | test.rs:326:5:332:5 | enter fn test_match |
| test.rs:327:9:331:9 | match maybe_digit { ... } | test.rs:327:9:331:9 | match maybe_digit { ... } |
| test.rs:327:9:331:9 | match maybe_digit { ... } | test.rs:328:26:328:26 | x |
| test.rs:327:9:331:9 | match maybe_digit { ... } | test.rs:328:32:328:32 | x |
| test.rs:327:9:331:9 | match maybe_digit { ... } | test.rs:328:42:328:42 | x |
| test.rs:327:9:331:9 | match maybe_digit { ... } | test.rs:329:13:329:27 | ...::Some(...) |
| test.rs:327:9:331:9 | match maybe_digit { ... } | test.rs:329:26:329:26 | x |
| test.rs:327:9:331:9 | match maybe_digit { ... } | test.rs:329:32:329:32 | x |
| test.rs:327:9:331:9 | match maybe_digit { ... } | test.rs:330:13:330:24 | ...::None |
| test.rs:328:26:328:26 | x | test.rs:328:26:328:26 | x |
| test.rs:328:32:328:32 | x | test.rs:328:32:328:32 | x |
| test.rs:328:42:328:42 | x | test.rs:328:42:328:42 | x |
| test.rs:329:13:329:27 | ...::Some(...) | test.rs:329:13:329:27 | ...::Some(...) |
| test.rs:329:26:329:26 | x | test.rs:329:26:329:26 | x |
| test.rs:329:32:329:32 | x | test.rs:329:32:329:32 | x |
| test.rs:330:13:330:24 | ...::None | test.rs:330:13:330:24 | ...::None |
| test.rs:334:5:343:5 | enter fn test_match_with_return_in_scrutinee | test.rs:334:5:343:5 | enter fn test_match_with_return_in_scrutinee |
| test.rs:334:5:343:5 | exit fn test_match_with_return_in_scrutinee (normal) | test.rs:334:5:343:5 | enter fn test_match_with_return_in_scrutinee |
@@ -1278,17 +1224,14 @@ postDominance
| test.rs:334:5:343:5 | exit fn test_match_with_return_in_scrutinee (normal) | test.rs:336:13:336:21 | ExprStmt |
| test.rs:334:5:343:5 | exit fn test_match_with_return_in_scrutinee (normal) | test.rs:338:13:338:23 | maybe_digit |
| test.rs:334:5:343:5 | exit fn test_match_with_return_in_scrutinee (normal) | test.rs:340:26:340:26 | x |
| test.rs:334:5:343:5 | exit fn test_match_with_return_in_scrutinee (normal) | test.rs:340:32:340:32 | x |
| test.rs:334:5:343:5 | exit fn test_match_with_return_in_scrutinee (normal) | test.rs:341:13:341:24 | ...::None |
| test.rs:335:9:342:9 | match ... { ... } | test.rs:335:9:342:9 | match ... { ... } |
| test.rs:335:9:342:9 | match ... { ... } | test.rs:338:13:338:23 | maybe_digit |
| test.rs:335:9:342:9 | match ... { ... } | test.rs:340:26:340:26 | x |
| test.rs:335:9:342:9 | match ... { ... } | test.rs:340:32:340:32 | x |
| test.rs:335:9:342:9 | match ... { ... } | test.rs:341:13:341:24 | ...::None |
| test.rs:336:13:336:21 | ExprStmt | test.rs:336:13:336:21 | ExprStmt |
| test.rs:338:13:338:23 | maybe_digit | test.rs:338:13:338:23 | maybe_digit |
| test.rs:340:26:340:26 | x | test.rs:340:26:340:26 | x |
| test.rs:340:32:340:32 | x | test.rs:340:32:340:32 | x |
| test.rs:341:13:341:24 | ...::None | test.rs:341:13:341:24 | ...::None |
| test.rs:345:5:350:5 | enter fn test_match_and | test.rs:345:5:350:5 | enter fn test_match_and |
| test.rs:346:9:349:18 | ... && ... | test.rs:345:5:350:5 | enter fn test_match_and |
@@ -1296,14 +1239,12 @@ postDominance
| test.rs:346:9:349:18 | ... && ... | test.rs:346:10:349:9 | [boolean(false)] match r { ... } |
| test.rs:346:9:349:18 | ... && ... | test.rs:346:10:349:9 | [boolean(true)] match r { ... } |
| test.rs:346:9:349:18 | ... && ... | test.rs:347:18:347:18 | a |
| test.rs:346:9:349:18 | ... && ... | test.rs:347:24:347:24 | a |
| test.rs:346:9:349:18 | ... && ... | test.rs:348:13:348:13 | _ |
| test.rs:346:9:349:18 | ... && ... | test.rs:349:15:349:18 | cond |
| test.rs:346:10:349:9 | [boolean(false)] match r { ... } | test.rs:346:10:349:9 | [boolean(false)] match r { ... } |
| test.rs:346:10:349:9 | [boolean(false)] match r { ... } | test.rs:348:13:348:13 | _ |
| test.rs:346:10:349:9 | [boolean(true)] match r { ... } | test.rs:346:10:349:9 | [boolean(true)] match r { ... } |
| test.rs:347:18:347:18 | a | test.rs:347:18:347:18 | a |
| test.rs:347:24:347:24 | a | test.rs:347:24:347:24 | a |
| test.rs:348:13:348:13 | _ | test.rs:348:13:348:13 | _ |
| test.rs:349:15:349:18 | cond | test.rs:346:10:349:9 | [boolean(true)] match r { ... } |
| test.rs:349:15:349:18 | cond | test.rs:349:15:349:18 | cond |
@@ -1311,26 +1252,19 @@ postDominance
| test.rs:353:9:356:9 | match r { ... } | test.rs:352:5:357:5 | enter fn test_match_with_no_arms |
| test.rs:353:9:356:9 | match r { ... } | test.rs:353:9:356:9 | match r { ... } |
| test.rs:353:9:356:9 | match r { ... } | test.rs:354:16:354:20 | value |
| test.rs:353:9:356:9 | match r { ... } | test.rs:354:26:354:30 | value |
| test.rs:353:9:356:9 | match r { ... } | test.rs:355:13:355:22 | Err(...) |
| test.rs:354:16:354:20 | value | test.rs:354:16:354:20 | value |
| test.rs:354:26:354:30 | value | test.rs:354:26:354:30 | value |
| test.rs:355:13:355:22 | Err(...) | test.rs:355:13:355:22 | Err(...) |
| test.rs:362:5:365:5 | enter fn test_let_match | test.rs:362:5:365:5 | enter fn test_let_match |
| test.rs:363:18:363:18 | n | test.rs:362:5:365:5 | enter fn test_let_match |
| test.rs:363:18:363:18 | n | test.rs:363:18:363:18 | n |
| test.rs:363:39:363:53 | MacroStmts | test.rs:363:39:363:53 | MacroStmts |
| test.rs:364:9:364:9 | n | test.rs:362:5:365:5 | enter fn test_let_match |
| test.rs:364:9:364:9 | n | test.rs:363:18:363:18 | n |
| test.rs:364:9:364:9 | n | test.rs:364:9:364:9 | n |
| test.rs:367:5:373:5 | enter fn test_let_with_return | test.rs:367:5:373:5 | enter fn test_let_with_return |
| test.rs:367:5:373:5 | exit fn test_let_with_return (normal) | test.rs:367:5:373:5 | enter fn test_let_with_return |
| test.rs:367:5:373:5 | exit fn test_let_with_return (normal) | test.rs:367:5:373:5 | exit fn test_let_with_return (normal) |
| test.rs:367:5:373:5 | exit fn test_let_with_return (normal) | test.rs:369:18:369:20 | ret |
| test.rs:367:5:373:5 | exit fn test_let_with_return (normal) | test.rs:369:26:369:28 | ret |
| test.rs:367:5:373:5 | exit fn test_let_with_return (normal) | test.rs:370:13:370:16 | None |
| test.rs:369:18:369:20 | ret | test.rs:369:18:369:20 | ret |
| test.rs:369:26:369:28 | ret | test.rs:369:26:369:28 | ret |
| test.rs:370:13:370:16 | None | test.rs:370:13:370:16 | None |
| test.rs:378:5:381:5 | enter fn empty_tuple_pattern | test.rs:378:5:381:5 | enter fn empty_tuple_pattern |
| test.rs:387:5:391:5 | enter fn empty_struct_pattern | test.rs:387:5:391:5 | enter fn empty_struct_pattern |
@@ -1435,10 +1369,8 @@ postDominance
| test.rs:460:5:465:5 | enter fn irrefutable_pattern_and_dead_code | test.rs:460:5:465:5 | enter fn irrefutable_pattern_and_dead_code |
| test.rs:461:9:464:9 | match pair { ... } | test.rs:460:5:465:5 | enter fn irrefutable_pattern_and_dead_code |
| test.rs:461:9:464:9 | match pair { ... } | test.rs:461:9:464:9 | match pair { ... } |
| test.rs:461:9:464:9 | match pair { ... } | test.rs:462:18:462:34 | MyStruct {...} |
| test.rs:461:9:464:9 | match pair { ... } | test.rs:462:32:462:32 | _ |
| test.rs:461:9:464:9 | match pair { ... } | test.rs:463:13:463:13 | _ |
| test.rs:462:18:462:34 | MyStruct {...} | test.rs:462:18:462:34 | MyStruct {...} |
| test.rs:462:32:462:32 | _ | test.rs:462:32:462:32 | _ |
| test.rs:463:13:463:13 | _ | test.rs:463:13:463:13 | _ |
| test.rs:475:5:481:5 | enter fn enum_pattern | test.rs:475:5:481:5 | enter fn enum_pattern |
@@ -1505,10 +1437,8 @@ postDominance
| test.rs:585:18:591:5 | 'block: { ... } | test.rs:585:18:591:5 | 'block: { ... } |
| test.rs:585:18:591:5 | 'block: { ... } | test.rs:587:18:587:18 | y |
| test.rs:585:18:591:5 | 'block: { ... } | test.rs:588:13:588:27 | ExprStmt |
| test.rs:585:18:591:5 | 'block: { ... } | test.rs:590:9:590:9 | 0 |
| test.rs:587:18:587:18 | y | test.rs:587:18:587:18 | y |
| test.rs:588:13:588:27 | ExprStmt | test.rs:588:13:588:27 | ExprStmt |
| test.rs:590:9:590:9 | 0 | test.rs:590:9:590:9 | 0 |
| test.rs:594:1:600:1 | enter fn test_nested_function2 | test.rs:594:1:600:1 | enter fn test_nested_function2 |
| test.rs:596:5:598:5 | enter fn nested | test.rs:596:5:598:5 | enter fn nested |
| test.rs:611:5:613:5 | enter fn new | test.rs:611:5:613:5 | enter fn new |
@@ -1551,9 +1481,8 @@ immediateDominator
| 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: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: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: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 |
@@ -1566,12 +1495,10 @@ immediateDominator
| 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: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:146:21:146:21 | n |
| test.rs:149:13:149:13 | 0 | test.rs:145:5:151:5 | enter fn test_if_let_else |
| 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: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 |
@@ -1682,36 +1609,29 @@ immediateDominator
| test.rs:318:13:318:17 | false | test.rs:317:13:317:16 | true |
| test.rs:327:9:331:9 | match maybe_digit { ... } | test.rs:326:5:332:5 | enter fn test_match |
| test.rs:328:26:328:26 | x | test.rs:326:5:332:5 | enter fn test_match |
| test.rs:328:32:328:32 | x | test.rs:328:26:328:26 | x |
| test.rs:328:42:328:42 | x | test.rs:328:32:328:32 | x |
| test.rs:328:42:328:42 | x | test.rs:328:26:328:26 | x |
| test.rs:329:13:329:27 | ...::Some(...) | test.rs:326:5:332:5 | enter fn test_match |
| test.rs:329:26:329:26 | x | test.rs:329:13:329:27 | ...::Some(...) |
| test.rs:329:32:329:32 | x | test.rs:329:26:329:26 | x |
| test.rs:330:13:330:24 | ...::None | test.rs:329:13:329:27 | ...::Some(...) |
| test.rs:334:5:343:5 | exit fn test_match_with_return_in_scrutinee (normal) | test.rs:334:5:343:5 | enter fn test_match_with_return_in_scrutinee |
| test.rs:335:9:342:9 | match ... { ... } | test.rs:338:13:338:23 | maybe_digit |
| test.rs:336:13:336:21 | ExprStmt | test.rs:334:5:343:5 | enter fn test_match_with_return_in_scrutinee |
| test.rs:338:13:338:23 | maybe_digit | test.rs:334:5:343:5 | enter fn test_match_with_return_in_scrutinee |
| test.rs:340:26:340:26 | x | test.rs:338:13:338:23 | maybe_digit |
| test.rs:340:32:340:32 | x | test.rs:340:26:340:26 | x |
| test.rs:341:13:341:24 | ...::None | test.rs:338:13:338:23 | maybe_digit |
| test.rs:346:9:349:18 | ... && ... | test.rs:345:5:350:5 | enter fn test_match_and |
| test.rs:346:10:349:9 | [boolean(false)] match r { ... } | test.rs:345:5:350:5 | enter fn test_match_and |
| test.rs:346:10:349:9 | [boolean(true)] match r { ... } | test.rs:347:24:347:24 | a |
| test.rs:346:10:349:9 | [boolean(true)] match r { ... } | test.rs:347:18:347:18 | a |
| test.rs:347:18:347:18 | a | test.rs:345:5:350:5 | enter fn test_match_and |
| test.rs:347:24:347:24 | a | test.rs:347:18:347:18 | a |
| test.rs:348:13:348:13 | _ | test.rs:345:5:350:5 | enter fn test_match_and |
| test.rs:349:15:349:18 | cond | test.rs:346:10:349:9 | [boolean(true)] match r { ... } |
| test.rs:353:9:356:9 | match r { ... } | test.rs:352:5:357:5 | enter fn test_match_with_no_arms |
| test.rs:354:16:354:20 | value | test.rs:352:5:357:5 | enter fn test_match_with_no_arms |
| test.rs:354:26:354:30 | value | test.rs:354:16:354:20 | value |
| test.rs:355:13:355:22 | Err(...) | test.rs:352:5:357:5 | enter fn test_match_with_no_arms |
| test.rs:363:18:363:18 | n | test.rs:362:5:365:5 | enter fn test_let_match |
| test.rs:363:39:363:53 | MacroStmts | test.rs:362:5:365:5 | enter fn test_let_match |
| test.rs:364:9:364:9 | n | test.rs:363:18:363:18 | n |
| test.rs:367:5:373:5 | exit fn test_let_with_return (normal) | test.rs:367:5:373:5 | enter fn test_let_with_return |
| test.rs:369:18:369:20 | ret | test.rs:367:5:373:5 | enter fn test_let_with_return |
| test.rs:369:26:369:28 | ret | test.rs:369:18:369:20 | ret |
| test.rs:370:13:370:16 | None | test.rs:367:5:373:5 | enter fn test_let_with_return |
| test.rs:394:9:397:9 | match st { ... } | test.rs:393:5:398:5 | enter fn struct_pattern |
| test.rs:395:27:395:27 | 1 | test.rs:393:5:398:5 | enter fn struct_pattern |
@@ -1757,8 +1677,7 @@ immediateDominator
| test.rs:455:30:455:30 | 3 | test.rs:455:13:455:25 | [match(true)] 1 \| 2 |
| test.rs:456:13:456:13 | _ | test.rs:455:13:455:25 | [match(false)] 1 \| 2 |
| test.rs:461:9:464:9 | match pair { ... } | test.rs:460:5:465:5 | enter fn irrefutable_pattern_and_dead_code |
| test.rs:462:18:462:34 | MyStruct {...} | test.rs:460:5:465:5 | enter fn irrefutable_pattern_and_dead_code |
| test.rs:462:32:462:32 | _ | test.rs:462:18:462:34 | MyStruct {...} |
| test.rs:462:32:462:32 | _ | test.rs:460:5:465:5 | enter fn irrefutable_pattern_and_dead_code |
| test.rs:463:13:463:13 | _ | test.rs:460:5:465:5 | enter fn irrefutable_pattern_and_dead_code |
| test.rs:476:9:480:9 | match e { ... } | test.rs:475:5:481:5 | enter fn enum_pattern |
| test.rs:477:32:477:32 | _ | test.rs:475:5:481:5 | enter fn enum_pattern |
@@ -1783,7 +1702,6 @@ immediateDominator
| test.rs:585:18:591:5 | 'block: { ... } | test.rs:584:1:592:1 | enter fn labelled_block2 |
| test.rs:587:18:587:18 | y | test.rs:584:1:592:1 | enter fn labelled_block2 |
| test.rs:588:13:588:27 | ExprStmt | test.rs:584:1:592:1 | enter fn labelled_block2 |
| test.rs:590:9:590:9 | 0 | test.rs:587:18:587:18 | y |
controls
| test.rs:18:5:24:5 | enter fn next | test.rs:20:13:20:13 | n | true |
| test.rs:18:5:24:5 | enter fn next | test.rs:22:13:22:13 | 3 | false |
@@ -1822,8 +1740,8 @@ 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: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: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: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 |
@@ -1964,16 +1882,15 @@ controls
| test.rs:301:13:301:21 | [boolean(true)] ... && ... | test.rs:302:13:302:21 | ExprStmt | true |
| test.rs:301:18:301:21 | true | test.rs:301:13:301:21 | [boolean(true)] ... && ... | true |
| test.rs:301:18:301:21 | true | test.rs:302:13:302:21 | ExprStmt | true |
| test.rs:328:32:328:32 | x | test.rs:328:42:328:42 | x | true |
| test.rs:328:26:328:26 | x | test.rs:328:42:328:42 | x | true |
| test.rs:334:5:343:5 | enter fn test_match_with_return_in_scrutinee | test.rs:335:9:342:9 | match ... { ... } | false |
| test.rs:334:5:343:5 | enter fn test_match_with_return_in_scrutinee | test.rs:336:13:336:21 | ExprStmt | true |
| test.rs:334:5:343:5 | enter fn test_match_with_return_in_scrutinee | test.rs:338:13:338:23 | maybe_digit | false |
| test.rs:334:5:343:5 | enter fn test_match_with_return_in_scrutinee | test.rs:340:26:340:26 | x | false |
| test.rs:334:5:343:5 | enter fn test_match_with_return_in_scrutinee | test.rs:340:32:340:32 | x | false |
| test.rs:334:5:343:5 | enter fn test_match_with_return_in_scrutinee | test.rs:341:13:341:24 | ...::None | false |
| test.rs:346:10:349:9 | [boolean(true)] match r { ... } | test.rs:349:15:349:18 | cond | true |
| test.rs:347:24:347:24 | a | test.rs:346:10:349:9 | [boolean(true)] match r { ... } | true |
| test.rs:347:24:347:24 | a | test.rs:349:15:349:18 | cond | true |
| test.rs:347:18:347:18 | a | test.rs:346:10:349:9 | [boolean(true)] match r { ... } | true |
| test.rs:347:18:347:18 | a | test.rs:349:15:349:18 | cond | true |
| test.rs:511:28:516:9 | enter { ... } | test.rs:512:13:514:13 | if b {...} | false |
| test.rs:511:28:516:9 | enter { ... } | test.rs:513:17:513:41 | ExprStmt | true |
| test.rs:529:5:537:5 | enter fn const_block_assert | test.rs:533:13:533:49 | ExprStmt | false |
@@ -2013,8 +1930,8 @@ 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: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: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: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 |
@@ -2114,14 +2031,14 @@ successor
| test.rs:301:13:301:21 | [boolean(false)] ... && ... | test.rs:301:9:303:9 | if ... {...} | false |
| test.rs:301:13:301:21 | [boolean(true)] ... && ... | test.rs:302:13:302:21 | ExprStmt | true |
| test.rs:301:18:301:21 | true | test.rs:301:13:301:21 | [boolean(true)] ... && ... | true |
| test.rs:328:32:328:32 | x | test.rs:328:42:328:42 | x | true |
| test.rs:328:32:328:32 | x | test.rs:329:13:329:27 | ...::Some(...) | false |
| test.rs:328:26:328:26 | x | test.rs:328:42:328:42 | x | true |
| test.rs:328:26:328:26 | x | test.rs:329:13:329:27 | ...::Some(...) | false |
| test.rs:334:5:343:5 | enter fn test_match_with_return_in_scrutinee | test.rs:336:13:336:21 | ExprStmt | true |
| test.rs:334:5:343:5 | enter fn test_match_with_return_in_scrutinee | test.rs:338:13:338:23 | maybe_digit | false |
| test.rs:346:10:349:9 | [boolean(false)] match r { ... } | test.rs:346:9:349:18 | ... && ... | false |
| test.rs:346:10:349:9 | [boolean(true)] match r { ... } | test.rs:349:15:349:18 | cond | true |
| test.rs:347:24:347:24 | a | test.rs:346:10:349:9 | [boolean(false)] match r { ... } | false |
| test.rs:347:24:347:24 | a | test.rs:346:10:349:9 | [boolean(true)] match r { ... } | true |
| test.rs:347:18:347:18 | a | test.rs:346:10:349:9 | [boolean(false)] match r { ... } | false |
| test.rs:347:18:347:18 | a | test.rs:346:10:349:9 | [boolean(true)] match r { ... } | true |
| test.rs:348:13:348:13 | _ | test.rs:346:10:349:9 | [boolean(false)] match r { ... } | false |
| test.rs:511:28:516:9 | enter { ... } | test.rs:512:13:514:13 | if b {...} | false |
| test.rs:511:28:516:9 | enter { ... } | test.rs:513:17:513:41 | ExprStmt | true |
@@ -2160,9 +2077,8 @@ 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 ... = ... | 1 |
| test.rs:99:9:103:9 | while ... { ... } | test.rs:99:24:99:24 | x | 0 |
| test.rs:99:9:103:9 | while ... { ... } | test.rs:101:17:101:22 | ExprStmt | 2 |
| test.rs:99:9:103:9 | while ... { ... } | test.rs:99:15:99:39 | 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:107:9:112:9 | for ... in ... { ... } | test.rs:107:13:107:13 | i | 1 |
@@ -2173,14 +2089,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:147:13:147:13 | n | 1 |
| test.rs:146:9:150:9 | if ... {...} else {...} | test.rs:149:13:149:13 | 0 | 0 |
| test.rs:149:13:149:13 | 0 | test.rs:145:5:151:5 | enter fn test_if_let_else | 1 |
| test.rs:149:13:149:13 | 0 | test.rs:146:21:146:21 | n | 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: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:155:13:155:21 | ExprStmt | 0 |
| test.rs:154:9:156:9 | if ... {...} | test.rs:153:5:158:5 | enter fn test_if_let | 1 |
| test.rs:154:9:156:9 | if ... {...} | test.rs:154:21:154:21 | n | 0 |
| test.rs:153:5:158:5 | exit fn test_if_let (normal) | test.rs:154:21:154:21 | n | 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 |
@@ -2244,35 +2156,22 @@ joinBlockPredecessor
| test.rs:316:9:319:9 | match ... { ... } | test.rs:317:21:317:24 | Some | 0 |
| test.rs:316:9:319:9 | match ... { ... } | test.rs:318:13:318:17 | false | 1 |
| test.rs:327:9:331:9 | match maybe_digit { ... } | test.rs:328:42:328:42 | x | 0 |
| test.rs:327:9:331:9 | match maybe_digit { ... } | test.rs:329:32:329:32 | x | 1 |
| test.rs:327:9:331:9 | match maybe_digit { ... } | test.rs:329:26:329:26 | x | 1 |
| test.rs:327:9:331:9 | match maybe_digit { ... } | test.rs:330:13:330:24 | ...::None | 2 |
| test.rs:329:13:329:27 | ...::Some(...) | test.rs:326:5:332:5 | enter fn test_match | 2 |
| test.rs:329:13:329:27 | ...::Some(...) | test.rs:328:26:328:26 | x | 1 |
| test.rs:329:13:329:27 | ...::Some(...) | test.rs:328:32:328:32 | x | 0 |
| test.rs:330:13:330:24 | ...::None | test.rs:329:13:329:27 | ...::Some(...) | 1 |
| test.rs:330:13:330:24 | ...::None | test.rs:329:26:329:26 | x | 0 |
| test.rs:329:13:329:27 | ...::Some(...) | test.rs:326:5:332:5 | enter fn test_match | 1 |
| test.rs:329:13:329:27 | ...::Some(...) | test.rs:328:26:328:26 | x | 0 |
| test.rs:334:5:343:5 | exit fn test_match_with_return_in_scrutinee (normal) | test.rs:335:9:342:9 | match ... { ... } | 1 |
| test.rs:334:5:343:5 | exit fn test_match_with_return_in_scrutinee (normal) | test.rs:336:13:336:21 | ExprStmt | 0 |
| test.rs:335:9:342:9 | match ... { ... } | test.rs:340:32:340:32 | x | 0 |
| test.rs:335:9:342:9 | match ... { ... } | test.rs:340:26:340:26 | x | 0 |
| test.rs:335:9:342:9 | match ... { ... } | test.rs:341:13:341:24 | ...::None | 1 |
| test.rs:341:13:341:24 | ...::None | test.rs:338:13:338:23 | maybe_digit | 0 |
| test.rs:341:13:341:24 | ...::None | test.rs:340:26:340:26 | x | 1 |
| test.rs:346:9:349:18 | ... && ... | test.rs:346:10:349:9 | [boolean(false)] match r { ... } | 0 |
| test.rs:346:9:349:18 | ... && ... | test.rs:349:15:349:18 | cond | 1 |
| test.rs:346:10:349:9 | [boolean(false)] match r { ... } | test.rs:347:24:347:24 | a | 0 |
| test.rs:346:10:349:9 | [boolean(false)] match r { ... } | test.rs:347:18:347:18 | a | 0 |
| test.rs:346:10:349:9 | [boolean(false)] match r { ... } | test.rs:348:13:348:13 | _ | 1 |
| test.rs:348:13:348:13 | _ | test.rs:345:5:350:5 | enter fn test_match_and | 1 |
| test.rs:348:13:348:13 | _ | test.rs:347:18:347:18 | a | 0 |
| test.rs:353:9:356:9 | match r { ... } | test.rs:354:26:354:30 | value | 0 |
| test.rs:353:9:356:9 | match r { ... } | test.rs:354:16:354:20 | value | 0 |
| test.rs:353:9:356:9 | match r { ... } | test.rs:355:13:355:22 | Err(...) | 1 |
| test.rs:355:13:355:22 | Err(...) | test.rs:352:5:357:5 | enter fn test_match_with_no_arms | 1 |
| test.rs:355:13:355:22 | Err(...) | test.rs:354:16:354:20 | value | 0 |
| test.rs:363:39:363:53 | MacroStmts | test.rs:362:5:365:5 | enter fn test_let_match | 1 |
| test.rs:363:39:363:53 | MacroStmts | test.rs:363:18:363:18 | n | 0 |
| test.rs:367:5:373:5 | exit fn test_let_with_return (normal) | test.rs:369:26:369:28 | ret | 0 |
| test.rs:367:5:373:5 | exit fn test_let_with_return (normal) | test.rs:369:18:369:20 | ret | 0 |
| test.rs:367:5:373:5 | exit fn test_let_with_return (normal) | test.rs:370:13:370:16 | None | 1 |
| test.rs:370:13:370:16 | None | test.rs:367:5:373:5 | enter fn test_let_with_return | 1 |
| test.rs:370:13:370:16 | None | test.rs:369:18:369:20 | ret | 0 |
| test.rs:394:9:397:9 | match st { ... } | test.rs:395:34:395:34 | 0 | 0 |
| test.rs:394:9:397:9 | match st { ... } | test.rs:396:13:396:26 | MyStruct {...} | 1 |
| test.rs:396:13:396:26 | MyStruct {...} | test.rs:393:5:398:5 | enter fn struct_pattern | 1 |
@@ -2313,8 +2212,6 @@ joinBlockPredecessor
| test.rs:455:13:455:25 | one_or_two!... | test.rs:455:13:455:25 | [match(true)] 1 \| 2 | 1 |
| test.rs:461:9:464:9 | match pair { ... } | test.rs:462:32:462:32 | _ | 0 |
| test.rs:461:9:464:9 | match pair { ... } | test.rs:463:13:463:13 | _ | 1 |
| test.rs:463:13:463:13 | _ | test.rs:460:5:465:5 | enter fn irrefutable_pattern_and_dead_code | 1 |
| test.rs:463:13:463:13 | _ | test.rs:462:18:462:34 | MyStruct {...} | 0 |
| test.rs:476:9:480:9 | match e { ... } | test.rs:477:32:477:32 | _ | 0 |
| test.rs:476:9:480:9 | match e { ... } | test.rs:478:26:478:26 | _ | 1 |
| test.rs:476:9:480:9 | match e { ... } | test.rs:479:13:479:23 | UnitVariant | 2 |
@@ -2327,7 +2224,5 @@ joinBlockPredecessor
| test.rs:569:18:580:5 | 'block: { ... } | test.rs:572:13:572:27 | ExprStmt | 0 |
| test.rs:569:18:580:5 | 'block: { ... } | test.rs:575:9:577:9 | if ... {...} | 2 |
| test.rs:569:18:580:5 | 'block: { ... } | test.rs:576:13:576:27 | ExprStmt | 1 |
| test.rs:585:18:591:5 | 'block: { ... } | test.rs:587:18:587:18 | y | 1 |
| test.rs:585:18:591:5 | 'block: { ... } | test.rs:588:13:588:27 | ExprStmt | 0 |
| test.rs:585:18:591:5 | 'block: { ... } | test.rs:590:9:590:9 | 0 | 1 |
| test.rs:588:13:588:27 | ExprStmt | test.rs:584:1:592:1 | enter fn labelled_block2 | 1 |
| test.rs:588:13:588:27 | ExprStmt | test.rs:587:18:587:18 | y | 0 |

View File

@@ -203,7 +203,6 @@ edges
| 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:19:99:25 | Some(...) | test.rs:99:24:99:24 | x | match |
| test.rs:99:24:99:24 | x | test.rs:99:9:103:9 | while ... { ... } | no-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(...) | |
@@ -317,7 +316,6 @@ edges
| 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:21:146:21 | n | |
| test.rs:146:21:146:21 | n | test.rs:147:13:147:13 | n | match |
| test.rs:146:21:146:21 | n | test.rs:149:13:149:13 | 0 | no-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 | { ... } | |
@@ -334,7 +332,6 @@ edges
| 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:16:154:22 | Some(...) | test.rs:154:21:154:21 | n | match |
| test.rs:154:21:154:21 | n | test.rs:154:9:156:9 | if ... {...} | no-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(...) | |
@@ -802,7 +799,6 @@ edges
| test.rs:328:13:328:27 | ...::Some(...) | test.rs:329:13:329:27 | ...::Some(...) | no-match |
| test.rs:328:26:328:26 | x | test.rs:328:26:328:26 | x | |
| test.rs:328:26:328:26 | x | test.rs:328:32:328:32 | x | match |
| test.rs:328:26:328:26 | x | test.rs:329:13:329:27 | ...::Some(...) | no-match |
| test.rs:328:32:328:32 | x | test.rs:328:36:328:37 | 10 | |
| test.rs:328:32:328:37 | ... < ... | test.rs:328:42:328:42 | x | true |
| test.rs:328:32:328:37 | ... < ... | test.rs:329:13:329:27 | ...::Some(...) | false |
@@ -814,7 +810,6 @@ edges
| test.rs:329:13:329:27 | ...::Some(...) | test.rs:330:13:330:24 | ...::None | no-match |
| test.rs:329:26:329:26 | x | test.rs:329:26:329:26 | x | |
| test.rs:329:26:329:26 | x | test.rs:329:32:329:32 | x | match |
| test.rs:329:26:329:26 | x | test.rs:330:13:330:24 | ...::None | no-match |
| test.rs:329:32:329:32 | x | test.rs:327:9:331:9 | match maybe_digit { ... } | |
| test.rs:330:13:330:24 | ...::None | test.rs:330:29:330:29 | 5 | match |
| test.rs:330:29:330:29 | 5 | test.rs:327:9:331:9 | match maybe_digit { ... } | |
@@ -841,7 +836,6 @@ edges
| test.rs:340:13:340:27 | ...::Some(...) | test.rs:341:13:341:24 | ...::None | no-match |
| test.rs:340:26:340:26 | x | test.rs:340:26:340:26 | x | |
| test.rs:340:26:340:26 | x | test.rs:340:32:340:32 | x | match |
| test.rs:340:26:340:26 | x | test.rs:341:13:341:24 | ...::None | no-match |
| test.rs:340:32:340:32 | x | test.rs:340:36:340:36 | 5 | |
| test.rs:340:32:340:36 | ... + ... | test.rs:335:9:342:9 | match ... { ... } | |
| test.rs:340:36:340:36 | 5 | test.rs:340:32:340:36 | ... + ... | |
@@ -864,7 +858,6 @@ edges
| test.rs:347:13:347:19 | Some(...) | test.rs:348:13:348:13 | _ | no-match |
| test.rs:347:18:347:18 | a | test.rs:347:18:347:18 | a | |
| test.rs:347:18:347:18 | a | test.rs:347:24:347:24 | a | match |
| test.rs:347:18:347:18 | a | test.rs:348:13:348:13 | _ | no-match |
| test.rs:347:24:347:24 | a | test.rs:346:10:349:9 | [boolean(false)] match r { ... } | false |
| test.rs:347:24:347:24 | a | test.rs:346:10:349:9 | [boolean(true)] match r { ... } | true |
| test.rs:348:13:348:13 | _ | test.rs:348:18:348:22 | false | match |
@@ -882,7 +875,6 @@ edges
| test.rs:354:13:354:21 | Ok(...) | test.rs:355:13:355:22 | Err(...) | no-match |
| test.rs:354:16:354:20 | value | test.rs:354:16:354:20 | value | |
| test.rs:354:16:354:20 | value | test.rs:354:26:354:30 | value | match |
| test.rs:354:16:354:20 | value | test.rs:355:13:355:22 | Err(...) | no-match |
| test.rs:354:26:354:30 | value | test.rs:353:9:356:9 | match r { ... } | |
| test.rs:355:13:355:22 | Err(...) | test.rs:355:17:355:21 | never | match |
| test.rs:355:17:355:21 | never | test.rs:355:17:355:21 | never | |
@@ -899,7 +891,6 @@ edges
| test.rs:363:13:363:19 | Some(...) | test.rs:363:18:363:18 | n | match |
| test.rs:363:13:363:19 | Some(...) | test.rs:363:39:363:53 | MacroStmts | no-match |
| test.rs:363:18:363:18 | n | test.rs:363:18:363:18 | n | |
| test.rs:363:18:363:18 | n | test.rs:363:39:363:53 | MacroStmts | no-match |
| test.rs:363:18:363:18 | n | test.rs:364:9:364:9 | n | match |
| test.rs:363:23:363:23 | a | test.rs:363:13:363:19 | Some(...) | |
| test.rs:363:32:363:54 | ...::panic_fmt | test.rs:363:39:363:53 | "Expected some" | |
@@ -932,7 +923,6 @@ edges
| test.rs:369:13:369:21 | Some(...) | test.rs:370:13:370:16 | None | no-match |
| test.rs:369:18:369:20 | ret | test.rs:369:18:369:20 | ret | |
| test.rs:369:18:369:20 | ret | test.rs:369:26:369:28 | ret | match |
| test.rs:369:18:369:20 | ret | test.rs:370:13:370:16 | None | no-match |
| test.rs:369:26:369:28 | ret | test.rs:368:19:371:9 | match m { ... } | |
| test.rs:370:13:370:16 | None | test.rs:370:13:370:16 | None | |
| test.rs:370:13:370:16 | None | test.rs:370:28:370:32 | false | match |
@@ -1158,7 +1148,6 @@ edges
| test.rs:462:14:462:35 | TuplePat | test.rs:462:15:462:15 | n | match |
| test.rs:462:15:462:15 | n | test.rs:462:15:462:15 | n | |
| test.rs:462:15:462:15 | n | test.rs:462:18:462:34 | MyStruct {...} | match |
| test.rs:462:15:462:15 | n | test.rs:463:13:463:13 | _ | no-match |
| test.rs:462:18:462:34 | MyStruct {...} | test.rs:462:32:462:32 | _ | match |
| test.rs:462:18:462:34 | MyStruct {...} | test.rs:463:13:463:13 | _ | no-match |
| test.rs:462:32:462:32 | _ | test.rs:462:40:462:40 | n | match |
@@ -1409,7 +1398,6 @@ edges
| test.rs:587:13:587:19 | Some(...) | test.rs:587:18:587:18 | y | match |
| test.rs:587:13:587:19 | Some(...) | test.rs:588:13:588:27 | ExprStmt | no-match |
| test.rs:587:18:587:18 | y | test.rs:587:18:587:18 | y | |
| test.rs:587:18:587:18 | y | test.rs:588:13:588:27 | ExprStmt | no-match |
| test.rs:587:18:587:18 | y | test.rs:590:9:590:9 | 0 | match |
| test.rs:587:23:587:23 | x | test.rs:587:13:587:19 | Some(...) | |
| test.rs:588:13:588:26 | break ''block 1 | test.rs:585:18:591:5 | 'block: { ... } | break |

View File

@@ -8,7 +8,7 @@ private module Tm = TranslateModels<provenance/1>;
query predicate models = Tm::models/2;
query predicate localStep(Node nodeFrom, Node nodeTo) {
query predicate localStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo) {
// Local flow steps that don't originate from a flow summary.
RustDataFlow::simpleLocalFlowStep(nodeFrom, nodeTo, "")
}

View File

@@ -1,5 +1,5 @@
import codeql.rust.dataflow.DataFlow
import codeql.rust.dataflow.internal.DataFlowImpl
import codeql.rust.dataflow.internal.Node as Node
import codeql.rust.dataflow.internal.TaintTrackingImpl
import utils.test.TranslateModels

View File

@@ -0,0 +1,2 @@
extractionWarning
| loop/main.rs:1:1:1:1 | semantic analyzer unavailable (not included as a module) |

View File

@@ -0,0 +1,14 @@
// The code in this file is not valid Rust code, but it is used to test that
// our type inference implementation does not run into an infinite loop.
struct S<T>(T);
trait T1<T>: T2<S<T>> {
fn foo(self) {}
}
trait T2<T>: T1<S<T>> {
fn bar(self) {
self.foo()
}
}

View File

@@ -0,0 +1 @@
qltest_cargo_check: false

View File

@@ -1,4 +1,42 @@
inferType
| loop/main.rs:7:12:7:15 | SelfParam | | loop/main.rs:6:1:8:1 | trait T1 |
| loop/main.rs:7:12:7:15 | SelfParam | T | loop/main.rs:6:10:6:10 | T |
| loop/main.rs:11:12:11:15 | SelfParam | | loop/main.rs:6:1:8:1 | trait T1 |
| loop/main.rs:11:12:11:15 | SelfParam | | loop/main.rs:10:1:14:1 | trait T2 |
| loop/main.rs:11:12:11:15 | SelfParam | T | loop/main.rs:4:1:4:15 | struct S |
| loop/main.rs:11:12:11:15 | SelfParam | T | loop/main.rs:10:10:10:10 | T |
| loop/main.rs:11:12:11:15 | SelfParam | T.T | loop/main.rs:4:1:4:15 | struct S |
| loop/main.rs:11:12:11:15 | SelfParam | T.T | loop/main.rs:10:10:10:10 | T |
| loop/main.rs:11:12:11:15 | SelfParam | T.T.T | loop/main.rs:4:1:4:15 | struct S |
| loop/main.rs:11:12:11:15 | SelfParam | T.T.T.T | loop/main.rs:4:1:4:15 | struct S |
| loop/main.rs:11:12:11:15 | SelfParam | T.T.T.T | loop/main.rs:10:10:10:10 | T |
| loop/main.rs:11:12:11:15 | SelfParam | T.T.T.T.T | loop/main.rs:4:1:4:15 | struct S |
| loop/main.rs:11:12:11:15 | SelfParam | T.T.T.T.T.T | loop/main.rs:4:1:4:15 | struct S |
| loop/main.rs:11:12:11:15 | SelfParam | T.T.T.T.T.T | loop/main.rs:10:10:10:10 | T |
| loop/main.rs:11:12:11:15 | SelfParam | T.T.T.T.T.T.T | loop/main.rs:4:1:4:15 | struct S |
| loop/main.rs:11:12:11:15 | SelfParam | T.T.T.T.T.T.T.T | loop/main.rs:4:1:4:15 | struct S |
| loop/main.rs:11:12:11:15 | SelfParam | T.T.T.T.T.T.T.T | loop/main.rs:10:10:10:10 | T |
| loop/main.rs:11:12:11:15 | SelfParam | T.T.T.T.T.T.T.T.T | loop/main.rs:4:1:4:15 | struct S |
| loop/main.rs:11:12:11:15 | SelfParam | T.T.T.T.T.T.T.T.T.T | loop/main.rs:4:1:4:15 | struct S |
| loop/main.rs:11:12:11:15 | SelfParam | T.T.T.T.T.T.T.T.T.T | loop/main.rs:10:10:10:10 | T |
| loop/main.rs:12:9:12:12 | self | | loop/main.rs:6:1:8:1 | trait T1 |
| loop/main.rs:12:9:12:12 | self | | loop/main.rs:10:1:14:1 | trait T2 |
| loop/main.rs:12:9:12:12 | self | T | loop/main.rs:4:1:4:15 | struct S |
| loop/main.rs:12:9:12:12 | self | T | loop/main.rs:10:10:10:10 | T |
| loop/main.rs:12:9:12:12 | self | T.T | loop/main.rs:4:1:4:15 | struct S |
| loop/main.rs:12:9:12:12 | self | T.T | loop/main.rs:10:10:10:10 | T |
| loop/main.rs:12:9:12:12 | self | T.T.T | loop/main.rs:4:1:4:15 | struct S |
| loop/main.rs:12:9:12:12 | self | T.T.T.T | loop/main.rs:4:1:4:15 | struct S |
| loop/main.rs:12:9:12:12 | self | T.T.T.T | loop/main.rs:10:10:10:10 | T |
| loop/main.rs:12:9:12:12 | self | T.T.T.T.T | loop/main.rs:4:1:4:15 | struct S |
| loop/main.rs:12:9:12:12 | self | T.T.T.T.T.T | loop/main.rs:4:1:4:15 | struct S |
| loop/main.rs:12:9:12:12 | self | T.T.T.T.T.T | loop/main.rs:10:10:10:10 | T |
| loop/main.rs:12:9:12:12 | self | T.T.T.T.T.T.T | loop/main.rs:4:1:4:15 | struct S |
| loop/main.rs:12:9:12:12 | self | T.T.T.T.T.T.T.T | loop/main.rs:4:1:4:15 | struct S |
| loop/main.rs:12:9:12:12 | self | T.T.T.T.T.T.T.T | loop/main.rs:10:10:10:10 | T |
| loop/main.rs:12:9:12:12 | self | T.T.T.T.T.T.T.T.T | loop/main.rs:4:1:4:15 | struct S |
| loop/main.rs:12:9:12:12 | self | T.T.T.T.T.T.T.T.T.T | loop/main.rs:4:1:4:15 | struct S |
| loop/main.rs:12:9:12:12 | self | T.T.T.T.T.T.T.T.T.T | loop/main.rs:10:10:10:10 | T |
| main.rs:26:13:26:13 | x | | main.rs:5:5:8:5 | struct MyThing |
| main.rs:26:17:26:32 | MyThing {...} | | main.rs:5:5:8:5 | struct MyThing |
| main.rs:26:30:26:30 | S | | main.rs:2:5:3:13 | struct S |
@@ -847,6 +885,7 @@ inferType
| main.rs:652:20:652:38 | ...::Foo {...} | | main.rs:67:5:67:21 | struct Foo |
| main.rs:652:41:652:59 | ...::Foo {...} | | main.rs:67:5:67:21 | struct Foo |
resolveMethodCallExpr
| loop/main.rs:12:9:12:18 | self.foo(...) | loop/main.rs:7:5:7:19 | fn foo |
| main.rs:88:9:88:14 | x.m1(...) | main.rs:70:9:72:9 | fn m1 |
| main.rs:89:9:89:14 | y.m2(...) | main.rs:74:9:76:9 | fn m2 |
| main.rs:136:26:136:31 | x.m2(...) | main.rs:117:9:119:9 | fn m2 |

View File

@@ -221,7 +221,6 @@ edges
| main.rs:87:8:88:12 | let ... = s1 | main.rs:88:11:88:12 | s1 | |
| main.rs:87:12:87:23 | Some(...) | main.rs:87:5:90:5 | if ... {...} | no-match |
| main.rs:87:12:87:23 | Some(...) | main.rs:87:21:87:22 | s2 | match |
| main.rs:87:17:87:22 | ref s2 | main.rs:87:5:90:5 | if ... {...} | no-match |
| main.rs:87:17:87:22 | ref s2 | main.rs:89:9:89:22 | ExprStmt | match |
| main.rs:87:21:87:22 | s2 | main.rs:87:17:87:22 | ref s2 | |
| main.rs:88:11:88:12 | s1 | main.rs:87:12:87:23 | Some(...) | |
@@ -237,7 +236,6 @@ edges
| main.rs:94:9:94:16 | Some(...) | main.rs:94:14:94:15 | x5 | match |
| main.rs:94:9:94:16 | Some(...) | main.rs:96:13:96:19 | MacroStmts | no-match |
| main.rs:94:14:94:15 | x5 | main.rs:94:14:94:15 | x5 | |
| main.rs:94:14:94:15 | x5 | main.rs:96:13:96:19 | MacroStmts | no-match |
| main.rs:94:14:94:15 | x5 | main.rs:98:5:98:18 | ExprStmt | match |
| main.rs:94:34:94:37 | Some | main.rs:94:39:94:42 | "x5" | |
| main.rs:94:34:94:43 | Some(...) | main.rs:94:9:94:16 | Some(...) | |
@@ -267,7 +265,6 @@ edges
| main.rs:104:11:105:12 | let ... = s1 | main.rs:105:11:105:12 | s1 | |
| main.rs:104:15:104:26 | Some(...) | main.rs:104:5:107:5 | while ... { ... } | no-match |
| main.rs:104:15:104:26 | Some(...) | main.rs:104:24:104:25 | s2 | match |
| main.rs:104:20:104:25 | ref s2 | main.rs:104:5:107:5 | while ... { ... } | no-match |
| main.rs:104:20:104:25 | ref s2 | main.rs:106:9:106:22 | ExprStmt | match |
| main.rs:104:24:104:25 | s2 | main.rs:104:20:104:25 | ref s2 | |
| main.rs:105:11:105:12 | s1 | main.rs:104:15:104:26 | Some(...) | |
@@ -304,7 +301,6 @@ edges
| main.rs:116:9:116:16 | Some(...) | main.rs:121:9:121:12 | None | no-match |
| main.rs:116:14:116:15 | y1 | main.rs:116:14:116:15 | y1 | |
| main.rs:116:14:116:15 | y1 | main.rs:119:13:119:21 | print_i64 | match |
| main.rs:116:14:116:15 | y1 | main.rs:121:9:121:12 | None | no-match |
| main.rs:118:9:120:9 | { ... } | main.rs:114:5:122:5 | match x6 { ... } | |
| main.rs:119:13:119:21 | print_i64 | main.rs:119:23:119:24 | y1 | |
| main.rs:119:13:119:25 | print_i64(...) | main.rs:118:9:120:9 | { ... } | |
@@ -457,7 +453,6 @@ edges
| main.rs:191:9:191:44 | ... \| ... | main.rs:192:16:192:24 | print_i64 | match |
| main.rs:191:22:191:23 | a3 | main.rs:191:9:191:44 | ... \| ... | match |
| main.rs:191:22:191:23 | a3 | main.rs:191:22:191:23 | a3 | |
| main.rs:191:22:191:23 | a3 | main.rs:191:28:191:44 | ...::Right(...) | no-match |
| main.rs:191:28:191:44 | ...::Right(...) | main.rs:191:42:191:43 | a3 | match |
| main.rs:191:42:191:43 | a3 | main.rs:191:9:191:44 | ... \| ... | match |
| main.rs:191:42:191:43 | a3 | main.rs:191:42:191:43 | a3 | |
@@ -481,12 +476,10 @@ edges
| main.rs:205:9:205:81 | ... \| ... \| ... | main.rs:206:16:206:24 | print_i64 | match |
| main.rs:205:28:205:29 | a4 | main.rs:205:9:205:81 | ... \| ... \| ... | match |
| main.rs:205:28:205:29 | a4 | main.rs:205:28:205:29 | a4 | |
| main.rs:205:28:205:29 | a4 | main.rs:205:34:205:56 | ...::Second(...) | no-match |
| main.rs:205:34:205:56 | ...::Second(...) | main.rs:205:54:205:55 | a4 | match |
| main.rs:205:34:205:56 | ...::Second(...) | main.rs:205:60:205:81 | ...::Third(...) | no-match |
| main.rs:205:54:205:55 | a4 | main.rs:205:9:205:81 | ... \| ... \| ... | match |
| main.rs:205:54:205:55 | a4 | main.rs:205:54:205:55 | a4 | |
| main.rs:205:54:205:55 | a4 | main.rs:205:60:205:81 | ...::Third(...) | no-match |
| main.rs:205:60:205:81 | ...::Third(...) | main.rs:205:79:205:80 | a4 | match |
| main.rs:205:79:205:80 | a4 | main.rs:205:9:205:81 | ... \| ... \| ... | match |
| main.rs:205:79:205:80 | a4 | main.rs:205:79:205:80 | a4 | |
@@ -503,10 +496,8 @@ edges
| main.rs:209:10:209:57 | [match(true)] ... \| ... | main.rs:209:9:209:83 | ... \| ... | match |
| main.rs:209:29:209:30 | a5 | main.rs:209:10:209:57 | [match(true)] ... \| ... | match |
| main.rs:209:29:209:30 | a5 | main.rs:209:29:209:30 | a5 | |
| main.rs:209:29:209:30 | a5 | main.rs:209:35:209:57 | ...::Second(...) | no-match |
| main.rs:209:35:209:57 | ...::Second(...) | main.rs:209:10:209:57 | [match(false)] ... \| ... | no-match |
| main.rs:209:35:209:57 | ...::Second(...) | main.rs:209:55:209:56 | a5 | match |
| main.rs:209:55:209:56 | a5 | main.rs:209:10:209:57 | [match(false)] ... \| ... | no-match |
| main.rs:209:55:209:56 | a5 | main.rs:209:10:209:57 | [match(true)] ... \| ... | match |
| main.rs:209:55:209:56 | a5 | main.rs:209:55:209:56 | a5 | |
| main.rs:209:62:209:83 | ...::Third(...) | main.rs:209:81:209:82 | a5 | match |
@@ -522,13 +513,11 @@ edges
| main.rs:213:9:213:83 | ... \| ... | main.rs:214:16:214:24 | print_i64 | match |
| main.rs:213:28:213:29 | a6 | main.rs:213:9:213:83 | ... \| ... | match |
| main.rs:213:28:213:29 | a6 | main.rs:213:28:213:29 | a6 | |
| main.rs:213:28:213:29 | a6 | main.rs:213:35:213:57 | ...::Second(...) | no-match |
| main.rs:213:35:213:57 | ...::Second(...) | main.rs:213:55:213:56 | a6 | match |
| main.rs:213:35:213:57 | ...::Second(...) | main.rs:213:61:213:82 | ...::Third(...) | no-match |
| main.rs:213:35:213:82 | ... \| ... | main.rs:213:9:213:83 | ... \| ... | match |
| main.rs:213:55:213:56 | a6 | main.rs:213:35:213:82 | ... \| ... | match |
| main.rs:213:55:213:56 | a6 | main.rs:213:55:213:56 | a6 | |
| main.rs:213:55:213:56 | a6 | main.rs:213:61:213:82 | ...::Third(...) | no-match |
| main.rs:213:61:213:82 | ...::Third(...) | main.rs:213:80:213:81 | a6 | match |
| main.rs:213:80:213:81 | a6 | main.rs:213:35:213:82 | ... \| ... | match |
| main.rs:213:80:213:81 | a6 | main.rs:213:80:213:81 | a6 | |
@@ -552,10 +541,8 @@ edges
| main.rs:221:9:221:44 | [match(true)] ... \| ... | main.rs:222:16:222:17 | a7 | match |
| main.rs:221:22:221:23 | a7 | main.rs:221:9:221:44 | [match(true)] ... \| ... | match |
| main.rs:221:22:221:23 | a7 | main.rs:221:22:221:23 | a7 | |
| main.rs:221:22:221:23 | a7 | main.rs:221:28:221:44 | ...::Right(...) | no-match |
| main.rs:221:28:221:44 | ...::Right(...) | main.rs:221:9:221:44 | [match(false)] ... \| ... | no-match |
| main.rs:221:28:221:44 | ...::Right(...) | main.rs:221:42:221:43 | a7 | match |
| main.rs:221:42:221:43 | a7 | main.rs:221:9:221:44 | [match(false)] ... \| ... | no-match |
| main.rs:221:42:221:43 | a7 | main.rs:221:9:221:44 | [match(true)] ... \| ... | match |
| main.rs:221:42:221:43 | a7 | main.rs:221:42:221:43 | a7 | |
| main.rs:222:16:222:17 | a7 | main.rs:222:21:222:21 | 0 | |
@@ -586,10 +573,8 @@ edges
| main.rs:233:14:233:51 | [match(true)] ... \| ... | main.rs:232:13:232:13 | e | match |
| main.rs:233:27:233:29 | a11 | main.rs:233:14:233:51 | [match(true)] ... \| ... | match |
| main.rs:233:27:233:29 | a11 | main.rs:233:27:233:29 | a11 | |
| main.rs:233:27:233:29 | a11 | main.rs:233:34:233:51 | ...::Right(...) | no-match |
| main.rs:233:34:233:51 | ...::Right(...) | main.rs:233:14:233:51 | [match(false)] ... \| ... | no-match |
| main.rs:233:34:233:51 | ...::Right(...) | main.rs:233:48:233:50 | a11 | match |
| main.rs:233:48:233:50 | a11 | main.rs:233:14:233:51 | [match(false)] ... \| ... | no-match |
| main.rs:233:48:233:50 | a11 | main.rs:233:14:233:51 | [match(true)] ... \| ... | match |
| main.rs:233:48:233:50 | a11 | main.rs:233:48:233:50 | a11 | |
| main.rs:234:12:240:9 | { ... } | main.rs:231:5:242:5 | match either { ... } | |
@@ -601,7 +586,6 @@ edges
| main.rs:236:16:237:15 | let ... = e | main.rs:237:15:237:15 | e | |
| main.rs:236:20:236:36 | ...::Left(...) | main.rs:236:13:239:13 | if ... {...} | no-match |
| main.rs:236:20:236:36 | ...::Left(...) | main.rs:236:33:236:35 | a12 | match |
| main.rs:236:33:236:35 | a12 | main.rs:236:13:239:13 | if ... {...} | no-match |
| main.rs:236:33:236:35 | a12 | main.rs:236:33:236:35 | a12 | |
| main.rs:236:33:236:35 | a12 | main.rs:238:17:238:32 | ExprStmt | match |
| main.rs:237:15:237:15 | e | main.rs:236:20:236:36 | ...::Left(...) | |
@@ -629,17 +613,14 @@ edges
| main.rs:255:9:255:109 | ... \| ... \| ... | main.rs:256:16:256:24 | print_i64 | match |
| main.rs:255:27:255:29 | a13 | main.rs:255:9:255:109 | ... \| ... \| ... | match |
| main.rs:255:27:255:29 | a13 | main.rs:255:27:255:29 | a13 | |
| main.rs:255:27:255:29 | a13 | main.rs:255:35:255:57 | ...::Second(...) | no-match |
| main.rs:255:35:255:57 | ...::Second(...) | main.rs:255:54:255:56 | a13 | match |
| main.rs:255:35:255:57 | ...::Second(...) | main.rs:255:61:255:82 | ...::Third(...) | no-match |
| main.rs:255:35:255:82 | [match(false)] ... \| ... | main.rs:255:87:255:109 | ...::Fourth(...) | no-match |
| main.rs:255:35:255:82 | [match(true)] ... \| ... | main.rs:255:9:255:109 | ... \| ... \| ... | match |
| main.rs:255:54:255:56 | a13 | main.rs:255:35:255:82 | [match(true)] ... \| ... | match |
| main.rs:255:54:255:56 | a13 | main.rs:255:54:255:56 | a13 | |
| main.rs:255:54:255:56 | a13 | main.rs:255:61:255:82 | ...::Third(...) | no-match |
| main.rs:255:61:255:82 | ...::Third(...) | main.rs:255:35:255:82 | [match(false)] ... \| ... | no-match |
| main.rs:255:61:255:82 | ...::Third(...) | main.rs:255:79:255:81 | a13 | match |
| main.rs:255:79:255:81 | a13 | main.rs:255:35:255:82 | [match(false)] ... \| ... | no-match |
| main.rs:255:79:255:81 | a13 | main.rs:255:35:255:82 | [match(true)] ... \| ... | match |
| main.rs:255:79:255:81 | a13 | main.rs:255:79:255:81 | a13 | |
| main.rs:255:87:255:109 | ...::Fourth(...) | main.rs:255:106:255:108 | a13 | match |
@@ -680,7 +661,6 @@ edges
| main.rs:272:6:272:41 | ... \| ... | main.rs:272:5:272:50 | ...: Either | match |
| main.rs:272:19:272:20 | a9 | main.rs:272:6:272:41 | ... \| ... | match |
| main.rs:272:19:272:20 | a9 | main.rs:272:19:272:20 | a9 | |
| main.rs:272:19:272:20 | a9 | main.rs:272:25:272:41 | ...::Right(...) | no-match |
| main.rs:272:25:272:41 | ...::Right(...) | main.rs:272:39:272:40 | a9 | match |
| main.rs:272:39:272:40 | a9 | main.rs:272:6:272:41 | ... \| ... | match |
| main.rs:272:39:272:40 | a9 | main.rs:272:39:272:40 | a9 | |