diff --git a/rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll b/rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll index fc84c8f0bc6f..bb88d4527904 100644 --- a/rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll +++ b/rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll @@ -15,6 +15,8 @@ private import codeql.rust.internal.PathResolution private import codeql.rust.controlflow.ControlFlowGraph private import codeql.rust.dataflow.Ssa private import codeql.rust.dataflow.FlowSummary +private import codeql.rust.internal.TypeInference as TypeInference +private import codeql.rust.internal.typeinference.DerefChain private import Node private import Content private import FlowSummaryImpl as FlowSummaryImpl @@ -47,7 +49,7 @@ final class DataFlowCallable extends TDataFlowCallable { /** Gets a textual representation of this callable. */ string toString() { - result = [this.asCfgScope().toString(), this.asSummarizedCallable().toString()] + result = [this.asCfgScope().toString(), "[summarized] " + this.asSummarizedCallable()] } /** Gets the location of this callable. */ @@ -60,6 +62,10 @@ final class DataFlowCall extends TDataFlowCall { /** Gets the underlying call, if any. */ Call asCall() { this = TCall(result) } + predicate isImplicitDeref(AstNode n, DerefChain derefChain, int i, Function target) { + this = TImplicitDerefCall(n, derefChain, i, target) + } + predicate isSummaryCall( FlowSummaryImpl::Public::SummarizedCallable c, FlowSummaryImpl::Private::SummaryNode receiver ) { @@ -69,12 +75,19 @@ final class DataFlowCall extends TDataFlowCall { DataFlowCallable getEnclosingCallable() { result.asCfgScope() = this.asCall().getEnclosingCfgScope() or + result.asCfgScope() = any(AstNode n | this.isImplicitDeref(n, _, _, _)).getEnclosingCfgScope() + or this.isSummaryCall(result.asSummarizedCallable(), _) } string toString() { result = this.asCall().toString() or + exists(AstNode n, DerefChain derefChain, int i, Function target | + this.isImplicitDeref(n, derefChain, i, target) and + result = "[implicit deref call " + i + " in " + derefChain.toString() + "] " + n + ) + or exists( FlowSummaryImpl::Public::SummarizedCallable c, FlowSummaryImpl::Private::SummaryNode receiver | @@ -83,7 +96,11 @@ final class DataFlowCall extends TDataFlowCall { ) } - Location getLocation() { result = this.asCall().getLocation() } + Location getLocation() { + result = this.asCall().getLocation() + or + result = any(AstNode n | this.isImplicitDeref(n, _, _, _)).getLocation() + } } /** @@ -383,7 +400,8 @@ module RustDataFlow implements InputSig { node.(FlowSummaryNode).getSummaryNode().isHidden() or node instanceof CaptureNode or node instanceof ClosureParameterNode or - node instanceof DerefBorrowNode or + node instanceof ImplicitDerefNode or + node instanceof ImplicitBorrowNode or node instanceof DerefOutNode or node instanceof IndexOutNode or node.asExpr() instanceof ParenExpr or @@ -463,6 +481,12 @@ module RustDataFlow implements InputSig { not staticTarget.fromSource() ) ) + or + exists(Function f | call = TImplicitDerefCall(_, _, _, f) | + result.asCfgScope() = f + or + result.asSummarizedCallable() = f + ) } /** @@ -542,16 +566,18 @@ module RustDataFlow implements InputSig { } pragma[nomagic] - private predicate implicitDeref(Node node1, DerefBorrowNode node2, ReferenceContent c) { - not node2.isBorrow() and - node1.asExpr() = node2.getNode() and + private predicate implicitDeref(ImplicitDerefNode node1, Node node2, ReferenceContent c) { + node2 = node1.getDerefOutputNode() and exists(c) } pragma[nomagic] - private predicate implicitBorrow(Node node1, DerefBorrowNode node2, ReferenceContent c) { - node2.isBorrow() and - node1.asExpr() = node2.getNode() and + private predicate implicitBorrow(Node node1, Node node2, ReferenceContent c) { + ( + node1 = node2.(ImplicitDerefNode).getBorrowInputNode() + or + node1 = node2.(ImplicitBorrowNode).getBorrowInputNode() + ) and exists(c) } @@ -563,10 +589,12 @@ module RustDataFlow implements InputSig { private Node getFieldExprContainerNode(FieldExpr fe) { exists(Expr container | container = fe.getContainer() | - not any(DerefBorrowNode n).getNode() = container and + not TypeInference::implicitDerefChainBorrow(container, _, _) and result.asExpr() = container or - result.(DerefBorrowNode).getNode() = container + result.(ImplicitBorrowNode).getNode() = container + or + result.(ImplicitDerefNode).isLast(container) ) } @@ -1055,6 +1083,10 @@ private module Cached { Stages::DataFlowStage::ref() and call.hasEnclosingCfgScope() } or + TImplicitDerefCall(AstNode n, DerefChain derefChain, int i, Function target) { + TypeInference::implicitDerefChainBorrow(n, derefChain, _) and + target = derefChain.getElement(i).getDerefFunction() + } or TSummaryCall( FlowSummaryImpl::Public::SummarizedCallable c, FlowSummaryImpl::Private::SummaryNode receiver ) { diff --git a/rust/ql/lib/codeql/rust/dataflow/internal/Node.qll b/rust/ql/lib/codeql/rust/dataflow/internal/Node.qll index f2f6fa1b0d88..080946e95f1e 100644 --- a/rust/ql/lib/codeql/rust/dataflow/internal/Node.qll +++ b/rust/ql/lib/codeql/rust/dataflow/internal/Node.qll @@ -15,6 +15,7 @@ private import codeql.rust.controlflow.CfgNodes private import codeql.rust.dataflow.Ssa private import codeql.rust.dataflow.FlowSummary private import codeql.rust.internal.TypeInference as TypeInference +private import codeql.rust.internal.typeinference.DerefChain private import Node as Node private import DataFlowImpl private import FlowSummaryImpl as FlowSummaryImpl @@ -229,8 +230,7 @@ final class ExprArgumentNode extends ArgumentNode, ExprNode { ExprArgumentNode() { isArgumentForCall(n, call_, pos_) and - not TypeInference::implicitDeref(n) and - not TypeInference::implicitBorrow(n, _) + not TypeInference::implicitDerefChainBorrow(n, _, _) } override predicate isArgumentOf(DataFlowCall call, RustDataFlow::ArgumentPosition pos) { @@ -242,34 +242,115 @@ final class ExprArgumentNode extends ArgumentNode, ExprNode { * A node that represents the value of an expression _after_ implicit dereferencing * or borrowing. */ -class DerefBorrowNode extends Node, TDerefBorrowNode { +class ImplicitDerefNode extends Node, TImplicitDerefNode { AstNode n; - boolean isBorrow; + DerefChain derefChain; + ImplicitDerefNodeState state; + int i; - DerefBorrowNode() { this = TDerefBorrowNode(n, isBorrow, false) } + ImplicitDerefNode() { this = TImplicitDerefNode(n, derefChain, state, i, false) } - AstNode getNode() { result = n } + Node getBorrowInputNode() { + state = TImplicitDerefNodeBorrowState() and + ( + i = 0 and + result.(AstNodeNode).getAstNode() = n + or + result = TImplicitDerefNode(n, derefChain, TImplicitDerefNodeAfterDerefState(), i - 1, false) + ) + } - predicate isBorrow() { isBorrow = true } + Node getDerefOutputNode() { + state = TImplicitDerefNodeBeforeDerefState() and + result = TImplicitDerefNode(n, derefChain, TImplicitDerefNodeAfterDerefState(), i, false) + } + + predicate isLast(AstNode node) { + this = + TImplicitDerefNode(node, derefChain, TImplicitDerefNodeAfterDerefState(), + derefChain.length() - 1, false) + } override CfgScope getCfgScope() { result = n.getEnclosingCfgScope() } override Location getLocation() { result = n.getLocation() } - override string toString() { - if isBorrow = true then result = n + " [borrowed]" else result = n + " [dereferenced]" + override string toString() { result = n + " [implicit deref " + i + " in state " + state + "]" } +} + +/** + * A node that represents the value of an argument of a call _after_ implicit + * dereferencing or borrowing. + */ +final class ImplicitDerefArgNode extends ImplicitDerefNode, ArgumentNode { + private DataFlowCall call_; + private RustDataFlow::ArgumentPosition pos_; + + ImplicitDerefArgNode() { + state = TImplicitDerefNodeBorrowState() and + call_ = TImplicitDerefCall(n, derefChain, i, _) and + pos_.isSelf() + or + state = TImplicitDerefNodeAfterDerefState() and + i = derefChain.length() - 1 and + TypeInference::implicitDerefChainBorrow(n, derefChain, false) and + isArgumentForCall(n, call_.asCall(), pos_) + } + + override predicate isArgumentOf(DataFlowCall call, RustDataFlow::ArgumentPosition pos) { + call = call_ and pos = pos_ + } +} + +private class ImplicitDerefOutNode extends ImplicitDerefNode, OutNode { + private DataFlowCall call; + + ImplicitDerefOutNode() { state = TImplicitDerefNodeBeforeDerefState() } + + override DataFlowCall getCall(ReturnKind kind) { + result = TImplicitDerefCall(n, derefChain, i, _) and + kind = TNormalReturnKind() } } +/** + * A node that represents the value of an expression _after_ implicit dereferencing + * or borrowing. + */ +class ImplicitBorrowNode extends Node, TImplicitBorrowNode { + AstNode n; + DerefChain derefChain; + + ImplicitBorrowNode() { this = TImplicitBorrowNode(n, derefChain, false) } + + AstNode getNode() { result = n } + + Node getBorrowInputNode() { + result = + TImplicitDerefNode(n, derefChain, TImplicitDerefNodeAfterDerefState(), + derefChain.length() - 1, false) + or + derefChain.isEmpty() and + result.(AstNodeNode).getAstNode() = n + } + + // AstNode getNode() { result = n } + override CfgScope getCfgScope() { result = n.getEnclosingCfgScope() } + + override Location getLocation() { result = n.getLocation() } + + override string toString() { result = n + " [implicit borrow]" } +} + /** * A node that represents the value of an argument of a call _after_ implicit * dereferencing or borrowing. */ -final class DerefBorrowArgNode extends DerefBorrowNode, ArgumentNode { +final class ImplicitBorrowArgNode extends ImplicitBorrowNode, ArgumentNode { private DataFlowCall call_; private RustDataFlow::ArgumentPosition pos_; - DerefBorrowArgNode() { isArgumentForCall(n, call_.asCall(), pos_) } + ImplicitBorrowArgNode() { isArgumentForCall(n, call_.asCall(), pos_) } override predicate isArgumentOf(DataFlowCall call, RustDataFlow::ArgumentPosition pos) { call = call_ and pos = pos_ @@ -478,17 +559,36 @@ final class ExprPostUpdateNode extends PostUpdateNode, TExprPostUpdateNode { override Location getLocation() { result = e.getLocation() } } -final class DerefBorrowPostUpdateNode extends PostUpdateNode, TDerefBorrowNode { - private Expr arg; - private boolean isBorrow; +final class ImplicitDerefPostUpdateNode extends PostUpdateNode, TImplicitDerefNode { + AstNode n; + DerefChain derefChain; + ImplicitDerefNodeState state; + int i; - DerefBorrowPostUpdateNode() { this = TDerefBorrowNode(arg, isBorrow, true) } + ImplicitDerefPostUpdateNode() { this = TImplicitDerefNode(n, derefChain, state, i, true) } - override DerefBorrowNode getPreUpdateNode() { result = TDerefBorrowNode(arg, isBorrow, false) } + override ImplicitDerefNode getPreUpdateNode() { + result = TImplicitDerefNode(n, derefChain, state, i, false) + } - override CfgScope getCfgScope() { result = arg.getEnclosingCfgScope() } + override CfgScope getCfgScope() { result = n.getEnclosingCfgScope() } - override Location getLocation() { result = arg.getLocation() } + override Location getLocation() { result = n.getLocation() } +} + +final class ImplicitBorrowPostUpdateNode extends PostUpdateNode, TImplicitBorrowNode { + AstNode n; + DerefChain derefChain; + + ImplicitBorrowPostUpdateNode() { this = TImplicitBorrowNode(n, derefChain, true) } + + override ImplicitBorrowNode getPreUpdateNode() { + result = TImplicitBorrowNode(n, derefChain, false) + } + + override CfgScope getCfgScope() { result = n.getEnclosingCfgScope() } + + override Location getLocation() { result = n.getLocation() } } class DerefOutPostUpdateNode extends PostUpdateNode, TDerefOutNode { @@ -544,6 +644,21 @@ final class CastNode extends ExprNode { CastNode() { none() } } +newtype TImplicitDerefNodeState = + TImplicitDerefNodeBorrowState() or + TImplicitDerefNodeBeforeDerefState() or + TImplicitDerefNodeAfterDerefState() + +class ImplicitDerefNodeState extends TImplicitDerefNodeState { + string toString() { + this = TImplicitDerefNodeBorrowState() and result = "borrow" + or + this = TImplicitDerefNodeBeforeDerefState() and result = "before deref" + or + this = TImplicitDerefNodeAfterDerefState() and result = "after deref" + } +} + cached newtype TNode = TExprNode(Expr e) { e.hasEnclosingCfgScope() and Stages::DataFlowStage::ref() } or @@ -575,12 +690,14 @@ newtype TNode = ] ) } or - TDerefBorrowNode(AstNode n, boolean borrow, Boolean isPost) { - TypeInference::implicitDeref(n) and - borrow = false - or - TypeInference::implicitBorrow(n, _) and - borrow = true + TImplicitDerefNode( + AstNode n, DerefChain derefChain, ImplicitDerefNodeState state, int i, Boolean isPost + ) { + TypeInference::implicitDerefChainBorrow(n, derefChain, _) and + i in [0 .. derefChain.length() - 1] + } or + TImplicitBorrowNode(AstNode n, DerefChain derefChain, Boolean isPost) { + TypeInference::implicitDerefChainBorrow(n, derefChain, true) } or TDerefOutNode(DerefExpr de, Boolean isPost) or TIndexOutNode(IndexExpr ie, Boolean isPost) or diff --git a/rust/ql/lib/codeql/rust/frameworks/asyncstd/fs.model.yml b/rust/ql/lib/codeql/rust/frameworks/asyncstd/fs.model.yml index b8c4cf4e10a8..ed61be612019 100644 --- a/rust/ql/lib/codeql/rust/frameworks/asyncstd/fs.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/asyncstd/fs.model.yml @@ -38,5 +38,6 @@ extensions: pack: codeql/rust-all extensible: summaryModel data: + - ["::deref", "Argument[self].Reference", "ReturnValue.Reference", "taint", "manual"] - ["async_std::fs::canonicalize::canonicalize", "Argument[0].OptionalStep[normalize-path]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] - ["async_std::fs::canonicalize::canonicalize", "Argument[0].OptionalBarrier[normalize-path]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"] diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/alloc.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/alloc.model.yml index ece380966dee..7f0d744313bd 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/alloc.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/alloc.model.yml @@ -47,6 +47,7 @@ extensions: - ["::pad_to_align", "Argument[self].Reference", "ReturnValue", "taint", "manual"] - ["::size", "Argument[self].Reference", "ReturnValue", "taint", "manual"] # String + - ["::deref", "Argument[self].Reference", "ReturnValue.Reference", "taint", "manual"] - ["::as_str", "Argument[self]", "ReturnValue", "value", "manual"] - ["::as_bytes", "Argument[self]", "ReturnValue", "value", "manual"] - ["<_ as alloc::string::ToString>::to_string", "Argument[self].Reference", "ReturnValue", "taint", "manual"] diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/core.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/core.model.yml index afcc3c42c8d4..9c83056904f0 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/core.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/core.model.yml @@ -114,10 +114,10 @@ extensions: - ["::deref", "Argument[self].Reference.Field[core::pin::Pin::pointer].Field[alloc::boxed::Box(0)]", "ReturnValue.Reference", "value", "manual"] # Str - ["::as_str", "Argument[self]", "ReturnValue", "value", "manual"] - - ["::as_bytes", "Argument[self]", "ReturnValue", "value", "manual"] - - ["::parse", "Argument[self]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] - - ["::trim", "Argument[self]", "ReturnValue.Reference", "taint", "manual"] - - ["::to_string", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["::as_bytes", "Argument[self].Reference", "ReturnValue.Reference", "taint", "manual"] + - ["::parse", "Argument[self].Reference", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["::trim", "Argument[self].Reference", "ReturnValue.Reference", "taint", "manual"] + - ["::to_string", "Argument[self].Reference", "ReturnValue", "taint", "manual"] # Ord - ["<_ as core::cmp::Ord>::min", "Argument[self,0]", "ReturnValue", "value", "manual"] - ["<_ as core::cmp::Ord>::max", "Argument[self,0]", "ReturnValue", "value", "manual"] diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/fs.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/fs.model.yml index 8be4fdc05bf9..a4b9f576b88b 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/fs.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/fs.model.yml @@ -58,6 +58,7 @@ extensions: data: - ["std::fs::canonicalize", "Argument[0].OptionalStep[normalize-path]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] - ["std::fs::canonicalize", "Argument[0].OptionalBarrier[normalize-path]", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"] + - ["::deref", "Argument[self].Reference", "ReturnValue.Reference", "taint", "manual"] - ["::as_path", "Argument[self].Reference", "ReturnValue.Reference", "value", "manual"] - ["::as_mut_os_string", "Argument[Self].Reference", "ReturnValue.Reference", "value", "manual"] - ["::into_os_string", "Argument[Self]", "ReturnValue", "value", "manual"] diff --git a/rust/ql/lib/codeql/rust/internal/TypeInference.qll b/rust/ql/lib/codeql/rust/internal/TypeInference.qll index 5b0ed6873574..9cf0f5da6a3c 100644 --- a/rust/ql/lib/codeql/rust/internal/TypeInference.qll +++ b/rust/ql/lib/codeql/rust/internal/TypeInference.qll @@ -7,6 +7,7 @@ private import PathResolution private import Type private import Type as T private import TypeMention +private import typeinference.DerefChain private import typeinference.FunctionType private import typeinference.FunctionOverloading as FunctionOverloading private import typeinference.BlanketImplementation as BlanketImplementation @@ -1552,24 +1553,13 @@ private module MethodResolution { * Same as `getACandidateReceiverTypeAt`, but without borrows. */ pragma[nomagic] - private Type getACandidateReceiverTypeAtNoBorrow(string derefChain, TypePath path) { + Type getACandidateReceiverTypeAtNoBorrow(DerefChain derefChain, TypePath path) { result = this.getReceiverTypeAt(path) and derefChain = "" or - this.supportsAutoDerefAndBorrow() and - exists(TypePath path0, Type t0, string derefChain0 | - this.hasNoCompatibleTargetMutBorrow(derefChain0) and - t0 = this.getACandidateReceiverTypeAtNoBorrow(derefChain0, path0) - | - path0.isCons(getRefTypeParameter(_), path) and - result = t0 and - derefChain = derefChain0 + ".ref" - or - path0.isEmpty() and - path = path0 and - t0 = getStringStruct() and - result = getStrStruct() and - derefChain = derefChain0 + ".str" + exists(DerefImplItemNode impl, DerefChain suffix | + result = ImplicitDeref::getDereferencedCandidateReceiverType(this, impl, suffix, path) and + derefChain = DerefChain::cons(impl, suffix) ) } @@ -1583,7 +1573,7 @@ private module MethodResolution { */ pragma[nomagic] private predicate hasIncompatibleTarget( - ImplOrTraitItemNode i, string derefChain, BorrowKind borrow, Type root + ImplOrTraitItemNode i, DerefChain derefChain, BorrowKind borrow, Type root ) { exists(TypePath path | ReceiverIsInstantiationOfSelfParam::argIsNotInstantiationOf(MkMethodCallCand(this, @@ -1600,7 +1590,7 @@ private module MethodResolution { */ pragma[nomagic] private predicate hasIncompatibleBlanketLikeTarget( - ImplItemNode impl, string derefChain, BorrowKind borrow + ImplItemNode impl, DerefChain derefChain, BorrowKind borrow ) { ReceiverIsNotInstantiationOfBlanketLikeSelfParam::argIsNotInstantiationOf(MkMethodCallCand(this, derefChain, borrow), impl, _, _) @@ -1613,7 +1603,9 @@ private module MethodResolution { * Same as `getACandidateReceiverTypeAt`, but excludes pseudo types `!` and `unknown`. */ pragma[nomagic] - Type getANonPseudoCandidateReceiverTypeAt(string derefChain, BorrowKind borrow, TypePath path) { + Type getANonPseudoCandidateReceiverTypeAt( + DerefChain derefChain, BorrowKind borrow, TypePath path + ) { result = this.getACandidateReceiverTypeAt(derefChain, borrow, path) and result != TNeverType() and result != TUnknownType() @@ -1621,7 +1613,7 @@ private module MethodResolution { pragma[nomagic] private Type getComplexStrippedType( - string derefChain, BorrowKind borrow, TypePath strippedTypePath + DerefChain derefChain, BorrowKind borrow, TypePath strippedTypePath ) { result = this.getANonPseudoCandidateReceiverTypeAt(derefChain, borrow, strippedTypePath) and isComplexRootStripped(strippedTypePath, result) @@ -1629,7 +1621,7 @@ private module MethodResolution { bindingset[derefChain, borrow, strippedTypePath, strippedType] private predicate hasNoCompatibleNonBlanketLikeTargetCheck( - string derefChain, BorrowKind borrow, TypePath strippedTypePath, Type strippedType + DerefChain derefChain, BorrowKind borrow, TypePath strippedTypePath, Type strippedType ) { forall(ImplOrTraitItemNode i | methodCallNonBlanketCandidate(this, _, i, _, strippedTypePath, strippedType) @@ -1640,7 +1632,7 @@ private module MethodResolution { bindingset[derefChain, borrow, strippedTypePath, strippedType] private predicate hasNoCompatibleTargetCheck( - string derefChain, BorrowKind borrow, TypePath strippedTypePath, Type strippedType + DerefChain derefChain, BorrowKind borrow, TypePath strippedTypePath, Type strippedType ) { this.hasNoCompatibleNonBlanketLikeTargetCheck(derefChain, borrow, strippedTypePath, strippedType) and @@ -1651,7 +1643,7 @@ private module MethodResolution { bindingset[derefChain, borrow, strippedTypePath, strippedType] private predicate hasNoCompatibleNonBlanketTargetCheck( - string derefChain, BorrowKind borrow, TypePath strippedTypePath, Type strippedType + DerefChain derefChain, BorrowKind borrow, TypePath strippedTypePath, Type strippedType ) { this.hasNoCompatibleNonBlanketLikeTargetCheck(derefChain, borrow, strippedTypePath, strippedType) and @@ -1665,7 +1657,7 @@ private module MethodResolution { // forex using recursion pragma[nomagic] private predicate hasNoCompatibleTargetNoBorrowToIndex( - string derefChain, TypePath strippedTypePath, Type strippedType, int n + DerefChain derefChain, TypePath strippedTypePath, Type strippedType, int n ) { ( this.supportsAutoDerefAndBorrow() @@ -1688,7 +1680,7 @@ private module MethodResolution { * have a matching method target. */ pragma[nomagic] - predicate hasNoCompatibleTargetNoBorrow(string derefChain) { + predicate hasNoCompatibleTargetNoBorrow(DerefChain derefChain) { exists(Type strippedType | this.hasNoCompatibleTargetNoBorrowToIndex(derefChain, _, strippedType, getLastLookupTypeIndex(strippedType)) @@ -1698,7 +1690,7 @@ private module MethodResolution { // forex using recursion pragma[nomagic] private predicate hasNoCompatibleNonBlanketTargetNoBorrowToIndex( - string derefChain, TypePath strippedTypePath, Type strippedType, int n + DerefChain derefChain, TypePath strippedTypePath, Type strippedType, int n ) { ( this.supportsAutoDerefAndBorrow() @@ -1722,7 +1714,7 @@ private module MethodResolution { * a matching non-blanket method target. */ pragma[nomagic] - predicate hasNoCompatibleNonBlanketTargetNoBorrow(string derefChain) { + predicate hasNoCompatibleNonBlanketTargetNoBorrow(DerefChain derefChain) { exists(Type strippedType | this.hasNoCompatibleNonBlanketTargetNoBorrowToIndex(derefChain, _, strippedType, getLastLookupTypeIndex(strippedType)) @@ -1732,7 +1724,7 @@ private module MethodResolution { // forex using recursion pragma[nomagic] private predicate hasNoCompatibleTargetSharedBorrowToIndex( - string derefChain, TypePath strippedTypePath, Type strippedType, int n + DerefChain derefChain, TypePath strippedTypePath, Type strippedType, int n ) { this.hasNoCompatibleTargetNoBorrow(derefChain) and strippedType = @@ -1752,7 +1744,7 @@ private module MethodResolution { * by a shared borrow, does not have a matching method target. */ pragma[nomagic] - predicate hasNoCompatibleTargetSharedBorrow(string derefChain) { + predicate hasNoCompatibleTargetSharedBorrow(DerefChain derefChain) { exists(Type strippedType | this.hasNoCompatibleTargetSharedBorrowToIndex(derefChain, _, strippedType, getLastLookupTypeIndex(strippedType)) @@ -1762,7 +1754,7 @@ private module MethodResolution { // forex using recursion pragma[nomagic] private predicate hasNoCompatibleTargetMutBorrowToIndex( - string derefChain, TypePath strippedTypePath, Type strippedType, int n + DerefChain derefChain, TypePath strippedTypePath, Type strippedType, int n ) { this.hasNoCompatibleTargetSharedBorrow(derefChain) and strippedType = @@ -1781,7 +1773,7 @@ private module MethodResolution { * by a `mut` borrow, does not have a matching method target. */ pragma[nomagic] - predicate hasNoCompatibleTargetMutBorrow(string derefChain) { + predicate hasNoCompatibleTargetMutBorrow(DerefChain derefChain) { exists(Type strippedType | this.hasNoCompatibleTargetMutBorrowToIndex(derefChain, _, strippedType, getLastLookupTypeIndex(strippedType)) @@ -1791,7 +1783,7 @@ private module MethodResolution { // forex using recursion pragma[nomagic] private predicate hasNoCompatibleNonBlanketTargetSharedBorrowToIndex( - string derefChain, TypePath strippedTypePath, Type strippedType, int n + DerefChain derefChain, TypePath strippedTypePath, Type strippedType, int n ) { this.hasNoCompatibleTargetNoBorrow(derefChain) and strippedType = @@ -1811,7 +1803,7 @@ private module MethodResolution { * by a shared borrow, does not have a matching non-blanket method target. */ pragma[nomagic] - predicate hasNoCompatibleNonBlanketTargetSharedBorrow(string derefChain) { + predicate hasNoCompatibleNonBlanketTargetSharedBorrow(DerefChain derefChain) { exists(Type strippedType | this.hasNoCompatibleNonBlanketTargetSharedBorrowToIndex(derefChain, _, strippedType, getLastLookupTypeIndex(strippedType)) @@ -1821,7 +1813,7 @@ private module MethodResolution { // forex using recursion pragma[nomagic] private predicate hasNoCompatibleNonBlanketTargetMutBorrowToIndex( - string derefChain, TypePath strippedTypePath, Type strippedType, int n + DerefChain derefChain, TypePath strippedTypePath, Type strippedType, int n ) { this.hasNoCompatibleNonBlanketTargetSharedBorrow(derefChain) and strippedType = @@ -1841,7 +1833,7 @@ private module MethodResolution { * by a `mut` borrow, does not have a matching non-blanket method target. */ pragma[nomagic] - predicate hasNoCompatibleNonBlanketTargetMutBorrow(string derefChain) { + predicate hasNoCompatibleNonBlanketTargetMutBorrow(DerefChain derefChain) { exists(Type strippedType | this.hasNoCompatibleNonBlanketTargetMutBorrowToIndex(derefChain, _, strippedType, getLastLookupTypeIndex(strippedType)) @@ -1861,7 +1853,7 @@ private module MethodResolution { * [1]: https://doc.rust-lang.org/reference/expressions/method-call-expr.html#r-expr.method.candidate-receivers */ pragma[nomagic] - Type getACandidateReceiverTypeAt(string derefChain, BorrowKind borrow, TypePath path) { + Type getACandidateReceiverTypeAt(DerefChain derefChain, BorrowKind borrow, TypePath path) { result = this.getACandidateReceiverTypeAtNoBorrow(derefChain, path) and borrow.isNoBorrow() or @@ -1894,21 +1886,19 @@ private module MethodResolution { * `derefChain` and the enum `borrow`. */ pragma[nomagic] - Method resolveCallTarget(ImplOrTraitItemNode i, string derefChain, BorrowKind borrow) { + Method resolveCallTarget(ImplOrTraitItemNode i, DerefChain derefChain, BorrowKind borrow) { exists(MethodCallCand mcc | mcc = MkMethodCallCand(this, derefChain, borrow) and result = mcc.resolveCallTarget(i) ) } - predicate receiverHasImplicitDeref(AstNode receiver) { - exists(this.resolveCallTarget(_, ".ref", TNoBorrowKind())) and - receiver = this.getArg(any(ArgumentPosition pos | pos.isSelf())) - } - - predicate argumentHasImplicitBorrow(AstNode arg, boolean isMutable) { - exists(this.resolveCallTarget(_, "", TSomeBorrowKind(isMutable))) and - arg = this.getArg(any(ArgumentPosition pos | pos.isSelf())) + predicate argumentHasImplicitDerefChainBorrow( + AstNode arg, DerefChain derefChain, BorrowKind borrow + ) { + exists(this.resolveCallTarget(_, derefChain, borrow)) and + arg = this.getArg(any(ArgumentPosition pos | pos.isSelf())) and + (not derefChain.isEmpty() or borrow != TNoBorrowKind()) } } @@ -2046,10 +2036,14 @@ private module MethodResolution { result = inferType(this.getArg(pos), path) } - override predicate argumentHasImplicitBorrow(AstNode arg, boolean isMutable) { - exists(ArgumentPosition pos | + override predicate argumentHasImplicitDerefChainBorrow( + AstNode arg, DerefChain derefChain, BorrowKind borrow + ) { + exists(ArgumentPosition pos, boolean isMutable | this.implicitBorrowAt(pos, isMutable) and - arg = this.getArg(pos) + arg = this.getArg(pos) and + derefChain = DerefChain::nil() and + borrow = TSomeBorrowKind(isMutable) ) } @@ -2065,14 +2059,14 @@ private module MethodResolution { } private newtype TMethodCallCand = - MkMethodCallCand(MethodCall mc, string derefChain, BorrowKind borrow) { + MkMethodCallCand(MethodCall mc, DerefChain derefChain, BorrowKind borrow) { exists(mc.getACandidateReceiverTypeAt(derefChain, borrow, _)) } /** A method call with a dereference chain and a potential borrow. */ private class MethodCallCand extends MkMethodCallCand { MethodCall mc_; - string derefChain; + DerefChain derefChain; BorrowKind borrow; MethodCallCand() { this = MkMethodCallCand(mc_, derefChain, borrow) } @@ -2164,11 +2158,74 @@ private module MethodResolution { MethodArgsAreInstantiationsOf::argsAreInstantiationsOf(this, i, result) } - string toString() { result = mc_.toString() + " [" + derefChain + "; " + borrow + "]" } + string toString() { + result = mc_.toString() + " [" + derefChain.toString() + "; " + borrow + "]" + } Location getLocation() { result = mc_.getLocation() } } + private module ImplicitDeref { + private newtype TMethodCallDerefCand = + MkMethodCallDerefCand(MethodCall mc, DerefChain derefChain) { + mc.supportsAutoDerefAndBorrow() and + mc.hasNoCompatibleTargetMutBorrow(derefChain) and + exists(mc.getACandidateReceiverTypeAtNoBorrow(derefChain, _)) + } + + private class MethodCallDerefCand extends MkMethodCallDerefCand { + MethodCall mc; + DerefChain derefChain; + + MethodCallDerefCand() { this = MkMethodCallDerefCand(mc, derefChain) } + + Type getTypeAt(TypePath path) { + result = substituteLookupTraits(mc.getACandidateReceiverTypeAtNoBorrow(derefChain, path)) and + result != TNeverType() and + result != TUnknownType() + } + + string toString() { result = mc.toString() + " [" + derefChain.toString() + "]" } + + Location getLocation() { result = mc.getLocation() } + } + + private module MethodCallSatisfiesDerefConstraintInput implements + SatisfiesConstraintInputSig + { + pragma[nomagic] + predicate relevantConstraint(MethodCallDerefCand mc, Type constraint) { + exists(mc) and + constraint.(TraitType).getTrait() instanceof DerefTrait + } + + predicate useUniversalConditions() { none() } + } + + private module MethodCallSatisfiesDerefConstraint = + SatisfiesConstraint; + + pragma[nomagic] + private AssociatedTypeTypeParameter getDerefTargetTypeParameter() { + result.getTypeAlias() = any(DerefTrait ft).getTargetType() + } + + /** + * Gets the type of the receiver of `mc` at `path` after applying the implicit + * dereference inside `impl` following the existing dereference chain `derefChain`. + */ + pragma[nomagic] + Type getDereferencedCandidateReceiverType( + MethodCall mc, DerefImplItemNode impl, DerefChain derefChain, TypePath path + ) { + exists(MethodCallDerefCand mcc, TypePath exprPath | + mcc = MkMethodCallDerefCand(mc, derefChain) and + MethodCallSatisfiesDerefConstraint::satisfiesConstraintType(mcc, impl, _, exprPath, result) and + exprPath.isCons(getDerefTargetTypeParameter(), path) + ) + } + } + private module ReceiverSatisfiesBlanketLikeConstraintInput implements BlanketImplementation::SatisfiesBlanketConstraintInputSig { @@ -2395,10 +2452,21 @@ private module MethodCallMatchingInput implements MatchingWithEnvironmentInputSi class AccessEnvironment = string; bindingset[derefChain, borrow] - additional AccessEnvironment encodeDerefChainBorrow(string derefChain, BorrowKind borrow) { + private AccessEnvironment encodeDerefChainBorrow(DerefChain derefChain, BorrowKind borrow) { result = derefChain + ";" + borrow } + bindingset[derefChainBorrow] + additional predicate decodeDerefChainBorrow( + string derefChainBorrow, DerefChain derefChain, BorrowKind borrow + ) { + exists(string regexp | + regexp = "^(.*);(.*)$" and + derefChain = derefChainBorrow.regexpCapture(regexp, 1) and + borrow.toString() = derefChainBorrow.regexpCapture(regexp, 2) + ) + } + final private class MethodCallFinal = MethodResolution::MethodCall; class Access extends MethodCallFinal, ContextTyping::ContextTypedCallCand { @@ -2421,7 +2489,7 @@ private module MethodCallMatchingInput implements MatchingWithEnvironmentInputSi pragma[nomagic] private Type getInferredSelfType(AccessPosition apos, string derefChainBorrow, TypePath path) { - exists(string derefChain, BorrowKind borrow | + exists(DerefChain derefChain, BorrowKind borrow | result = this.getACandidateReceiverTypeAt(derefChain, borrow, path) and derefChainBorrow = encodeDerefChainBorrow(derefChain, borrow) and apos.isSelf() @@ -2457,7 +2525,7 @@ private module MethodCallMatchingInput implements MatchingWithEnvironmentInputSi } Method getTarget(ImplOrTraitItemNode i, string derefChainBorrow) { - exists(string derefChain, BorrowKind borrow | + exists(DerefChain derefChain, BorrowKind borrow | derefChainBorrow = encodeDerefChainBorrow(derefChain, borrow) and result = this.resolveCallTarget(i, derefChain, borrow) // mutual recursion; resolving method calls requires resolving types and vice versa ) @@ -2510,39 +2578,67 @@ private Type inferMethodCallType0( } pragma[nomagic] -private Type inferMethodCallType1(AstNode n, boolean isReturn, TypePath path) { +private Type inferMethodCallTypeNonSelf(AstNode n, boolean isReturn, TypePath path) { + exists(MethodCallMatchingInput::AccessPosition apos | + result = inferMethodCallType0(_, apos, n, _, path) and + not apos.isSelf() and + if apos.isReturn() then isReturn = true else isReturn = false + ) +} + +pragma[nomagic] +private Type inferMethodCallTypeSelf( + AstNode n, DerefChain derefChain, BorrowKind borrow, TypePath path +) { + exists(MethodCallMatchingInput::AccessPosition apos, string derefChainBorrow | + result = inferMethodCallType0(_, apos, n, derefChainBorrow, path) and + apos.isSelf() and + MethodCallMatchingInput::decodeDerefChainBorrow(derefChainBorrow, derefChain, borrow) + ) + or + // adjust for implicit borrow + exists(TypePath path0, BorrowKind borrow0 | + result = inferMethodCallTypeSelf(n, derefChain, borrow0, path0) and + path0.isCons(borrow0.getRefType().getPositionalTypeParameter(0), path) and + borrow.isNoBorrow() + ) + or + // adjust for implicit deref exists( - MethodCallMatchingInput::Access a, MethodCallMatchingInput::AccessPosition apos, - string derefChainBorrow, TypePath path0 + DerefChain derefChain0, Type t0, TypePath path0, DerefImplItemNode impl, Type selfType, + TypePath selfPath | - result = inferMethodCallType0(a, apos, n, derefChainBorrow, path0) and - if apos.isReturn() then isReturn = true else isReturn = false + t0 = inferMethodCallTypeSelf(n, derefChain0, borrow, path0) and + derefChain0.isCons(impl, derefChain) and + borrow.isNoBorrow() and + selfType = impl.resolveSelfParamTypeStrippedAt(selfPath) | - ( - not apos.isSelf() - or - derefChainBorrow = ";" - ) and - path = path0 + result = selfType and + path = selfPath and + not result instanceof TypeParameter or - // adjust for implicit deref - apos.isSelf() and - derefChainBorrow = MethodCallMatchingInput::encodeDerefChainBorrow(".ref", TNoBorrowKind()) and - path = TypePath::cons(getRefTypeParameter(_), path0) - or - // adjust for implicit borrow - apos.isSelf() and - derefChainBorrow = MethodCallMatchingInput::encodeDerefChainBorrow("", TSomeBorrowKind(_)) and - path0.isCons(getRefTypeParameter(_), path) + exists(TypeParameter tp, TypePath pathToTypeParam, TypePath suffix | + impl.returnTypeStrippedMentionsTypeParameterAt(tp, pathToTypeParam) and + path0 = pathToTypeParam.appendInverse(suffix) and + result = t0 and + path = selfPath.append(suffix) + ) ) } +private Type inferMethodCallTypePreCheck(AstNode n, boolean isReturn, TypePath path) { + result = inferMethodCallTypeNonSelf(n, isReturn, path) + or + result = inferMethodCallTypeSelf(n, DerefChain::nil(), TNoBorrowKind(), path) and + isReturn = false +} + /** * Gets the type of `n` at `path`, where `n` is either a method call or an * argument/receiver of a method call. */ private predicate inferMethodCallType = - ContextTyping::CheckContextTyping::check/2; + ContextTyping::CheckContextTyping::check/2; /** * Provides logic for resolving calls to non-method items. This includes @@ -3162,19 +3258,28 @@ private predicate inferOperationType = ContextTyping::CheckContextTyping::check/2; pragma[nomagic] -private Type getFieldExprLookupType(FieldExpr fe, string name, boolean isDereferenced) { +private Type getFieldExprLookupType(FieldExpr fe, string name, DerefChain derefChain) { exists(TypePath path | result = inferType(fe.getContainer(), path) and name = fe.getIdentifier().getText() and - isComplexRootStripped(path, result) and - if path.isEmpty() then isDereferenced = false else isDereferenced = true + isComplexRootStripped(path, result) + | + // TODO: Support full derefence chains as for method calls + path.isEmpty() and + derefChain = DerefChain::nil() + or + exists(DerefImplItemNode impl, TypeParamTypeParameter tp | + tp.getTypeParam() = impl.resolveSelfTy().getTypeParam(0) and + path.getHead() = tp and + derefChain = DerefChain::singleton(impl) + ) ) } pragma[nomagic] -private Type getTupleFieldExprLookupType(FieldExpr fe, int pos, boolean isDereferenced) { +private Type getTupleFieldExprLookupType(FieldExpr fe, int pos, DerefChain derefChain) { exists(string name | - result = getFieldExprLookupType(fe, name, isDereferenced) and + result = getFieldExprLookupType(fe, name, derefChain) and pos = name.toInt() ) } @@ -3376,9 +3481,6 @@ private Type inferTryExprType(TryExpr te, TypePath path) { pragma[nomagic] private StructType getStrStruct() { result = TStruct(any(Builtins::Str s)) } -pragma[nomagic] -private StructType getStringStruct() { result = TStruct(any(StringStruct s)) } - pragma[nomagic] private Type inferLiteralType(LiteralExpr le, TypePath path, boolean certain) { path.isEmpty() and @@ -3832,23 +3934,22 @@ private Type inferCastExprType(CastExpr ce, TypePath path) { cached private module Cached { - /** Holds if `n` is implicitly dereferenced. */ + /** Holds if `n` is implicitly dereferenced and/or borrowed. */ cached - predicate implicitDeref(AstNode n) { - any(MethodResolution::MethodCall mc).receiverHasImplicitDeref(n) + predicate implicitDerefChainBorrow(AstNode n, DerefChain derefChain, boolean borrow) { + exists(BorrowKind bk | + any(MethodResolution::MethodCall mc).argumentHasImplicitDerefChainBorrow(n, derefChain, bk) and + if bk.isNoBorrow() then borrow = false else borrow = true + ) or n = any(FieldExpr fe | - exists(resolveStructFieldExpr(fe, true)) + exists(resolveStructFieldExpr(fe, derefChain)) or - exists(resolveTupleFieldExpr(fe, true)) - ).getContainer() - } - - /** Holds if `n` is implicitly borrowed. */ - cached - predicate implicitBorrow(AstNode n, boolean isMutable) { - any(MethodResolution::MethodCall mc).argumentHasImplicitBorrow(n, isMutable) + exists(resolveTupleFieldExpr(fe, derefChain)) + ).getContainer() and + not derefChain.isEmpty() and + borrow = false } /** @@ -3878,9 +3979,9 @@ private module Cached { * Gets the struct field that the field expression `fe` resolves to, if any. */ cached - StructField resolveStructFieldExpr(FieldExpr fe, boolean isDereferenced) { + StructField resolveStructFieldExpr(FieldExpr fe, DerefChain derefChain) { exists(string name, Type ty | - ty = getFieldExprLookupType(fe, pragma[only_bind_into](name), isDereferenced) + ty = getFieldExprLookupType(fe, pragma[only_bind_into](name), derefChain) | result = ty.(StructType).getStruct().getStructField(pragma[only_bind_into](name)) or result = ty.(UnionType).getUnion().getStructField(pragma[only_bind_into](name)) @@ -3891,10 +3992,10 @@ private module Cached { * Gets the tuple field that the field expression `fe` resolves to, if any. */ cached - TupleField resolveTupleFieldExpr(FieldExpr fe, boolean isDereferenced) { + TupleField resolveTupleFieldExpr(FieldExpr fe, DerefChain derefChain) { exists(int i | result = - getTupleFieldExprLookupType(fe, pragma[only_bind_into](i), isDereferenced) + getTupleFieldExprLookupType(fe, pragma[only_bind_into](i), derefChain) .(StructType) .getStruct() .getTupleField(pragma[only_bind_into](i)) diff --git a/rust/ql/lib/codeql/rust/internal/typeinference/DerefChain.qll b/rust/ql/lib/codeql/rust/internal/typeinference/DerefChain.qll new file mode 100644 index 000000000000..5988a6b2309f --- /dev/null +++ b/rust/ql/lib/codeql/rust/internal/typeinference/DerefChain.qll @@ -0,0 +1,76 @@ +/** Provides classes for representing implicit dereferences. */ + +private import rust +private import codeql.rust.internal.PathResolution +private import codeql.rust.internal.Type +private import codeql.rust.internal.TypeInference +private import codeql.rust.internal.TypeMention +private import codeql.rust.frameworks.stdlib.Stdlib +private import codeql.rust.frameworks.stdlib.Builtins as Builtins +private import codeql.util.UnboundList as UnboundListImpl + +/** An `impl` block that implements the `Deref` trait. */ +class DerefImplItemNode extends ImplItemNode { + DerefImplItemNode() { this.resolveTraitTy() instanceof DerefTrait } + + /** Gets the `deref` function in this `Deref` impl block. */ + Function getDerefFunction() { result = this.getAssocItem("deref") } + + private SelfParam getSelfParam() { result = this.getDerefFunction().getSelfParam() } + + /** + * Resolves the type at `path` of the `self` parameter inside the `deref` function, + * stripped of the leading `&`. + */ + pragma[nomagic] + Type resolveSelfParamTypeStrippedAt(TypePath path) { + exists(TypePath path0 | + result = getSelfParamTypeMention(this.getSelfParam()).resolveTypeAt(path0) and + path0.isCons(getRefTypeParameter(false), path) + ) + } + + /** + * Holds if the return type at `path` of the `deref` function, stripped of the + * leading `&`, mentions type parameter `tp` at `path`. + */ + pragma[nomagic] + predicate returnTypeStrippedMentionsTypeParameterAt(TypeParameter tp, TypePath path) { + exists(TypePath path0 | + tp = getReturnTypeMention(this.getDerefFunction()).resolveTypeAt(path0) and + path0.isCons(getRefTypeParameter(false), path) + ) + } +} + +private module UnboundListInput implements UnboundListImpl::InputSig { + private import codeql.rust.elements.internal.generated.Raw + private import codeql.rust.elements.internal.generated.Synth + + private class DerefImplItemRaw extends Raw::Impl { + DerefImplItemRaw() { this = Synth::convertAstNodeToRaw(any(DerefImplItemNode i)) } + } + + private predicate id(DerefImplItemRaw x, DerefImplItemRaw y) { x = y } + + private predicate idOfRaw(DerefImplItemRaw x, int y) = equivalenceRelation(id/2)(x, y) + + class Element = DerefImplItemNode; + + int getId(Element e) { idOfRaw(Synth::convertAstNodeToRaw(e), result) } + + string getElementString(Element e) { result = e.resolveSelfTy().getName() } + + int getLengthLimit() { result = 5 } +} + +private import UnboundListImpl::Make + +/** + * A sequence of `Deref` impl blocks representing a chain of implicit dereferences, + * encoded as a string. + */ +class DerefChain = UnboundList; + +/** Provides predicates for constructing `DerefChain`s. */ +module DerefChain = UnboundList; diff --git a/rust/ql/test/library-tests/dataflow/global/inline-flow.expected b/rust/ql/test/library-tests/dataflow/global/inline-flow.expected index 343a33146d22..5665b3db4347 100644 --- a/rust/ql/test/library-tests/dataflow/global/inline-flow.expected +++ b/rust/ql/test/library-tests/dataflow/global/inline-flow.expected @@ -11,20 +11,19 @@ edges | main.rs:27:9:27:12 | [post] self [&ref, MyStruct] | main.rs:26:17:26:25 | SelfParam [Return] [&ref, MyStruct] | provenance | | | main.rs:27:21:27:21 | n | main.rs:27:9:27:12 | [post] self [&ref, MyStruct] | provenance | | | main.rs:30:17:30:21 | SelfParam [&ref, MyStruct] | main.rs:31:9:31:12 | self [&ref, MyStruct] | provenance | | -| main.rs:31:9:31:12 | self [&ref, MyStruct] | main.rs:31:9:31:17 | self.data | provenance | | +| main.rs:31:9:31:12 | self [&ref, MyStruct] | main.rs:31:9:31:17 | self.data | provenance | MaD:1 | | main.rs:31:9:31:17 | self.data | main.rs:30:31:32:5 | { ... } | provenance | | -| main.rs:38:6:38:11 | [post] &mut a [&ref, MyStruct] | main.rs:38:11:38:11 | [post] a [MyStruct] | provenance | | -| main.rs:38:11:38:11 | [post] a [MyStruct] | main.rs:39:10:39:10 | a [MyStruct] | provenance | | -| main.rs:38:23:38:31 | source(...) | main.rs:26:28:26:33 | ...: i64 | provenance | | -| main.rs:38:23:38:31 | source(...) | main.rs:38:6:38:11 | [post] &mut a [&ref, MyStruct] | provenance | | +| main.rs:38:5:38:5 | [post] a [MyStruct] | main.rs:39:10:39:10 | a [MyStruct] | provenance | | +| main.rs:38:16:38:24 | source(...) | main.rs:26:28:26:33 | ...: i64 | provenance | | +| main.rs:38:16:38:24 | source(...) | main.rs:38:5:38:5 | [post] a [MyStruct] | provenance | | | main.rs:39:10:39:10 | a [MyStruct] | main.rs:30:17:30:21 | SelfParam [&ref, MyStruct] | provenance | | -| main.rs:39:10:39:10 | a [MyStruct] | main.rs:39:10:39:21 | a.get_data() | provenance | | +| main.rs:39:10:39:10 | a [MyStruct] | main.rs:39:10:39:21 | a.get_data() | provenance | MaD:1 | | main.rs:46:9:46:14 | [post] &mut a [&ref, MyStruct] | main.rs:46:14:46:14 | [post] a [MyStruct] | provenance | | | main.rs:46:14:46:14 | [post] a [MyStruct] | main.rs:49:10:49:10 | a [MyStruct] | provenance | | | main.rs:48:15:48:23 | source(...) | main.rs:26:28:26:33 | ...: i64 | provenance | | | main.rs:48:15:48:23 | source(...) | main.rs:46:9:46:14 | [post] &mut a [&ref, MyStruct] | provenance | | | main.rs:49:10:49:10 | a [MyStruct] | main.rs:30:17:30:21 | SelfParam [&ref, MyStruct] | provenance | | -| main.rs:49:10:49:10 | a [MyStruct] | main.rs:49:10:49:21 | a.get_data() | provenance | | +| main.rs:49:10:49:10 | a [MyStruct] | main.rs:49:10:49:21 | a.get_data() | provenance | MaD:1 | | main.rs:52:12:52:17 | ...: i64 | main.rs:53:10:53:10 | n | provenance | | | main.rs:57:9:57:9 | a | main.rs:58:13:58:13 | a | provenance | | | main.rs:57:13:57:21 | source(...) | main.rs:57:9:57:9 | a | provenance | | @@ -167,6 +166,13 @@ edges | main.rs:292:13:292:14 | * ... | main.rs:292:9:292:9 | c | provenance | | | main.rs:292:14:292:14 | a [MyInt] | main.rs:251:14:251:18 | SelfParam [&ref, MyInt] | provenance | | | main.rs:292:14:292:14 | a [MyInt] | main.rs:292:13:292:14 | * ... | provenance | MaD:1 | +| main.rs:295:9:295:9 | a [MyInt] | main.rs:296:13:296:13 | a [MyInt] | provenance | | +| main.rs:295:13:295:39 | MyInt {...} [MyInt] | main.rs:295:9:295:9 | a [MyInt] | provenance | | +| main.rs:295:28:295:37 | source(...) | main.rs:295:13:295:39 | MyInt {...} [MyInt] | provenance | | +| main.rs:296:9:296:9 | c | main.rs:297:10:297:10 | c | provenance | | +| main.rs:296:13:296:13 | a [MyInt] | main.rs:251:14:251:18 | SelfParam [&ref, MyInt] | provenance | | +| main.rs:296:13:296:13 | a [MyInt] | main.rs:296:13:296:23 | a.min(...) | provenance | MaD:1 | +| main.rs:296:13:296:23 | a.min(...) | main.rs:296:9:296:9 | c | provenance | | | main.rs:309:18:309:21 | SelfParam [MyInt] | main.rs:309:48:311:5 | { ... } [MyInt] | provenance | | | main.rs:313:26:313:37 | ...: MyInt [MyInt] | main.rs:313:49:315:5 | { ... } [MyInt] | provenance | | | main.rs:319:9:319:9 | a [MyInt] | main.rs:321:50:321:50 | a [MyInt] | provenance | | @@ -233,9 +239,8 @@ nodes | main.rs:30:31:32:5 | { ... } | semmle.label | { ... } | | main.rs:31:9:31:12 | self [&ref, MyStruct] | semmle.label | self [&ref, MyStruct] | | main.rs:31:9:31:17 | self.data | semmle.label | self.data | -| main.rs:38:6:38:11 | [post] &mut a [&ref, MyStruct] | semmle.label | [post] &mut a [&ref, MyStruct] | -| main.rs:38:11:38:11 | [post] a [MyStruct] | semmle.label | [post] a [MyStruct] | -| main.rs:38:23:38:31 | source(...) | semmle.label | source(...) | +| main.rs:38:5:38:5 | [post] a [MyStruct] | semmle.label | [post] a [MyStruct] | +| main.rs:38:16:38:24 | source(...) | semmle.label | source(...) | | main.rs:39:10:39:10 | a [MyStruct] | semmle.label | a [MyStruct] | | main.rs:39:10:39:21 | a.get_data() | semmle.label | a.get_data() | | main.rs:46:9:46:14 | [post] &mut a [&ref, MyStruct] | semmle.label | [post] &mut a [&ref, MyStruct] | @@ -398,6 +403,13 @@ nodes | main.rs:292:13:292:14 | * ... | semmle.label | * ... | | main.rs:292:14:292:14 | a [MyInt] | semmle.label | a [MyInt] | | main.rs:293:10:293:10 | c | semmle.label | c | +| main.rs:295:9:295:9 | a [MyInt] | semmle.label | a [MyInt] | +| main.rs:295:13:295:39 | MyInt {...} [MyInt] | semmle.label | MyInt {...} [MyInt] | +| main.rs:295:28:295:37 | source(...) | semmle.label | source(...) | +| main.rs:296:9:296:9 | c | semmle.label | c | +| main.rs:296:13:296:13 | a [MyInt] | semmle.label | a [MyInt] | +| main.rs:296:13:296:23 | a.min(...) | semmle.label | a.min(...) | +| main.rs:297:10:297:10 | c | semmle.label | c | | main.rs:309:18:309:21 | SelfParam [MyInt] | semmle.label | SelfParam [MyInt] | | main.rs:309:48:311:5 | { ... } [MyInt] | semmle.label | { ... } [MyInt] | | main.rs:313:26:313:37 | ...: MyInt [MyInt] | semmle.label | ...: MyInt [MyInt] | @@ -459,7 +471,7 @@ nodes | main.rs:418:18:418:41 | ...::get_default(...) | semmle.label | ...::get_default(...) | | main.rs:419:14:419:15 | n5 | semmle.label | n5 | subpaths -| main.rs:38:23:38:31 | source(...) | main.rs:26:28:26:33 | ...: i64 | main.rs:26:17:26:25 | SelfParam [Return] [&ref, MyStruct] | main.rs:38:6:38:11 | [post] &mut a [&ref, MyStruct] | +| main.rs:38:16:38:24 | source(...) | main.rs:26:28:26:33 | ...: i64 | main.rs:26:17:26:25 | SelfParam [Return] [&ref, MyStruct] | main.rs:38:5:38:5 | [post] a [MyStruct] | | main.rs:39:10:39:10 | a [MyStruct] | main.rs:30:17:30:21 | SelfParam [&ref, MyStruct] | main.rs:30:31:32:5 | { ... } | main.rs:39:10:39:21 | a.get_data() | | main.rs:48:15:48:23 | source(...) | main.rs:26:28:26:33 | ...: i64 | main.rs:26:17:26:25 | SelfParam [Return] [&ref, MyStruct] | main.rs:46:9:46:14 | [post] &mut a [&ref, MyStruct] | | main.rs:49:10:49:10 | a [MyStruct] | main.rs:30:17:30:21 | SelfParam [&ref, MyStruct] | main.rs:30:31:32:5 | { ... } | main.rs:49:10:49:21 | a.get_data() | @@ -477,12 +489,14 @@ subpaths | main.rs:282:10:282:10 | b [MyInt] | main.rs:243:30:243:39 | ...: MyInt [MyInt] | main.rs:243:19:243:27 | SelfParam [Return] [&ref, MyInt] | main.rs:283:10:283:10 | a [MyInt] | | main.rs:288:27:288:28 | &a [&ref, MyInt] | main.rs:251:14:251:18 | SelfParam [&ref, MyInt] | main.rs:251:38:253:5 | { ... } [&ref] | main.rs:288:14:288:29 | ...::deref(...) [&ref] | | main.rs:292:14:292:14 | a [MyInt] | main.rs:251:14:251:18 | SelfParam [&ref, MyInt] | main.rs:251:38:253:5 | { ... } [&ref] | main.rs:292:13:292:14 | * ... | +| main.rs:296:13:296:13 | a [MyInt] | main.rs:251:14:251:18 | SelfParam [&ref, MyInt] | main.rs:251:38:253:5 | { ... } [&ref] | main.rs:296:13:296:23 | a.min(...) | | main.rs:321:50:321:50 | a [MyInt] | main.rs:309:18:309:21 | SelfParam [MyInt] | main.rs:309:48:311:5 | { ... } [MyInt] | main.rs:321:30:321:54 | ...::take_self(...) [MyInt] | | main.rs:326:55:326:55 | b [MyInt] | main.rs:313:26:313:37 | ...: MyInt [MyInt] | main.rs:313:49:315:5 | { ... } [MyInt] | main.rs:326:30:326:56 | ...::take_second(...) [MyInt] | testFailures +| main.rs:297:10:297:10 | c | Fixed missing result: hasValueFlow=29 | #select | main.rs:18:10:18:10 | a | main.rs:13:5:13:13 | source(...) | main.rs:18:10:18:10 | a | $@ | main.rs:13:5:13:13 | source(...) | source(...) | -| main.rs:39:10:39:21 | a.get_data() | main.rs:38:23:38:31 | source(...) | main.rs:39:10:39:21 | a.get_data() | $@ | main.rs:38:23:38:31 | source(...) | source(...) | +| main.rs:39:10:39:21 | a.get_data() | main.rs:38:16:38:24 | source(...) | main.rs:39:10:39:21 | a.get_data() | $@ | main.rs:38:16:38:24 | source(...) | source(...) | | main.rs:49:10:49:21 | a.get_data() | main.rs:48:15:48:23 | source(...) | main.rs:49:10:49:21 | a.get_data() | $@ | main.rs:48:15:48:23 | source(...) | source(...) | | main.rs:53:10:53:10 | n | main.rs:57:13:57:21 | source(...) | main.rs:53:10:53:10 | n | $@ | main.rs:57:13:57:21 | source(...) | source(...) | | main.rs:68:10:68:10 | b | main.rs:66:13:66:21 | source(...) | main.rs:68:10:68:10 | b | $@ | main.rs:66:13:66:21 | source(...) | source(...) | @@ -506,6 +520,7 @@ testFailures | main.rs:283:10:283:16 | a.value | main.rs:281:28:281:37 | source(...) | main.rs:283:10:283:16 | a.value | $@ | main.rs:281:28:281:37 | source(...) | source(...) | | main.rs:289:10:289:10 | c | main.rs:286:28:286:37 | source(...) | main.rs:289:10:289:10 | c | $@ | main.rs:286:28:286:37 | source(...) | source(...) | | main.rs:293:10:293:10 | c | main.rs:291:28:291:37 | source(...) | main.rs:293:10:293:10 | c | $@ | main.rs:291:28:291:37 | source(...) | source(...) | +| main.rs:297:10:297:10 | c | main.rs:295:28:295:37 | source(...) | main.rs:297:10:297:10 | c | $@ | main.rs:295:28:295:37 | source(...) | source(...) | | main.rs:322:10:322:10 | c | main.rs:319:28:319:36 | source(...) | main.rs:322:10:322:10 | c | $@ | main.rs:319:28:319:36 | source(...) | source(...) | | main.rs:327:10:327:10 | c | main.rs:325:28:325:37 | source(...) | main.rs:327:10:327:10 | c | $@ | main.rs:325:28:325:37 | source(...) | source(...) | | main.rs:337:10:337:10 | a | main.rs:336:13:336:21 | source(...) | main.rs:337:10:337:10 | a | $@ | main.rs:336:13:336:21 | source(...) | source(...) | diff --git a/rust/ql/test/library-tests/dataflow/global/main.rs b/rust/ql/test/library-tests/dataflow/global/main.rs index bd910c03b426..1ee7ed43e155 100644 --- a/rust/ql/test/library-tests/dataflow/global/main.rs +++ b/rust/ql/test/library-tests/dataflow/global/main.rs @@ -35,7 +35,7 @@ impl MyStruct { fn data_out_of_call_side_effect1() { let mut a = MyStruct { data: 0 }; sink(a.get_data()); - (&mut a).set_data(source(8)); + a.set_data(source(8)); sink(a.get_data()); // $ hasValueFlow=8 } diff --git a/rust/ql/test/library-tests/dataflow/global/viableCallable.expected b/rust/ql/test/library-tests/dataflow/global/viableCallable.expected index d90eebdf5e51..e98f30cea4e7 100644 --- a/rust/ql/test/library-tests/dataflow/global/viableCallable.expected +++ b/rust/ql/test/library-tests/dataflow/global/viableCallable.expected @@ -2,10 +2,12 @@ | main.rs:13:5:13:13 | source(...) | main.rs:1:1:3:1 | fn source | | main.rs:17:13:17:23 | get_data(...) | main.rs:12:1:14:1 | fn get_data | | main.rs:18:5:18:11 | sink(...) | main.rs:5:1:7:1 | fn sink | +| main.rs:27:9:27:12 | [implicit deref call 0 in RefMut] self | {EXTERNAL LOCATION} | fn deref | +| main.rs:31:9:31:12 | [implicit deref call 0 in Ref] self | {EXTERNAL LOCATION} | fn deref | | main.rs:37:5:37:22 | sink(...) | main.rs:5:1:7:1 | fn sink | | main.rs:37:10:37:21 | a.get_data() | main.rs:30:5:32:5 | fn get_data | -| main.rs:38:5:38:32 | ... .set_data(...) | main.rs:26:5:28:5 | fn set_data | -| main.rs:38:23:38:31 | source(...) | main.rs:1:1:3:1 | fn source | +| main.rs:38:5:38:25 | a.set_data(...) | main.rs:26:5:28:5 | fn set_data | +| main.rs:38:16:38:24 | source(...) | main.rs:1:1:3:1 | fn source | | main.rs:39:5:39:22 | sink(...) | main.rs:5:1:7:1 | fn sink | | main.rs:39:10:39:21 | a.get_data() | main.rs:30:5:32:5 | fn get_data | | main.rs:44:5:48:24 | ... .set_data(...) | main.rs:26:5:28:5 | fn set_data | @@ -60,6 +62,7 @@ | main.rs:228:13:228:34 | ...::new(...) | main.rs:221:5:224:5 | fn new | | main.rs:228:24:228:33 | source(...) | main.rs:1:1:3:1 | fn source | | main.rs:230:5:230:11 | sink(...) | main.rs:5:1:7:1 | fn sink | +| main.rs:244:9:244:12 | [implicit deref call 0 in RefMut] self | {EXTERNAL LOCATION} | fn deref | | main.rs:252:11:252:15 | * ... | {EXTERNAL LOCATION} | fn deref | | main.rs:258:28:258:36 | source(...) | main.rs:1:1:3:1 | fn source | | main.rs:260:13:260:17 | ... + ... | main.rs:236:5:239:5 | fn add | @@ -84,6 +87,8 @@ | main.rs:292:13:292:14 | * ... | main.rs:251:5:253:5 | fn deref | | main.rs:293:5:293:11 | sink(...) | main.rs:5:1:7:1 | fn sink | | main.rs:295:28:295:37 | source(...) | main.rs:1:1:3:1 | fn source | +| main.rs:296:13:296:13 | [implicit deref call 0 in MyInt] a | main.rs:251:5:253:5 | fn deref | +| main.rs:296:13:296:23 | a.min(...) | {EXTERNAL LOCATION} | fn min | | main.rs:297:5:297:11 | sink(...) | main.rs:5:1:7:1 | fn sink | | main.rs:319:28:319:36 | source(...) | main.rs:1:1:3:1 | fn source | | main.rs:321:30:321:54 | ...::take_self(...) | main.rs:309:5:311:5 | fn take_self | diff --git a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected index d607e5fe31cb..c0c8764bb4f7 100644 --- a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected +++ b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected @@ -826,7 +826,7 @@ localStep readStep | main.rs:50:9:50:15 | Some(...) | {EXTERNAL LOCATION} | Some | main.rs:50:14:50:14 | _ | | main.rs:116:10:116:11 | * ... [pre-dereferenced] | file://:0:0:0:0 | &ref | main.rs:116:10:116:11 | * ... | -| main.rs:116:11:116:11 | [post] i [borrowed] | file://:0:0:0:0 | &ref | main.rs:116:11:116:11 | [post] i | +| main.rs:116:11:116:11 | [post] i [implicit borrow] | file://:0:0:0:0 | &ref | main.rs:116:11:116:11 | [post] i | | main.rs:124:10:124:10 | a | file://:0:0:0:0 | tuple.0 | main.rs:124:10:124:12 | a.0 | | main.rs:125:10:125:10 | a | file://:0:0:0:0 | tuple.1 | main.rs:125:10:125:12 | a.1 | | main.rs:130:9:130:20 | TuplePat | file://:0:0:0:0 | tuple.0 | main.rs:130:10:130:11 | a0 | @@ -904,62 +904,71 @@ readStep | main.rs:418:28:418:43 | D {...} | main.rs:385:9:385:20 | D | main.rs:418:41:418:41 | n | | main.rs:421:9:421:24 | C {...} | main.rs:384:9:384:20 | C | main.rs:421:22:421:22 | n | | main.rs:422:9:422:24 | D {...} | main.rs:385:9:385:20 | D | main.rs:422:22:422:22 | n | -| main.rs:431:14:431:17 | [post] arr1 [borrowed] | file://:0:0:0:0 | &ref | main.rs:431:14:431:17 | [post] arr1 | +| main.rs:431:14:431:17 | [post] arr1 [implicit borrow] | file://:0:0:0:0 | &ref | main.rs:431:14:431:17 | [post] arr1 | | main.rs:431:14:431:20 | arr1[2] [pre-dereferenced] | file://:0:0:0:0 | &ref | main.rs:431:14:431:20 | arr1[2] | -| main.rs:435:14:435:17 | [post] arr2 [borrowed] | file://:0:0:0:0 | &ref | main.rs:435:14:435:17 | [post] arr2 | +| main.rs:435:14:435:17 | [post] arr2 [implicit borrow] | file://:0:0:0:0 | &ref | main.rs:435:14:435:17 | [post] arr2 | | main.rs:435:14:435:20 | arr2[4] [pre-dereferenced] | file://:0:0:0:0 | &ref | main.rs:435:14:435:20 | arr2[4] | -| main.rs:439:14:439:17 | [post] arr3 [borrowed] | file://:0:0:0:0 | &ref | main.rs:439:14:439:17 | [post] arr3 | +| main.rs:439:14:439:17 | [post] arr3 [implicit borrow] | file://:0:0:0:0 | &ref | main.rs:439:14:439:17 | [post] arr3 | | main.rs:439:14:439:20 | arr3[2] [pre-dereferenced] | file://:0:0:0:0 | &ref | main.rs:439:14:439:20 | arr3[2] | | main.rs:445:15:445:18 | arr1 | file://:0:0:0:0 | element | main.rs:445:9:445:10 | n1 | | main.rs:450:15:450:18 | arr2 | file://:0:0:0:0 | element | main.rs:450:9:450:10 | n2 | | main.rs:458:9:458:17 | SlicePat | file://:0:0:0:0 | element | main.rs:458:10:458:10 | a | | main.rs:458:9:458:17 | SlicePat | file://:0:0:0:0 | element | main.rs:458:13:458:13 | b | | main.rs:458:9:458:17 | SlicePat | file://:0:0:0:0 | element | main.rs:458:16:458:16 | c | -| main.rs:468:10:468:16 | [post] mut_arr [borrowed] | file://:0:0:0:0 | &ref | main.rs:468:10:468:16 | [post] mut_arr | +| main.rs:468:10:468:16 | [post] mut_arr [implicit borrow] | file://:0:0:0:0 | &ref | main.rs:468:10:468:16 | [post] mut_arr | | main.rs:468:10:468:19 | mut_arr[1] [pre-dereferenced] | file://:0:0:0:0 | &ref | main.rs:468:10:468:19 | mut_arr[1] | -| main.rs:470:5:470:11 | [post] mut_arr [borrowed] | file://:0:0:0:0 | &ref | main.rs:470:5:470:11 | [post] mut_arr | +| main.rs:470:5:470:11 | [post] mut_arr [implicit borrow] | file://:0:0:0:0 | &ref | main.rs:470:5:470:11 | [post] mut_arr | | main.rs:470:5:470:14 | mut_arr[1] [pre-dereferenced] | file://:0:0:0:0 | &ref | main.rs:470:5:470:14 | mut_arr[1] | -| main.rs:471:13:471:19 | [post] mut_arr [borrowed] | file://:0:0:0:0 | &ref | main.rs:471:13:471:19 | [post] mut_arr | +| main.rs:471:13:471:19 | [post] mut_arr [implicit borrow] | file://:0:0:0:0 | &ref | main.rs:471:13:471:19 | [post] mut_arr | | main.rs:471:13:471:22 | mut_arr[1] [pre-dereferenced] | file://:0:0:0:0 | &ref | main.rs:471:13:471:22 | mut_arr[1] | -| main.rs:473:10:473:16 | [post] mut_arr [borrowed] | file://:0:0:0:0 | &ref | main.rs:473:10:473:16 | [post] mut_arr | +| main.rs:473:10:473:16 | [post] mut_arr [implicit borrow] | file://:0:0:0:0 | &ref | main.rs:473:10:473:16 | [post] mut_arr | | main.rs:473:10:473:19 | mut_arr[0] [pre-dereferenced] | file://:0:0:0:0 | &ref | main.rs:473:10:473:19 | mut_arr[0] | -| main.rs:479:24:479:33 | [post] source(...) [borrowed] | file://:0:0:0:0 | &ref | main.rs:479:24:479:33 | [post] source(...) | +| main.rs:479:24:479:33 | [post] source(...) [implicit borrow] | file://:0:0:0:0 | &ref | main.rs:479:24:479:33 | [post] source(...) | | main.rs:480:9:480:20 | TuplePat | file://:0:0:0:0 | tuple.0 | main.rs:480:10:480:13 | cond | | main.rs:480:9:480:20 | TuplePat | file://:0:0:0:0 | tuple.1 | main.rs:480:16:480:19 | name | | main.rs:480:25:480:29 | names | file://:0:0:0:0 | element | main.rs:480:9:480:20 | TuplePat | | main.rs:482:41:482:67 | [post] \|...\| ... | main.rs:479:9:479:20 | captured default_name | main.rs:482:41:482:67 | [post] default_name | -| main.rs:482:44:482:55 | [post] default_name [borrowed] | file://:0:0:0:0 | &ref | main.rs:482:44:482:55 | [post] default_name | +| main.rs:482:44:482:55 | [post] default_name [implicit borrow] | file://:0:0:0:0 | &ref | main.rs:482:44:482:55 | [post] default_name | +| main.rs:482:44:482:55 | [post] default_name [implicit borrow] | file://:0:0:0:0 | &ref | main.rs:482:44:482:55 | [post] default_name [implicit deref 0 in state after deref] | +| main.rs:482:44:482:55 | [post] default_name [implicit deref 0 in state borrow] | file://:0:0:0:0 | &ref | main.rs:482:44:482:55 | [post] default_name | +| main.rs:482:44:482:55 | default_name [implicit deref 0 in state before deref] | file://:0:0:0:0 | &ref | main.rs:482:44:482:55 | default_name [implicit deref 0 in state after deref] | | main.rs:482:44:482:55 | this | main.rs:479:9:479:20 | captured default_name | main.rs:482:44:482:55 | default_name | -| main.rs:483:18:483:18 | [post] n [borrowed] | file://:0:0:0:0 | &ref | main.rs:483:18:483:18 | [post] n | -| main.rs:506:13:506:13 | [post] a [borrowed] | file://:0:0:0:0 | &ref | main.rs:506:13:506:13 | [post] a | -| main.rs:519:10:519:11 | [post] vs [borrowed] | file://:0:0:0:0 | &ref | main.rs:519:10:519:11 | [post] vs | +| main.rs:483:18:483:18 | [post] n [implicit borrow] | file://:0:0:0:0 | &ref | main.rs:483:18:483:18 | [post] n | +| main.rs:506:13:506:13 | [post] a [implicit borrow] | file://:0:0:0:0 | &ref | main.rs:506:13:506:13 | [post] a | +| main.rs:507:13:507:13 | [post] b [implicit borrow] | file://:0:0:0:0 | &ref | main.rs:507:13:507:13 | [post] b [implicit deref 0 in state after deref] | +| main.rs:507:13:507:13 | [post] b [implicit deref 0 in state borrow] | file://:0:0:0:0 | &ref | main.rs:507:13:507:13 | [post] b | +| main.rs:507:13:507:13 | b [implicit deref 0 in state before deref] | file://:0:0:0:0 | &ref | main.rs:507:13:507:13 | b [implicit deref 0 in state after deref] | +| main.rs:508:18:508:18 | [post] b [implicit borrow] | file://:0:0:0:0 | &ref | main.rs:508:18:508:18 | [post] b [implicit deref 0 in state after deref] | +| main.rs:508:18:508:18 | [post] b [implicit deref 0 in state borrow] | file://:0:0:0:0 | &ref | main.rs:508:18:508:18 | [post] b | +| main.rs:508:18:508:18 | b [implicit deref 0 in state before deref] | file://:0:0:0:0 | &ref | main.rs:508:18:508:18 | b [implicit deref 0 in state after deref] | +| main.rs:519:10:519:11 | [post] vs [implicit borrow] | file://:0:0:0:0 | &ref | main.rs:519:10:519:11 | [post] vs | | main.rs:519:10:519:14 | vs[0] [pre-dereferenced] | file://:0:0:0:0 | &ref | main.rs:519:10:519:14 | vs[0] | | main.rs:520:10:520:35 | * ... [pre-dereferenced] | file://:0:0:0:0 | &ref | main.rs:520:10:520:35 | * ... | -| main.rs:520:11:520:35 | [post] ... .unwrap() [borrowed] | file://:0:0:0:0 | &ref | main.rs:520:11:520:35 | [post] ... .unwrap() | +| main.rs:520:11:520:35 | [post] ... .unwrap() [implicit borrow] | file://:0:0:0:0 | &ref | main.rs:520:11:520:35 | [post] ... .unwrap() | | main.rs:521:10:521:35 | * ... [pre-dereferenced] | file://:0:0:0:0 | &ref | main.rs:521:10:521:35 | * ... | -| main.rs:521:11:521:35 | [post] ... .unwrap() [borrowed] | file://:0:0:0:0 | &ref | main.rs:521:11:521:35 | [post] ... .unwrap() | +| main.rs:521:11:521:35 | [post] ... .unwrap() [implicit borrow] | file://:0:0:0:0 | &ref | main.rs:521:11:521:35 | [post] ... .unwrap() | | main.rs:523:14:523:15 | vs | file://:0:0:0:0 | element | main.rs:523:9:523:9 | v | | main.rs:526:9:526:10 | &... | file://:0:0:0:0 | &ref | main.rs:526:10:526:10 | v | | main.rs:526:15:526:23 | vs.iter() | file://:0:0:0:0 | element | main.rs:526:9:526:10 | &... | | main.rs:531:9:531:10 | &... | file://:0:0:0:0 | &ref | main.rs:531:10:531:10 | v | | main.rs:531:15:531:17 | vs2 | file://:0:0:0:0 | element | main.rs:531:9:531:10 | &... | | main.rs:535:28:535:29 | * ... [pre-dereferenced] | file://:0:0:0:0 | &ref | main.rs:535:28:535:29 | * ... | -| main.rs:535:29:535:29 | [post] x [borrowed] | file://:0:0:0:0 | &ref | main.rs:535:29:535:29 | [post] x | +| main.rs:535:29:535:29 | [post] x [implicit borrow] | file://:0:0:0:0 | &ref | main.rs:535:29:535:29 | [post] x | | main.rs:536:33:536:34 | * ... [pre-dereferenced] | file://:0:0:0:0 | &ref | main.rs:536:33:536:34 | * ... | -| main.rs:536:34:536:34 | [post] x [borrowed] | file://:0:0:0:0 | &ref | main.rs:536:34:536:34 | [post] x | +| main.rs:536:34:536:34 | [post] x [implicit borrow] | file://:0:0:0:0 | &ref | main.rs:536:34:536:34 | [post] x | | main.rs:538:14:538:27 | vs.into_iter() | file://:0:0:0:0 | element | main.rs:538:9:538:9 | v | -| main.rs:544:10:544:15 | [post] vs_mut [borrowed] | file://:0:0:0:0 | &ref | main.rs:544:10:544:15 | [post] vs_mut | +| main.rs:544:10:544:15 | [post] vs_mut [implicit borrow] | file://:0:0:0:0 | &ref | main.rs:544:10:544:15 | [post] vs_mut | | main.rs:544:10:544:18 | vs_mut[0] [pre-dereferenced] | file://:0:0:0:0 | &ref | main.rs:544:10:544:18 | vs_mut[0] | | main.rs:545:10:545:39 | * ... [pre-dereferenced] | file://:0:0:0:0 | &ref | main.rs:545:10:545:39 | * ... | -| main.rs:545:11:545:39 | [post] ... .unwrap() [borrowed] | file://:0:0:0:0 | &ref | main.rs:545:11:545:39 | [post] ... .unwrap() | +| main.rs:545:11:545:39 | [post] ... .unwrap() [implicit borrow] | file://:0:0:0:0 | &ref | main.rs:545:11:545:39 | [post] ... .unwrap() | | main.rs:546:10:546:39 | * ... [pre-dereferenced] | file://:0:0:0:0 | &ref | main.rs:546:10:546:39 | * ... | -| main.rs:546:11:546:39 | [post] ... .unwrap() [borrowed] | file://:0:0:0:0 | &ref | main.rs:546:11:546:39 | [post] ... .unwrap() | +| main.rs:546:11:546:39 | [post] ... .unwrap() [implicit borrow] | file://:0:0:0:0 | &ref | main.rs:546:11:546:39 | [post] ... .unwrap() | | main.rs:548:9:548:14 | &mut ... | file://:0:0:0:0 | &ref | main.rs:548:14:548:14 | v | | main.rs:548:19:548:35 | vs_mut.iter_mut() | file://:0:0:0:0 | element | main.rs:548:9:548:14 | &mut ... | | main.rs:562:10:562:15 | * ... [pre-dereferenced] | file://:0:0:0:0 | &ref | main.rs:562:10:562:15 | * ... | -| main.rs:562:11:562:15 | [post] c_ref [borrowed] | file://:0:0:0:0 | &ref | main.rs:562:11:562:15 | [post] c_ref | +| main.rs:562:11:562:15 | [post] c_ref [implicit borrow] | file://:0:0:0:0 | &ref | main.rs:562:11:562:15 | [post] c_ref | storeStep -| main.rs:116:11:116:11 | i | file://:0:0:0:0 | &ref | main.rs:116:11:116:11 | i [borrowed] | +| main.rs:116:11:116:11 | i | file://:0:0:0:0 | &ref | main.rs:116:11:116:11 | i [implicit borrow] | | main.rs:123:14:123:22 | source(...) | file://:0:0:0:0 | tuple.0 | main.rs:123:13:123:26 | TupleExpr | | main.rs:123:25:123:25 | 2 | file://:0:0:0:0 | tuple.1 | main.rs:123:13:123:26 | TupleExpr | | main.rs:129:14:129:14 | 2 | file://:0:0:0:0 | tuple.0 | main.rs:129:13:129:30 | TupleExpr | @@ -1021,13 +1030,13 @@ storeStep | main.rs:430:17:430:17 | 1 | file://:0:0:0:0 | element | main.rs:430:16:430:33 | [...] | | main.rs:430:20:430:20 | 2 | file://:0:0:0:0 | element | main.rs:430:16:430:33 | [...] | | main.rs:430:23:430:32 | source(...) | file://:0:0:0:0 | element | main.rs:430:16:430:33 | [...] | -| main.rs:431:14:431:17 | arr1 | file://:0:0:0:0 | &ref | main.rs:431:14:431:17 | arr1 [borrowed] | +| main.rs:431:14:431:17 | arr1 | file://:0:0:0:0 | &ref | main.rs:431:14:431:17 | arr1 [implicit borrow] | | main.rs:434:17:434:26 | source(...) | file://:0:0:0:0 | element | main.rs:434:16:434:31 | [...; 10] | -| main.rs:435:14:435:17 | arr2 | file://:0:0:0:0 | &ref | main.rs:435:14:435:17 | arr2 [borrowed] | +| main.rs:435:14:435:17 | arr2 | file://:0:0:0:0 | &ref | main.rs:435:14:435:17 | arr2 [implicit borrow] | | main.rs:438:17:438:17 | 1 | file://:0:0:0:0 | element | main.rs:438:16:438:24 | [...] | | main.rs:438:20:438:20 | 2 | file://:0:0:0:0 | element | main.rs:438:16:438:24 | [...] | | main.rs:438:23:438:23 | 3 | file://:0:0:0:0 | element | main.rs:438:16:438:24 | [...] | -| main.rs:439:14:439:17 | arr3 | file://:0:0:0:0 | &ref | main.rs:439:14:439:17 | arr3 [borrowed] | +| main.rs:439:14:439:17 | arr3 | file://:0:0:0:0 | &ref | main.rs:439:14:439:17 | arr3 [implicit borrow] | | main.rs:444:17:444:17 | 1 | file://:0:0:0:0 | element | main.rs:444:16:444:33 | [...] | | main.rs:444:20:444:20 | 2 | file://:0:0:0:0 | element | main.rs:444:16:444:33 | [...] | | main.rs:444:23:444:32 | source(...) | file://:0:0:0:0 | element | main.rs:444:16:444:33 | [...] | @@ -1040,34 +1049,40 @@ storeStep | main.rs:467:24:467:24 | 1 | file://:0:0:0:0 | element | main.rs:467:23:467:31 | [...] | | main.rs:467:27:467:27 | 2 | file://:0:0:0:0 | element | main.rs:467:23:467:31 | [...] | | main.rs:467:30:467:30 | 3 | file://:0:0:0:0 | element | main.rs:467:23:467:31 | [...] | -| main.rs:468:10:468:16 | mut_arr | file://:0:0:0:0 | &ref | main.rs:468:10:468:16 | mut_arr [borrowed] | -| main.rs:470:5:470:11 | mut_arr | file://:0:0:0:0 | &ref | main.rs:470:5:470:11 | mut_arr [borrowed] | +| main.rs:468:10:468:16 | mut_arr | file://:0:0:0:0 | &ref | main.rs:468:10:468:16 | mut_arr [implicit borrow] | +| main.rs:470:5:470:11 | mut_arr | file://:0:0:0:0 | &ref | main.rs:470:5:470:11 | mut_arr [implicit borrow] | | main.rs:470:18:470:27 | source(...) | file://:0:0:0:0 | &ref | main.rs:470:5:470:14 | [post] mut_arr[1] [pre-dereferenced] | | main.rs:470:18:470:27 | source(...) | file://:0:0:0:0 | element | main.rs:470:5:470:11 | [post] mut_arr | -| main.rs:471:13:471:19 | mut_arr | file://:0:0:0:0 | &ref | main.rs:471:13:471:19 | mut_arr [borrowed] | -| main.rs:473:10:473:16 | mut_arr | file://:0:0:0:0 | &ref | main.rs:473:10:473:16 | mut_arr [borrowed] | -| main.rs:479:24:479:33 | source(...) | file://:0:0:0:0 | &ref | main.rs:479:24:479:33 | source(...) [borrowed] | +| main.rs:471:13:471:19 | mut_arr | file://:0:0:0:0 | &ref | main.rs:471:13:471:19 | mut_arr [implicit borrow] | +| main.rs:473:10:473:16 | mut_arr | file://:0:0:0:0 | &ref | main.rs:473:10:473:16 | mut_arr [implicit borrow] | +| main.rs:479:24:479:33 | source(...) | file://:0:0:0:0 | &ref | main.rs:479:24:479:33 | source(...) [implicit borrow] | | main.rs:482:41:482:67 | default_name | main.rs:479:9:479:20 | captured default_name | main.rs:482:41:482:67 | \|...\| ... | -| main.rs:482:44:482:55 | default_name | file://:0:0:0:0 | &ref | main.rs:482:44:482:55 | default_name [borrowed] | -| main.rs:483:18:483:18 | n | file://:0:0:0:0 | &ref | main.rs:483:18:483:18 | n [borrowed] | -| main.rs:506:13:506:13 | a | file://:0:0:0:0 | &ref | main.rs:506:13:506:13 | a [borrowed] | +| main.rs:482:44:482:55 | default_name | file://:0:0:0:0 | &ref | main.rs:482:44:482:55 | default_name [implicit borrow] | +| main.rs:482:44:482:55 | default_name | file://:0:0:0:0 | &ref | main.rs:482:44:482:55 | default_name [implicit deref 0 in state borrow] | +| main.rs:482:44:482:55 | default_name [implicit deref 0 in state after deref] | file://:0:0:0:0 | &ref | main.rs:482:44:482:55 | default_name [implicit borrow] | +| main.rs:483:18:483:18 | n | file://:0:0:0:0 | &ref | main.rs:483:18:483:18 | n [implicit borrow] | +| main.rs:506:13:506:13 | a | file://:0:0:0:0 | &ref | main.rs:506:13:506:13 | a [implicit borrow] | +| main.rs:507:13:507:13 | b | file://:0:0:0:0 | &ref | main.rs:507:13:507:13 | b [implicit deref 0 in state borrow] | +| main.rs:507:13:507:13 | b [implicit deref 0 in state after deref] | file://:0:0:0:0 | &ref | main.rs:507:13:507:13 | b [implicit borrow] | +| main.rs:508:18:508:18 | b | file://:0:0:0:0 | &ref | main.rs:508:18:508:18 | b [implicit deref 0 in state borrow] | +| main.rs:508:18:508:18 | b [implicit deref 0 in state after deref] | file://:0:0:0:0 | &ref | main.rs:508:18:508:18 | b [implicit borrow] | | main.rs:517:15:517:24 | source(...) | file://:0:0:0:0 | element | main.rs:517:14:517:34 | [...] | | main.rs:517:27:517:27 | 2 | file://:0:0:0:0 | element | main.rs:517:14:517:34 | [...] | | main.rs:517:30:517:30 | 3 | file://:0:0:0:0 | element | main.rs:517:14:517:34 | [...] | | main.rs:517:33:517:33 | 4 | file://:0:0:0:0 | element | main.rs:517:14:517:34 | [...] | -| main.rs:519:10:519:11 | vs | file://:0:0:0:0 | &ref | main.rs:519:10:519:11 | vs [borrowed] | -| main.rs:520:11:520:35 | ... .unwrap() | file://:0:0:0:0 | &ref | main.rs:520:11:520:35 | ... .unwrap() [borrowed] | -| main.rs:521:11:521:35 | ... .unwrap() | file://:0:0:0:0 | &ref | main.rs:521:11:521:35 | ... .unwrap() [borrowed] | -| main.rs:535:29:535:29 | x | file://:0:0:0:0 | &ref | main.rs:535:29:535:29 | x [borrowed] | -| main.rs:536:34:536:34 | x | file://:0:0:0:0 | &ref | main.rs:536:34:536:34 | x [borrowed] | +| main.rs:519:10:519:11 | vs | file://:0:0:0:0 | &ref | main.rs:519:10:519:11 | vs [implicit borrow] | +| main.rs:520:11:520:35 | ... .unwrap() | file://:0:0:0:0 | &ref | main.rs:520:11:520:35 | ... .unwrap() [implicit borrow] | +| main.rs:521:11:521:35 | ... .unwrap() | file://:0:0:0:0 | &ref | main.rs:521:11:521:35 | ... .unwrap() [implicit borrow] | +| main.rs:535:29:535:29 | x | file://:0:0:0:0 | &ref | main.rs:535:29:535:29 | x [implicit borrow] | +| main.rs:536:34:536:34 | x | file://:0:0:0:0 | &ref | main.rs:536:34:536:34 | x [implicit borrow] | | main.rs:542:23:542:32 | source(...) | file://:0:0:0:0 | element | main.rs:542:22:542:42 | [...] | | main.rs:542:35:542:35 | 2 | file://:0:0:0:0 | element | main.rs:542:22:542:42 | [...] | | main.rs:542:38:542:38 | 3 | file://:0:0:0:0 | element | main.rs:542:22:542:42 | [...] | | main.rs:542:41:542:41 | 4 | file://:0:0:0:0 | element | main.rs:542:22:542:42 | [...] | -| main.rs:544:10:544:15 | vs_mut | file://:0:0:0:0 | &ref | main.rs:544:10:544:15 | vs_mut [borrowed] | -| main.rs:545:11:545:39 | ... .unwrap() | file://:0:0:0:0 | &ref | main.rs:545:11:545:39 | ... .unwrap() [borrowed] | -| main.rs:546:11:546:39 | ... .unwrap() | file://:0:0:0:0 | &ref | main.rs:546:11:546:39 | ... .unwrap() [borrowed] | +| main.rs:544:10:544:15 | vs_mut | file://:0:0:0:0 | &ref | main.rs:544:10:544:15 | vs_mut [implicit borrow] | +| main.rs:545:11:545:39 | ... .unwrap() | file://:0:0:0:0 | &ref | main.rs:545:11:545:39 | ... .unwrap() [implicit borrow] | +| main.rs:546:11:546:39 | ... .unwrap() | file://:0:0:0:0 | &ref | main.rs:546:11:546:39 | ... .unwrap() [implicit borrow] | | main.rs:557:18:557:18 | c | file://:0:0:0:0 | &ref | main.rs:557:17:557:18 | &c | | main.rs:560:15:560:15 | b | file://:0:0:0:0 | &ref | main.rs:560:14:560:15 | &b | -| main.rs:562:11:562:15 | c_ref | file://:0:0:0:0 | &ref | main.rs:562:11:562:15 | c_ref [borrowed] | +| main.rs:562:11:562:15 | c_ref | file://:0:0:0:0 | &ref | main.rs:562:11:562:15 | c_ref [implicit borrow] | | main.rs:583:27:583:27 | 0 | {EXTERNAL LOCATION} | Some | main.rs:583:22:583:28 | Some(...) | diff --git a/rust/ql/test/library-tests/dataflow/local/inline-flow.expected b/rust/ql/test/library-tests/dataflow/local/inline-flow.expected index 61c4771068bf..ba7d8efa5cbd 100644 --- a/rust/ql/test/library-tests/dataflow/local/inline-flow.expected +++ b/rust/ql/test/library-tests/dataflow/local/inline-flow.expected @@ -5,18 +5,18 @@ models | 4 | Summary: <_ as core::ops::index::Index>::index; Argument[self].Reference.Element; ReturnValue.Reference; value | | 5 | Summary: ::deref; Argument[self].Reference.Field[alloc::boxed::Box(0)]; ReturnValue.Reference; value | | 6 | Summary: ::new; Argument[0]; ReturnValue.Field[alloc::boxed::Box(0)]; value | -| 7 | Summary: ::from; Argument[0]; ReturnValue; taint | -| 8 | Summary: ::unwrap; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | -| 9 | Summary: ::unwrap_or; Argument[0]; ReturnValue; value | -| 10 | Summary: ::unwrap_or; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | -| 11 | Summary: ::unwrap_or_else; Argument[0].ReturnValue; ReturnValue; value | -| 12 | Summary: ::unwrap_or_else; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | -| 13 | Summary: ::err; Argument[self].Field[core::result::Result::Err(0)]; ReturnValue.Field[core::option::Option::Some(0)]; value | -| 14 | Summary: ::expect; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | -| 15 | Summary: ::expect_err; Argument[self].Field[core::result::Result::Err(0)]; ReturnValue; value | -| 16 | Summary: ::ok; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue.Field[core::option::Option::Some(0)]; value | -| 17 | Summary: ::unwrap; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | -| 18 | Summary: ::parse; Argument[self]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | +| 7 | Summary: ::deref; Argument[self].Reference; ReturnValue.Reference; taint | +| 8 | Summary: ::from; Argument[0]; ReturnValue; taint | +| 9 | Summary: ::unwrap; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | +| 10 | Summary: ::unwrap_or; Argument[0]; ReturnValue; value | +| 11 | Summary: ::unwrap_or; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | +| 12 | Summary: ::unwrap_or_else; Argument[0].ReturnValue; ReturnValue; value | +| 13 | Summary: ::unwrap_or_else; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | +| 14 | Summary: ::err; Argument[self].Field[core::result::Result::Err(0)]; ReturnValue.Field[core::option::Option::Some(0)]; value | +| 15 | Summary: ::expect; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | +| 16 | Summary: ::expect_err; Argument[self].Field[core::result::Result::Err(0)]; ReturnValue; value | +| 17 | Summary: ::ok; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue.Field[core::option::Option::Some(0)]; value | +| 18 | Summary: ::unwrap; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | edges | main.rs:23:9:23:9 | s | main.rs:24:10:24:10 | s | provenance | | | main.rs:23:9:23:9 | s | main.rs:26:12:26:12 | x | provenance | | @@ -128,17 +128,17 @@ edges | main.rs:278:9:278:10 | s1 [Some] | main.rs:279:10:279:11 | s1 [Some] | provenance | | | main.rs:278:14:278:29 | Some(...) [Some] | main.rs:278:9:278:10 | s1 [Some] | provenance | | | main.rs:278:19:278:28 | source(...) | main.rs:278:14:278:29 | Some(...) [Some] | provenance | | -| main.rs:279:10:279:11 | s1 [Some] | main.rs:279:10:279:20 | s1.unwrap() | provenance | MaD:8 | +| main.rs:279:10:279:11 | s1 [Some] | main.rs:279:10:279:20 | s1.unwrap() | provenance | MaD:9 | | main.rs:283:9:283:10 | s1 [Some] | main.rs:284:10:284:11 | s1 [Some] | provenance | | | main.rs:283:14:283:29 | Some(...) [Some] | main.rs:283:9:283:10 | s1 [Some] | provenance | | | main.rs:283:19:283:28 | source(...) | main.rs:283:14:283:29 | Some(...) [Some] | provenance | | -| main.rs:284:10:284:11 | s1 [Some] | main.rs:284:10:284:24 | s1.unwrap_or(...) | provenance | MaD:10 | -| main.rs:287:23:287:32 | source(...) | main.rs:287:10:287:33 | s2.unwrap_or(...) | provenance | MaD:9 | +| main.rs:284:10:284:11 | s1 [Some] | main.rs:284:10:284:24 | s1.unwrap_or(...) | provenance | MaD:11 | +| main.rs:287:23:287:32 | source(...) | main.rs:287:10:287:33 | s2.unwrap_or(...) | provenance | MaD:10 | | main.rs:291:9:291:10 | s1 [Some] | main.rs:292:10:292:11 | s1 [Some] | provenance | | | main.rs:291:14:291:29 | Some(...) [Some] | main.rs:291:9:291:10 | s1 [Some] | provenance | | | main.rs:291:19:291:28 | source(...) | main.rs:291:14:291:29 | Some(...) [Some] | provenance | | -| main.rs:292:10:292:11 | s1 [Some] | main.rs:292:10:292:32 | s1.unwrap_or_else(...) | provenance | MaD:12 | -| main.rs:295:31:295:40 | source(...) | main.rs:295:10:295:41 | s2.unwrap_or_else(...) | provenance | MaD:11 | +| main.rs:292:10:292:11 | s1 [Some] | main.rs:292:10:292:32 | s1.unwrap_or_else(...) | provenance | MaD:13 | +| main.rs:295:31:295:40 | source(...) | main.rs:295:10:295:41 | s2.unwrap_or_else(...) | provenance | MaD:12 | | main.rs:299:9:299:10 | s1 [Some] | main.rs:301:14:301:15 | s1 [Some] | provenance | | | main.rs:299:14:299:29 | Some(...) [Some] | main.rs:299:9:299:10 | s1 [Some] | provenance | | | main.rs:299:19:299:28 | source(...) | main.rs:299:14:299:29 | Some(...) [Some] | provenance | | @@ -149,16 +149,16 @@ edges | main.rs:308:32:308:45 | Ok(...) [Ok] | main.rs:308:9:308:10 | r1 [Ok] | provenance | | | main.rs:308:35:308:44 | source(...) | main.rs:308:32:308:45 | Ok(...) [Ok] | provenance | | | main.rs:309:9:309:11 | o1a [Some] | main.rs:311:10:311:12 | o1a [Some] | provenance | | -| main.rs:309:28:309:29 | r1 [Ok] | main.rs:309:28:309:34 | r1.ok() [Some] | provenance | MaD:16 | +| main.rs:309:28:309:29 | r1 [Ok] | main.rs:309:28:309:34 | r1.ok() [Some] | provenance | MaD:17 | | main.rs:309:28:309:34 | r1.ok() [Some] | main.rs:309:9:309:11 | o1a [Some] | provenance | | -| main.rs:311:10:311:12 | o1a [Some] | main.rs:311:10:311:21 | o1a.unwrap() | provenance | MaD:8 | +| main.rs:311:10:311:12 | o1a [Some] | main.rs:311:10:311:21 | o1a.unwrap() | provenance | MaD:9 | | main.rs:314:9:314:10 | r2 [Err] | main.rs:316:28:316:29 | r2 [Err] | provenance | | | main.rs:314:32:314:46 | Err(...) [Err] | main.rs:314:9:314:10 | r2 [Err] | provenance | | | main.rs:314:36:314:45 | source(...) | main.rs:314:32:314:46 | Err(...) [Err] | provenance | | | main.rs:316:9:316:11 | o2b [Some] | main.rs:318:10:318:12 | o2b [Some] | provenance | | -| main.rs:316:28:316:29 | r2 [Err] | main.rs:316:28:316:35 | r2.err() [Some] | provenance | MaD:13 | +| main.rs:316:28:316:29 | r2 [Err] | main.rs:316:28:316:35 | r2.err() [Some] | provenance | MaD:14 | | main.rs:316:28:316:35 | r2.err() [Some] | main.rs:316:9:316:11 | o2b [Some] | provenance | | -| main.rs:318:10:318:12 | o2b [Some] | main.rs:318:10:318:21 | o2b.unwrap() | provenance | MaD:8 | +| main.rs:318:10:318:12 | o2b [Some] | main.rs:318:10:318:21 | o2b.unwrap() | provenance | MaD:9 | | main.rs:322:9:322:10 | s1 [Ok] | main.rs:325:14:325:15 | s1 [Ok] | provenance | | | main.rs:322:32:322:45 | Ok(...) [Ok] | main.rs:322:9:322:10 | s1 [Ok] | provenance | | | main.rs:322:35:322:44 | source(...) | main.rs:322:32:322:45 | Ok(...) [Ok] | provenance | | @@ -168,11 +168,11 @@ edges | main.rs:335:9:335:10 | s1 [Ok] | main.rs:336:10:336:11 | s1 [Ok] | provenance | | | main.rs:335:32:335:45 | Ok(...) [Ok] | main.rs:335:9:335:10 | s1 [Ok] | provenance | | | main.rs:335:35:335:44 | source(...) | main.rs:335:32:335:45 | Ok(...) [Ok] | provenance | | -| main.rs:336:10:336:11 | s1 [Ok] | main.rs:336:10:336:22 | s1.expect(...) | provenance | MaD:14 | +| main.rs:336:10:336:11 | s1 [Ok] | main.rs:336:10:336:22 | s1.expect(...) | provenance | MaD:15 | | main.rs:339:9:339:10 | s2 [Err] | main.rs:341:10:341:11 | s2 [Err] | provenance | | | main.rs:339:32:339:46 | Err(...) [Err] | main.rs:339:9:339:10 | s2 [Err] | provenance | | | main.rs:339:36:339:45 | source(...) | main.rs:339:32:339:46 | Err(...) [Err] | provenance | | -| main.rs:341:10:341:11 | s2 [Err] | main.rs:341:10:341:26 | s2.expect_err(...) | provenance | MaD:15 | +| main.rs:341:10:341:11 | s2 [Err] | main.rs:341:10:341:26 | s2.expect_err(...) | provenance | MaD:16 | | main.rs:350:9:350:10 | s1 [A] | main.rs:352:11:352:12 | s1 [A] | provenance | | | main.rs:350:14:350:39 | ...::A(...) [A] | main.rs:350:9:350:10 | s1 [A] | provenance | | | main.rs:350:29:350:38 | source(...) | main.rs:350:14:350:39 | ...::A(...) [A] | provenance | | @@ -262,12 +262,12 @@ edges | main.rs:506:13:506:13 | a | main.rs:506:13:506:25 | a.to_string() | provenance | MaD:2 | | main.rs:506:13:506:25 | a.to_string() | main.rs:506:9:506:9 | b | provenance | | | main.rs:507:9:507:9 | c | main.rs:512:10:512:10 | c | provenance | | -| main.rs:507:13:507:13 | b | main.rs:507:13:507:28 | b.parse() [Ok] | provenance | MaD:18 | -| main.rs:507:13:507:28 | b.parse() [Ok] | main.rs:507:13:507:37 | ... .unwrap() | provenance | MaD:17 | +| main.rs:507:13:507:13 | b | main.rs:507:13:507:28 | b.parse() [Ok] | provenance | MaD:7 | +| main.rs:507:13:507:28 | b.parse() [Ok] | main.rs:507:13:507:37 | ... .unwrap() | provenance | MaD:18 | | main.rs:507:13:507:37 | ... .unwrap() | main.rs:507:9:507:9 | c | provenance | | | main.rs:508:9:508:9 | d | main.rs:513:10:513:10 | d | provenance | | -| main.rs:508:18:508:18 | b | main.rs:508:18:508:26 | b.parse() [Ok] | provenance | MaD:18 | -| main.rs:508:18:508:26 | b.parse() [Ok] | main.rs:508:18:508:35 | ... .unwrap() | provenance | MaD:17 | +| main.rs:508:18:508:18 | b | main.rs:508:18:508:26 | b.parse() [Ok] | provenance | MaD:7 | +| main.rs:508:18:508:26 | b.parse() [Ok] | main.rs:508:18:508:35 | ... .unwrap() | provenance | MaD:18 | | main.rs:508:18:508:35 | ... .unwrap() | main.rs:508:9:508:9 | d | provenance | | | main.rs:517:9:517:10 | vs [element] | main.rs:519:10:519:11 | vs [element] | provenance | | | main.rs:517:9:517:10 | vs [element] | main.rs:523:14:523:15 | vs [element] | provenance | | @@ -298,7 +298,7 @@ edges | main.rs:572:9:572:9 | b | main.rs:576:20:576:20 | b | provenance | | | main.rs:572:18:572:27 | source(...) | main.rs:572:9:572:9 | b | provenance | | | main.rs:576:20:576:20 | b | main.rs:576:10:576:21 | ...::from(...) | provenance | MaD:3 | -| main.rs:576:20:576:20 | b | main.rs:576:10:576:21 | ...::from(...) | provenance | MaD:7 | +| main.rs:576:20:576:20 | b | main.rs:576:10:576:21 | ...::from(...) | provenance | MaD:8 | nodes | main.rs:19:10:19:18 | source(...) | semmle.label | source(...) | | main.rs:23:9:23:9 | s | semmle.label | s | diff --git a/rust/ql/test/library-tests/dataflow/modeled/inline-flow.expected b/rust/ql/test/library-tests/dataflow/modeled/inline-flow.expected index 043809e63395..96743b2f7f58 100644 --- a/rust/ql/test/library-tests/dataflow/modeled/inline-flow.expected +++ b/rust/ql/test/library-tests/dataflow/modeled/inline-flow.expected @@ -1,56 +1,57 @@ models | 1 | Summary: <& as core::ops::deref::Deref>::deref; Argument[self].Reference; ReturnValue; value | -| 2 | Summary: <_ as core::clone::Clone>::clone; Argument[self].Reference; ReturnValue; value | -| 3 | Summary: <_ as core::cmp::Ord>::clamp; Argument[self,0,1]; ReturnValue; value | -| 4 | Summary: <_ as core::cmp::Ord>::max; Argument[self,0]; ReturnValue; value | -| 5 | Summary: <_ as core::cmp::Ord>::min; Argument[self,0]; ReturnValue; value | -| 6 | Summary: <_ as core::ops::arith::Add>::add; Argument[0].Reference; ReturnValue; taint | -| 7 | Summary: <_ as core::ops::arith::Add>::add; Argument[0]; ReturnValue; taint | -| 8 | Summary: ::into_pin; Argument[0]; ReturnValue.Field[core::pin::Pin::pointer]; value | -| 9 | Summary: ::new; Argument[0]; ReturnValue.Field[alloc::boxed::Box(0)]; value | -| 10 | Summary: ::pin; Argument[0]; ReturnValue.Field[core::pin::Pin::pointer].Field[alloc::boxed::Box(0)]; value | -| 11 | Summary: ::clone; Argument[self].Reference; ReturnValue; value | -| 12 | Summary: ::map_or; Argument[1].ReturnValue; ReturnValue; value | -| 13 | Summary: ::unwrap; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | -| 14 | Summary: ::zip; Argument[0].Field[core::option::Option::Some(0)]; ReturnValue.Field[core::option::Option::Some(0)].Field[1]; value | -| 15 | Summary: ::deref; Argument[self].Reference.Field[core::pin::Pin::pointer].Field[alloc::boxed::Box(0)]; ReturnValue.Reference; value | -| 16 | Summary: ::deref; Argument[self].Reference.Field[core::pin::Pin::pointer].Reference; ReturnValue.Reference; value | -| 17 | Summary: ::into_inner; Argument[0].Field[core::pin::Pin::pointer]; ReturnValue; value | -| 18 | Summary: ::into_inner_unchecked; Argument[0].Field[core::pin::Pin::pointer]; ReturnValue; value | -| 19 | Summary: ::new; Argument[0]; ReturnValue.Field[core::pin::Pin::pointer]; value | -| 20 | Summary: ::new_unchecked; Argument[0]; ReturnValue.Field[core::pin::Pin::pointer]; value | -| 21 | Summary: ::unwrap; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | -| 22 | Summary: core::ptr::read; Argument[0].Reference; ReturnValue; value | -| 23 | Summary: core::ptr::write; Argument[1]; Argument[0].Reference; value | +| 2 | Summary: <&mut as core::ops::deref::Deref>::deref; Argument[self].Reference; ReturnValue; value | +| 3 | Summary: <_ as core::clone::Clone>::clone; Argument[self].Reference; ReturnValue; value | +| 4 | Summary: <_ as core::cmp::Ord>::clamp; Argument[self,0,1]; ReturnValue; value | +| 5 | Summary: <_ as core::cmp::Ord>::max; Argument[self,0]; ReturnValue; value | +| 6 | Summary: <_ as core::cmp::Ord>::min; Argument[self,0]; ReturnValue; value | +| 7 | Summary: <_ as core::ops::arith::Add>::add; Argument[0].Reference; ReturnValue; taint | +| 8 | Summary: <_ as core::ops::arith::Add>::add; Argument[0]; ReturnValue; taint | +| 9 | Summary: ::into_pin; Argument[0]; ReturnValue.Field[core::pin::Pin::pointer]; value | +| 10 | Summary: ::new; Argument[0]; ReturnValue.Field[alloc::boxed::Box(0)]; value | +| 11 | Summary: ::pin; Argument[0]; ReturnValue.Field[core::pin::Pin::pointer].Field[alloc::boxed::Box(0)]; value | +| 12 | Summary: ::clone; Argument[self].Reference; ReturnValue; value | +| 13 | Summary: ::map_or; Argument[1].ReturnValue; ReturnValue; value | +| 14 | Summary: ::unwrap; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | +| 15 | Summary: ::zip; Argument[0].Field[core::option::Option::Some(0)]; ReturnValue.Field[core::option::Option::Some(0)].Field[1]; value | +| 16 | Summary: ::deref; Argument[self].Reference.Field[core::pin::Pin::pointer].Field[alloc::boxed::Box(0)]; ReturnValue.Reference; value | +| 17 | Summary: ::deref; Argument[self].Reference.Field[core::pin::Pin::pointer].Reference; ReturnValue.Reference; value | +| 18 | Summary: ::into_inner; Argument[0].Field[core::pin::Pin::pointer]; ReturnValue; value | +| 19 | Summary: ::into_inner_unchecked; Argument[0].Field[core::pin::Pin::pointer]; ReturnValue; value | +| 20 | Summary: ::new; Argument[0]; ReturnValue.Field[core::pin::Pin::pointer]; value | +| 21 | Summary: ::new_unchecked; Argument[0]; ReturnValue.Field[core::pin::Pin::pointer]; value | +| 22 | Summary: ::unwrap; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | +| 23 | Summary: core::ptr::read; Argument[0].Reference; ReturnValue; value | +| 24 | Summary: core::ptr::write; Argument[1]; Argument[0].Reference; value | edges | main.rs:12:9:12:9 | a [Some] | main.rs:13:10:13:10 | a [Some] | provenance | | | main.rs:12:9:12:9 | a [Some] | main.rs:14:13:14:13 | a [Some] | provenance | | | main.rs:12:13:12:28 | Some(...) [Some] | main.rs:12:9:12:9 | a [Some] | provenance | | | main.rs:12:18:12:27 | source(...) | main.rs:12:13:12:28 | Some(...) [Some] | provenance | | -| main.rs:13:10:13:10 | a [Some] | main.rs:13:10:13:19 | a.unwrap() | provenance | MaD:13 | +| main.rs:13:10:13:10 | a [Some] | main.rs:13:10:13:19 | a.unwrap() | provenance | MaD:14 | | main.rs:14:9:14:9 | b [Some] | main.rs:15:10:15:10 | b [Some] | provenance | | -| main.rs:14:13:14:13 | a [Some] | main.rs:14:13:14:21 | a.clone() [Some] | provenance | MaD:2 | +| main.rs:14:13:14:13 | a [Some] | main.rs:14:13:14:21 | a.clone() [Some] | provenance | MaD:3 | | main.rs:14:13:14:21 | a.clone() [Some] | main.rs:14:9:14:9 | b [Some] | provenance | | -| main.rs:15:10:15:10 | b [Some] | main.rs:15:10:15:19 | b.unwrap() | provenance | MaD:13 | +| main.rs:15:10:15:10 | b [Some] | main.rs:15:10:15:19 | b.unwrap() | provenance | MaD:14 | | main.rs:19:9:19:9 | a [Ok] | main.rs:20:10:20:10 | a [Ok] | provenance | | | main.rs:19:9:19:9 | a [Ok] | main.rs:21:13:21:13 | a [Ok] | provenance | | | main.rs:19:31:19:44 | Ok(...) [Ok] | main.rs:19:9:19:9 | a [Ok] | provenance | | | main.rs:19:34:19:43 | source(...) | main.rs:19:31:19:44 | Ok(...) [Ok] | provenance | | -| main.rs:20:10:20:10 | a [Ok] | main.rs:20:10:20:19 | a.unwrap() | provenance | MaD:21 | +| main.rs:20:10:20:10 | a [Ok] | main.rs:20:10:20:19 | a.unwrap() | provenance | MaD:22 | | main.rs:21:9:21:9 | b [Ok] | main.rs:22:10:22:10 | b [Ok] | provenance | | -| main.rs:21:13:21:13 | a [Ok] | main.rs:21:13:21:21 | a.clone() [Ok] | provenance | MaD:2 | +| main.rs:21:13:21:13 | a [Ok] | main.rs:21:13:21:21 | a.clone() [Ok] | provenance | MaD:3 | | main.rs:21:13:21:21 | a.clone() [Ok] | main.rs:21:9:21:9 | b [Ok] | provenance | | -| main.rs:22:10:22:10 | b [Ok] | main.rs:22:10:22:19 | b.unwrap() | provenance | MaD:21 | +| main.rs:22:10:22:10 | b [Ok] | main.rs:22:10:22:19 | b.unwrap() | provenance | MaD:22 | | main.rs:26:9:26:9 | a | main.rs:27:10:27:10 | a | provenance | | | main.rs:26:9:26:9 | a | main.rs:28:13:28:13 | a | provenance | | | main.rs:26:13:26:22 | source(...) | main.rs:26:9:26:9 | a | provenance | | | main.rs:28:9:28:9 | b | main.rs:29:10:29:10 | b | provenance | | -| main.rs:28:13:28:13 | a | main.rs:28:13:28:21 | a.clone() | provenance | MaD:2 | -| main.rs:28:13:28:13 | a | main.rs:28:13:28:21 | a.clone() | provenance | MaD:11 | +| main.rs:28:13:28:13 | a | main.rs:28:13:28:21 | a.clone() | provenance | MaD:3 | +| main.rs:28:13:28:13 | a | main.rs:28:13:28:21 | a.clone() | provenance | MaD:12 | | main.rs:28:13:28:21 | a.clone() | main.rs:28:9:28:9 | b | provenance | | | main.rs:43:18:43:22 | SelfParam [&ref, Wrapper] | main.rs:44:26:44:29 | self [&ref, Wrapper] | provenance | | | main.rs:44:13:44:33 | Wrapper {...} [Wrapper] | main.rs:43:33:45:9 | { ... } [Wrapper] | provenance | | -| main.rs:44:26:44:29 | self [&ref, Wrapper] | main.rs:44:26:44:31 | self.n | provenance | | +| main.rs:44:26:44:29 | self [&ref, Wrapper] | main.rs:44:26:44:31 | self.n | provenance | MaD:1 | | main.rs:44:26:44:31 | self.n | main.rs:44:13:44:33 | Wrapper {...} [Wrapper] | provenance | | | main.rs:49:13:49:13 | w [Wrapper] | main.rs:50:15:50:15 | w [Wrapper] | provenance | | | main.rs:49:17:49:41 | Wrapper {...} [Wrapper] | main.rs:49:13:49:13 | w [Wrapper] | provenance | | @@ -61,7 +62,7 @@ edges | main.rs:51:26:51:26 | n | main.rs:51:38:51:38 | n | provenance | | | main.rs:53:13:53:13 | u [Wrapper] | main.rs:54:15:54:15 | u [Wrapper] | provenance | | | main.rs:53:17:53:17 | w [Wrapper] | main.rs:43:18:43:22 | SelfParam [&ref, Wrapper] | provenance | | -| main.rs:53:17:53:17 | w [Wrapper] | main.rs:53:17:53:25 | w.clone() [Wrapper] | provenance | | +| main.rs:53:17:53:17 | w [Wrapper] | main.rs:53:17:53:25 | w.clone() [Wrapper] | provenance | MaD:1 | | main.rs:53:17:53:25 | w.clone() [Wrapper] | main.rs:53:13:53:13 | u [Wrapper] | provenance | | | main.rs:54:15:54:15 | u [Wrapper] | main.rs:55:13:55:28 | Wrapper {...} [Wrapper] | provenance | | | main.rs:55:13:55:28 | Wrapper {...} [Wrapper] | main.rs:55:26:55:26 | n | provenance | | @@ -71,19 +72,19 @@ edges | main.rs:66:22:66:31 | source(...) | main.rs:66:17:66:32 | Some(...) [Some] | provenance | | | main.rs:67:13:67:13 | z [Some, tuple.1] | main.rs:68:15:68:15 | z [Some, tuple.1] | provenance | | | main.rs:67:17:67:24 | a.zip(...) [Some, tuple.1] | main.rs:67:13:67:13 | z [Some, tuple.1] | provenance | | -| main.rs:67:23:67:23 | b [Some] | main.rs:67:17:67:24 | a.zip(...) [Some, tuple.1] | provenance | MaD:14 | +| main.rs:67:23:67:23 | b [Some] | main.rs:67:17:67:24 | a.zip(...) [Some, tuple.1] | provenance | MaD:15 | | main.rs:68:15:68:15 | z [Some, tuple.1] | main.rs:69:13:69:24 | Some(...) [Some, tuple.1] | provenance | | | main.rs:69:13:69:24 | Some(...) [Some, tuple.1] | main.rs:69:18:69:23 | TuplePat [tuple.1] | provenance | | | main.rs:69:18:69:23 | TuplePat [tuple.1] | main.rs:69:22:69:22 | m | provenance | | | main.rs:69:22:69:22 | m | main.rs:71:22:71:22 | m | provenance | | | main.rs:79:13:79:13 | b | main.rs:80:14:80:14 | b | provenance | | | main.rs:79:17:79:47 | a.map_or(...) | main.rs:79:13:79:13 | b | provenance | | -| main.rs:79:33:79:46 | ... + ... | main.rs:79:17:79:47 | a.map_or(...) | provenance | MaD:12 | -| main.rs:79:37:79:46 | source(...) | main.rs:79:33:79:46 | ... + ... | provenance | MaD:6 | +| main.rs:79:33:79:46 | ... + ... | main.rs:79:17:79:47 | a.map_or(...) | provenance | MaD:13 | | main.rs:79:37:79:46 | source(...) | main.rs:79:33:79:46 | ... + ... | provenance | MaD:7 | +| main.rs:79:37:79:46 | source(...) | main.rs:79:33:79:46 | ... + ... | provenance | MaD:8 | | main.rs:92:29:92:29 | [post] y [&ref] | main.rs:93:33:93:33 | y [&ref] | provenance | | -| main.rs:92:32:92:41 | source(...) | main.rs:92:29:92:29 | [post] y [&ref] | provenance | MaD:23 | -| main.rs:93:33:93:33 | y [&ref] | main.rs:93:18:93:34 | ...::read(...) | provenance | MaD:22 | +| main.rs:92:32:92:41 | source(...) | main.rs:92:29:92:29 | [post] y [&ref] | provenance | MaD:24 | +| main.rs:93:33:93:33 | y [&ref] | main.rs:93:18:93:34 | ...::read(...) | provenance | MaD:23 | | main.rs:108:13:108:17 | mut i | main.rs:109:34:109:34 | i | provenance | | | main.rs:108:13:108:17 | mut i | main.rs:110:33:110:33 | i | provenance | | | main.rs:108:13:108:17 | mut i | main.rs:111:47:111:47 | i | provenance | | @@ -93,62 +94,64 @@ edges | main.rs:109:13:109:20 | mut pin1 [Pin, &ref] | main.rs:114:15:114:18 | pin1 [Pin, &ref] | provenance | | | main.rs:109:13:109:20 | mut pin1 [Pin, &ref] | main.rs:115:31:115:34 | pin1 [Pin, &ref] | provenance | | | main.rs:109:24:109:35 | ...::new(...) [Pin, &ref] | main.rs:109:13:109:20 | mut pin1 [Pin, &ref] | provenance | | -| main.rs:109:33:109:34 | &i [&ref] | main.rs:109:24:109:35 | ...::new(...) [Pin, &ref] | provenance | MaD:19 | +| main.rs:109:33:109:34 | &i [&ref] | main.rs:109:24:109:35 | ...::new(...) [Pin, &ref] | provenance | MaD:20 | | main.rs:109:34:109:34 | i | main.rs:109:33:109:34 | &i [&ref] | provenance | | | main.rs:110:13:110:20 | mut pin2 [Pin, Box(0)] | main.rs:116:15:116:18 | pin2 [Pin, Box(0)] | provenance | | | main.rs:110:24:110:34 | ...::pin(...) [Pin, Box(0)] | main.rs:110:13:110:20 | mut pin2 [Pin, Box(0)] | provenance | | -| main.rs:110:33:110:33 | i | main.rs:110:24:110:34 | ...::pin(...) [Pin, Box(0)] | provenance | MaD:10 | +| main.rs:110:33:110:33 | i | main.rs:110:24:110:34 | ...::pin(...) [Pin, Box(0)] | provenance | MaD:11 | | main.rs:111:13:111:20 | mut pin3 [Pin, Box(0)] | main.rs:117:15:117:18 | pin3 [Pin, Box(0)] | provenance | | | main.rs:111:24:111:49 | ...::into_pin(...) [Pin, Box(0)] | main.rs:111:13:111:20 | mut pin3 [Pin, Box(0)] | provenance | | -| main.rs:111:38:111:48 | ...::new(...) [Box(0)] | main.rs:111:24:111:49 | ...::into_pin(...) [Pin, Box(0)] | provenance | MaD:8 | -| main.rs:111:47:111:47 | i | main.rs:111:38:111:48 | ...::new(...) [Box(0)] | provenance | MaD:9 | +| main.rs:111:38:111:48 | ...::new(...) [Box(0)] | main.rs:111:24:111:49 | ...::into_pin(...) [Pin, Box(0)] | provenance | MaD:9 | +| main.rs:111:47:111:47 | i | main.rs:111:38:111:48 | ...::new(...) [Box(0)] | provenance | MaD:10 | | main.rs:112:13:112:20 | mut pin4 [Pin, &ref] | main.rs:118:15:118:18 | pin4 [Pin, &ref] | provenance | | -| main.rs:112:24:112:27 | &mut pinned [&ref] | main.rs:112:24:112:27 | ...::new_unchecked(...) [Pin, &ref] | provenance | MaD:20 | +| main.rs:112:24:112:27 | &mut pinned [&ref] | main.rs:112:24:112:27 | ...::new_unchecked(...) [Pin, &ref] | provenance | MaD:21 | | main.rs:112:24:112:27 | ...::new_unchecked(...) [Pin, &ref] | main.rs:112:13:112:20 | mut pin4 [Pin, &ref] | provenance | | | main.rs:112:24:112:27 | mut pinned | main.rs:112:24:112:27 | pinned | provenance | | | main.rs:112:24:112:27 | pinned | main.rs:112:24:112:27 | &mut pinned [&ref] | provenance | | -| main.rs:114:15:114:18 | pin1 [Pin, &ref] | main.rs:114:14:114:18 | * ... | provenance | MaD:16 | +| main.rs:114:15:114:18 | pin1 [Pin, &ref] | main.rs:114:14:114:18 | * ... | provenance | MaD:17 | | main.rs:115:15:115:35 | ...::into_inner(...) [&ref] | main.rs:115:14:115:35 | * ... | provenance | MaD:1 | -| main.rs:115:31:115:34 | pin1 [Pin, &ref] | main.rs:115:15:115:35 | ...::into_inner(...) [&ref] | provenance | MaD:17 | -| main.rs:116:15:116:18 | pin2 [Pin, Box(0)] | main.rs:116:14:116:18 | * ... | provenance | MaD:15 | -| main.rs:117:15:117:18 | pin3 [Pin, Box(0)] | main.rs:117:14:117:18 | * ... | provenance | MaD:15 | -| main.rs:118:15:118:18 | pin4 [Pin, &ref] | main.rs:118:14:118:18 | * ... | provenance | MaD:16 | +| main.rs:115:31:115:34 | pin1 [Pin, &ref] | main.rs:115:15:115:35 | ...::into_inner(...) [&ref] | provenance | MaD:18 | +| main.rs:116:15:116:18 | pin2 [Pin, Box(0)] | main.rs:116:14:116:18 | * ... | provenance | MaD:16 | +| main.rs:117:15:117:18 | pin3 [Pin, Box(0)] | main.rs:117:14:117:18 | * ... | provenance | MaD:16 | +| main.rs:118:15:118:18 | pin4 [Pin, &ref] | main.rs:118:14:118:18 | * ... | provenance | MaD:17 | | main.rs:122:13:122:18 | mut ms [MyStruct] | main.rs:123:34:123:35 | ms [MyStruct] | provenance | | | main.rs:122:13:122:18 | mut ms [MyStruct] | main.rs:127:14:127:15 | ms [MyStruct] | provenance | | | main.rs:122:22:122:49 | MyStruct {...} [MyStruct] | main.rs:122:13:122:18 | mut ms [MyStruct] | provenance | | | main.rs:122:38:122:47 | source(...) | main.rs:122:22:122:49 | MyStruct {...} [MyStruct] | provenance | | | main.rs:123:13:123:20 | mut pin1 [Pin, &ref, MyStruct] | main.rs:129:30:129:33 | pin1 [Pin, &ref, MyStruct] | provenance | | | main.rs:123:24:123:36 | ...::new(...) [Pin, &ref, MyStruct] | main.rs:123:13:123:20 | mut pin1 [Pin, &ref, MyStruct] | provenance | | -| main.rs:123:33:123:35 | &ms [&ref, MyStruct] | main.rs:123:24:123:36 | ...::new(...) [Pin, &ref, MyStruct] | provenance | MaD:19 | +| main.rs:123:33:123:35 | &ms [&ref, MyStruct] | main.rs:123:24:123:36 | ...::new(...) [Pin, &ref, MyStruct] | provenance | MaD:20 | | main.rs:123:34:123:35 | ms [MyStruct] | main.rs:123:33:123:35 | &ms [&ref, MyStruct] | provenance | | | main.rs:127:14:127:15 | ms [MyStruct] | main.rs:127:14:127:19 | ms.val | provenance | | -| main.rs:129:14:129:34 | ...::into_inner(...) [&ref, MyStruct] | main.rs:129:14:129:38 | ... .val | provenance | | -| main.rs:129:30:129:33 | pin1 [Pin, &ref, MyStruct] | main.rs:129:14:129:34 | ...::into_inner(...) [&ref, MyStruct] | provenance | MaD:17 | +| main.rs:129:14:129:34 | ...::into_inner(...) [&ref, MyStruct] | main.rs:129:14:129:38 | ... .val | provenance | MaD:1 | +| main.rs:129:14:129:34 | ...::into_inner(...) [&ref, MyStruct] | main.rs:129:14:129:38 | ... .val | provenance | MaD:2 | +| main.rs:129:30:129:33 | pin1 [Pin, &ref, MyStruct] | main.rs:129:14:129:34 | ...::into_inner(...) [&ref, MyStruct] | provenance | MaD:18 | | main.rs:136:13:136:18 | mut ms [MyStruct] | main.rs:137:44:137:45 | ms [MyStruct] | provenance | | | main.rs:136:22:136:49 | MyStruct {...} [MyStruct] | main.rs:136:13:136:18 | mut ms [MyStruct] | provenance | | | main.rs:136:38:136:47 | source(...) | main.rs:136:22:136:49 | MyStruct {...} [MyStruct] | provenance | | | main.rs:137:13:137:20 | mut pin5 [Pin, &ref, MyStruct] | main.rs:139:40:139:43 | pin5 [Pin, &ref, MyStruct] | provenance | | | main.rs:137:24:137:46 | ...::new_unchecked(...) [Pin, &ref, MyStruct] | main.rs:137:13:137:20 | mut pin5 [Pin, &ref, MyStruct] | provenance | | -| main.rs:137:43:137:45 | &ms [&ref, MyStruct] | main.rs:137:24:137:46 | ...::new_unchecked(...) [Pin, &ref, MyStruct] | provenance | MaD:20 | +| main.rs:137:43:137:45 | &ms [&ref, MyStruct] | main.rs:137:24:137:46 | ...::new_unchecked(...) [Pin, &ref, MyStruct] | provenance | MaD:21 | | main.rs:137:44:137:45 | ms [MyStruct] | main.rs:137:43:137:45 | &ms [&ref, MyStruct] | provenance | | -| main.rs:139:14:139:44 | ...::into_inner_unchecked(...) [&ref, MyStruct] | main.rs:139:14:139:48 | ... .val | provenance | | -| main.rs:139:40:139:43 | pin5 [Pin, &ref, MyStruct] | main.rs:139:14:139:44 | ...::into_inner_unchecked(...) [&ref, MyStruct] | provenance | MaD:18 | +| main.rs:139:14:139:44 | ...::into_inner_unchecked(...) [&ref, MyStruct] | main.rs:139:14:139:48 | ... .val | provenance | MaD:1 | +| main.rs:139:14:139:44 | ...::into_inner_unchecked(...) [&ref, MyStruct] | main.rs:139:14:139:48 | ... .val | provenance | MaD:2 | +| main.rs:139:40:139:43 | pin5 [Pin, &ref, MyStruct] | main.rs:139:14:139:44 | ...::into_inner_unchecked(...) [&ref, MyStruct] | provenance | MaD:19 | | main.rs:153:9:153:9 | a | main.rs:155:13:155:13 | a | provenance | | | main.rs:153:13:153:22 | source(...) | main.rs:153:9:153:9 | a | provenance | | | main.rs:154:9:154:9 | b | main.rs:155:19:155:19 | b | provenance | | | main.rs:154:13:154:22 | source(...) | main.rs:154:9:154:9 | b | provenance | | | main.rs:155:9:155:9 | c | main.rs:156:10:156:10 | c | provenance | | -| main.rs:155:13:155:13 | a | main.rs:155:13:155:20 | a.min(...) | provenance | MaD:5 | +| main.rs:155:13:155:13 | a | main.rs:155:13:155:20 | a.min(...) | provenance | MaD:6 | | main.rs:155:13:155:20 | a.min(...) | main.rs:155:9:155:9 | c | provenance | | -| main.rs:155:19:155:19 | b | main.rs:155:13:155:20 | a.min(...) | provenance | MaD:5 | +| main.rs:155:19:155:19 | b | main.rs:155:13:155:20 | a.min(...) | provenance | MaD:6 | | main.rs:158:9:158:9 | d | main.rs:160:13:160:13 | d | provenance | | | main.rs:158:13:158:22 | source(...) | main.rs:158:9:158:9 | d | provenance | | | main.rs:159:9:159:9 | e | main.rs:160:19:160:19 | e | provenance | | | main.rs:159:13:159:22 | source(...) | main.rs:159:9:159:9 | e | provenance | | | main.rs:160:9:160:9 | f | main.rs:161:10:161:10 | f | provenance | | -| main.rs:160:13:160:13 | d | main.rs:160:13:160:20 | d.max(...) | provenance | MaD:4 | +| main.rs:160:13:160:13 | d | main.rs:160:13:160:20 | d.max(...) | provenance | MaD:5 | | main.rs:160:13:160:20 | d.max(...) | main.rs:160:9:160:9 | f | provenance | | -| main.rs:160:19:160:19 | e | main.rs:160:13:160:20 | d.max(...) | provenance | MaD:4 | +| main.rs:160:19:160:19 | e | main.rs:160:13:160:20 | d.max(...) | provenance | MaD:5 | | main.rs:163:9:163:9 | g | main.rs:166:13:166:13 | g | provenance | | | main.rs:163:13:163:22 | source(...) | main.rs:163:9:163:9 | g | provenance | | | main.rs:164:9:164:9 | h | main.rs:166:21:166:21 | h | provenance | | @@ -156,10 +159,10 @@ edges | main.rs:165:9:165:9 | i | main.rs:166:24:166:24 | i | provenance | | | main.rs:165:13:165:22 | source(...) | main.rs:165:9:165:9 | i | provenance | | | main.rs:166:9:166:9 | j | main.rs:167:10:167:10 | j | provenance | | -| main.rs:166:13:166:13 | g | main.rs:166:13:166:25 | g.clamp(...) | provenance | MaD:3 | +| main.rs:166:13:166:13 | g | main.rs:166:13:166:25 | g.clamp(...) | provenance | MaD:4 | | main.rs:166:13:166:25 | g.clamp(...) | main.rs:166:9:166:9 | j | provenance | | -| main.rs:166:21:166:21 | h | main.rs:166:13:166:25 | g.clamp(...) | provenance | MaD:3 | -| main.rs:166:24:166:24 | i | main.rs:166:13:166:25 | g.clamp(...) | provenance | MaD:3 | +| main.rs:166:21:166:21 | h | main.rs:166:13:166:25 | g.clamp(...) | provenance | MaD:4 | +| main.rs:166:24:166:24 | i | main.rs:166:13:166:25 | g.clamp(...) | provenance | MaD:4 | nodes | main.rs:12:9:12:9 | a [Some] | semmle.label | a [Some] | | main.rs:12:13:12:28 | Some(...) [Some] | semmle.label | Some(...) [Some] | diff --git a/rust/ql/test/library-tests/dataflow/pointers/inline-flow.expected b/rust/ql/test/library-tests/dataflow/pointers/inline-flow.expected index 55b07f9efcc9..ddece5054383 100644 --- a/rust/ql/test/library-tests/dataflow/pointers/inline-flow.expected +++ b/rust/ql/test/library-tests/dataflow/pointers/inline-flow.expected @@ -85,8 +85,8 @@ edges | main.rs:190:25:190:55 | &... [&ref, MyNumber] | main.rs:190:13:190:21 | my_number [&ref, MyNumber] | provenance | | | main.rs:190:26:190:55 | ...::MyNumber(...) [MyNumber] | main.rs:190:25:190:55 | &... [&ref, MyNumber] | provenance | | | main.rs:190:45:190:54 | source(...) | main.rs:190:26:190:55 | ...::MyNumber(...) [MyNumber] | provenance | | -| main.rs:192:14:192:22 | my_number [&ref, MyNumber] | main.rs:156:18:156:21 | SelfParam [MyNumber] | provenance | | -| main.rs:192:14:192:22 | my_number [&ref, MyNumber] | main.rs:192:14:192:34 | my_number.to_number() | provenance | | +| main.rs:192:14:192:22 | my_number [&ref, MyNumber] | main.rs:156:18:156:21 | SelfParam [MyNumber] | provenance | MaD:1 | +| main.rs:192:14:192:22 | my_number [&ref, MyNumber] | main.rs:192:14:192:34 | my_number.to_number() | provenance | MaD:1 | | main.rs:200:29:200:38 | ...: i64 | main.rs:201:14:201:18 | value | provenance | | | main.rs:201:10:201:10 | [post] n [&ref] | main.rs:200:16:200:26 | ...: ... [Return] [&ref] | provenance | | | main.rs:201:14:201:18 | value | main.rs:201:10:201:10 | [post] n [&ref] | provenance | | diff --git a/rust/ql/test/library-tests/dataflow/sources/env/InlineFlow.expected b/rust/ql/test/library-tests/dataflow/sources/env/InlineFlow.expected index ac8b8c8c3342..04a6b5f41541 100644 --- a/rust/ql/test/library-tests/dataflow/sources/env/InlineFlow.expected +++ b/rust/ql/test/library-tests/dataflow/sources/env/InlineFlow.expected @@ -11,21 +11,21 @@ models | 10 | Summary: <_ as core::iter::traits::iterator::Iterator>::collect; Argument[self].Element; ReturnValue.Element; value | | 11 | Summary: <_ as core::iter::traits::iterator::Iterator>::nth; Argument[self].Reference.Element; ReturnValue.Field[core::option::Option::Some(0)]; value | | 12 | Summary: <_ as core::ops::index::Index>::index; Argument[self].Reference.Element; ReturnValue.Reference; value | -| 13 | Summary: ::expect; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | -| 14 | Summary: ::unwrap; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | -| 15 | Summary: ::expect; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | -| 16 | Summary: ::unwrap; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | -| 17 | Summary: ::parse; Argument[self]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | +| 13 | Summary: ::deref; Argument[self].Reference; ReturnValue.Reference; taint | +| 14 | Summary: ::expect; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | +| 15 | Summary: ::unwrap; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | +| 16 | Summary: ::expect; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | +| 17 | Summary: ::unwrap; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | edges | test.rs:6:10:6:22 | ...::var | test.rs:6:10:6:30 | ...::var(...) | provenance | Src:MaD:6 | | test.rs:7:10:7:25 | ...::var_os | test.rs:7:10:7:33 | ...::var_os(...) | provenance | Src:MaD:7 | | test.rs:9:9:9:12 | var1 | test.rs:12:10:12:13 | var1 | provenance | | | test.rs:9:16:9:28 | ...::var | test.rs:9:16:9:36 | ...::var(...) [Ok] | provenance | Src:MaD:6 | -| test.rs:9:16:9:36 | ...::var(...) [Ok] | test.rs:9:16:9:59 | ... .expect(...) | provenance | MaD:15 | +| test.rs:9:16:9:36 | ...::var(...) [Ok] | test.rs:9:16:9:59 | ... .expect(...) | provenance | MaD:16 | | test.rs:9:16:9:59 | ... .expect(...) | test.rs:9:9:9:12 | var1 | provenance | | | test.rs:10:9:10:12 | var2 | test.rs:13:10:13:13 | var2 | provenance | | | test.rs:10:16:10:31 | ...::var_os | test.rs:10:16:10:39 | ...::var_os(...) [Some] | provenance | Src:MaD:7 | -| test.rs:10:16:10:39 | ...::var_os(...) [Some] | test.rs:10:16:10:48 | ... .unwrap() | provenance | MaD:14 | +| test.rs:10:16:10:39 | ...::var_os(...) [Some] | test.rs:10:16:10:48 | ... .unwrap() | provenance | MaD:15 | | test.rs:10:16:10:48 | ... .unwrap() | test.rs:10:9:10:12 | var2 | provenance | | | test.rs:15:9:15:20 | TuplePat | test.rs:16:14:16:16 | key | provenance | | | test.rs:15:9:15:20 | TuplePat | test.rs:17:14:17:18 | value | provenance | | @@ -51,19 +51,19 @@ edges | test.rs:30:9:30:12 | arg2 | test.rs:36:10:36:13 | arg2 | provenance | | | test.rs:30:16:30:29 | ...::args | test.rs:30:16:30:31 | ...::args(...) [element] | provenance | Src:MaD:1 | | test.rs:30:16:30:31 | ...::args(...) [element] | test.rs:30:16:30:38 | ... .nth(...) [Some] | provenance | MaD:11 | -| test.rs:30:16:30:38 | ... .nth(...) [Some] | test.rs:30:16:30:47 | ... .unwrap() | provenance | MaD:14 | +| test.rs:30:16:30:38 | ... .nth(...) [Some] | test.rs:30:16:30:47 | ... .unwrap() | provenance | MaD:15 | | test.rs:30:16:30:47 | ... .unwrap() | test.rs:30:9:30:12 | arg2 | provenance | | | test.rs:31:9:31:12 | arg3 | test.rs:37:10:37:13 | arg3 | provenance | | | test.rs:31:16:31:32 | ...::args_os | test.rs:31:16:31:34 | ...::args_os(...) [element] | provenance | Src:MaD:2 | | test.rs:31:16:31:34 | ...::args_os(...) [element] | test.rs:31:16:31:41 | ... .nth(...) [Some] | provenance | MaD:11 | -| test.rs:31:16:31:41 | ... .nth(...) [Some] | test.rs:31:16:31:50 | ... .unwrap() | provenance | MaD:14 | +| test.rs:31:16:31:41 | ... .nth(...) [Some] | test.rs:31:16:31:50 | ... .unwrap() | provenance | MaD:15 | | test.rs:31:16:31:50 | ... .unwrap() | test.rs:31:9:31:12 | arg3 | provenance | | | test.rs:32:9:32:12 | arg4 | test.rs:38:10:38:13 | arg4 | provenance | | | test.rs:32:16:32:29 | ...::args | test.rs:32:16:32:31 | ...::args(...) [element] | provenance | Src:MaD:1 | | test.rs:32:16:32:31 | ...::args(...) [element] | test.rs:32:16:32:38 | ... .nth(...) [Some] | provenance | MaD:11 | -| test.rs:32:16:32:38 | ... .nth(...) [Some] | test.rs:32:16:32:47 | ... .unwrap() | provenance | MaD:14 | -| test.rs:32:16:32:47 | ... .unwrap() | test.rs:32:16:32:64 | ... .parse() [Ok] | provenance | MaD:17 | -| test.rs:32:16:32:64 | ... .parse() [Ok] | test.rs:32:16:32:73 | ... .unwrap() | provenance | MaD:16 | +| test.rs:32:16:32:38 | ... .nth(...) [Some] | test.rs:32:16:32:47 | ... .unwrap() | provenance | MaD:15 | +| test.rs:32:16:32:47 | ... .unwrap() | test.rs:32:16:32:64 | ... .parse() [Ok] | provenance | MaD:13 | +| test.rs:32:16:32:64 | ... .parse() [Ok] | test.rs:32:16:32:73 | ... .unwrap() | provenance | MaD:17 | | test.rs:32:16:32:73 | ... .unwrap() | test.rs:32:9:32:12 | arg4 | provenance | | | test.rs:40:9:40:11 | arg | test.rs:41:14:41:16 | arg | provenance | | | test.rs:40:16:40:29 | ...::args | test.rs:40:16:40:31 | ...::args(...) [element] | provenance | Src:MaD:1 | @@ -73,15 +73,15 @@ edges | test.rs:44:16:44:34 | ...::args_os(...) [element] | test.rs:44:9:44:11 | arg | provenance | | | test.rs:50:9:50:11 | dir | test.rs:54:10:54:12 | dir | provenance | | | test.rs:50:15:50:35 | ...::current_dir | test.rs:50:15:50:37 | ...::current_dir(...) [Ok] | provenance | Src:MaD:3 | -| test.rs:50:15:50:37 | ...::current_dir(...) [Ok] | test.rs:50:15:50:54 | ... .expect(...) | provenance | MaD:15 | +| test.rs:50:15:50:37 | ...::current_dir(...) [Ok] | test.rs:50:15:50:54 | ... .expect(...) | provenance | MaD:16 | | test.rs:50:15:50:54 | ... .expect(...) | test.rs:50:9:50:11 | dir | provenance | | | test.rs:51:9:51:11 | exe | test.rs:55:10:55:12 | exe | provenance | | | test.rs:51:15:51:35 | ...::current_exe | test.rs:51:15:51:37 | ...::current_exe(...) [Ok] | provenance | Src:MaD:4 | -| test.rs:51:15:51:37 | ...::current_exe(...) [Ok] | test.rs:51:15:51:54 | ... .expect(...) | provenance | MaD:15 | +| test.rs:51:15:51:37 | ...::current_exe(...) [Ok] | test.rs:51:15:51:54 | ... .expect(...) | provenance | MaD:16 | | test.rs:51:15:51:54 | ... .expect(...) | test.rs:51:9:51:11 | exe | provenance | | | test.rs:52:9:52:12 | home | test.rs:56:10:56:13 | home | provenance | | | test.rs:52:16:52:33 | ...::home_dir | test.rs:52:16:52:35 | ...::home_dir(...) [Some] | provenance | Src:MaD:5 | -| test.rs:52:16:52:35 | ...::home_dir(...) [Some] | test.rs:52:16:52:52 | ... .expect(...) | provenance | MaD:13 | +| test.rs:52:16:52:35 | ...::home_dir(...) [Some] | test.rs:52:16:52:52 | ... .expect(...) | provenance | MaD:14 | | test.rs:52:16:52:52 | ... .expect(...) | test.rs:52:9:52:12 | home | provenance | | nodes | test.rs:6:10:6:22 | ...::var | semmle.label | ...::var | diff --git a/rust/ql/test/library-tests/dataflow/sources/file/InlineFlow.expected b/rust/ql/test/library-tests/dataflow/sources/file/InlineFlow.expected index 6f012e837a99..876bfe12dc3e 100644 --- a/rust/ql/test/library-tests/dataflow/sources/file/InlineFlow.expected +++ b/rust/ql/test/library-tests/dataflow/sources/file/InlineFlow.expected @@ -35,7 +35,8 @@ models | 34 | Summary: <_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_to_string; Argument[self].Reference; Argument[0].Reference; taint | | 35 | Summary: <_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_u8; Argument[self].Reference; ReturnValue.Future.Field[core::result::Result::Ok(0)]; taint | | 36 | Summary: ::unwrap; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | -| 37 | Summary: ::as_path; Argument[self].Reference; ReturnValue.Reference; value | +| 37 | Summary: ::deref; Argument[self].Reference; ReturnValue.Reference; taint | +| 38 | Summary: ::as_path; Argument[self].Reference; ReturnValue.Reference; value | edges | test.rs:12:13:12:18 | buffer | test.rs:13:14:13:19 | buffer | provenance | | | test.rs:12:31:12:43 | ...::read | test.rs:12:31:12:55 | ...::read(...) [Ok] | provenance | Src:MaD:11 | @@ -51,12 +52,15 @@ edges | test.rs:22:22:22:52 | TryExpr | test.rs:22:13:22:18 | buffer | provenance | | | test.rs:29:13:29:16 | path | test.rs:30:14:30:17 | path | provenance | | | test.rs:29:13:29:16 | path | test.rs:31:14:31:17 | path | provenance | | +| test.rs:29:13:29:16 | path | test.rs:40:14:40:17 | path | provenance | | | test.rs:29:13:29:16 | path | test.rs:41:14:41:17 | path | provenance | | | test.rs:29:20:29:27 | e.path() | test.rs:29:13:29:16 | path | provenance | | | test.rs:29:22:29:25 | path | test.rs:29:20:29:27 | e.path() | provenance | Src:MaD:4 MaD:4 | | test.rs:30:14:30:17 | path | test.rs:30:14:30:25 | path.clone() | provenance | MaD:18 | | test.rs:31:14:31:17 | path | test.rs:31:14:31:25 | path.clone() | provenance | MaD:18 | -| test.rs:31:14:31:25 | path.clone() | test.rs:31:14:31:35 | ... .as_path() | provenance | MaD:37 | +| test.rs:31:14:31:25 | path.clone() | test.rs:31:14:31:35 | ... .as_path() | provenance | MaD:38 | +| test.rs:40:14:40:17 | path | test.rs:40:14:40:32 | path.canonicalize() [Ok] | provenance | MaD:37 | +| test.rs:40:14:40:32 | path.canonicalize() [Ok] | test.rs:40:14:40:41 | ... .unwrap() | provenance | MaD:36 | | test.rs:43:13:43:21 | file_name | test.rs:44:14:44:22 | file_name | provenance | | | test.rs:43:13:43:21 | file_name | test.rs:49:14:49:22 | file_name | provenance | | | test.rs:43:25:43:37 | e.file_name() | test.rs:43:13:43:21 | file_name | provenance | | @@ -273,6 +277,9 @@ nodes | test.rs:31:14:31:17 | path | semmle.label | path | | test.rs:31:14:31:25 | path.clone() | semmle.label | path.clone() | | test.rs:31:14:31:35 | ... .as_path() | semmle.label | ... .as_path() | +| test.rs:40:14:40:17 | path | semmle.label | path | +| test.rs:40:14:40:32 | path.canonicalize() [Ok] | semmle.label | path.canonicalize() [Ok] | +| test.rs:40:14:40:41 | ... .unwrap() | semmle.label | ... .unwrap() | | test.rs:41:14:41:17 | path | semmle.label | path | | test.rs:43:13:43:21 | file_name | semmle.label | file_name | | test.rs:43:25:43:37 | e.file_name() | semmle.label | e.file_name() | @@ -492,6 +499,7 @@ testFailures | test.rs:23:14:23:19 | buffer | test.rs:22:22:22:39 | ...::read_to_string | test.rs:23:14:23:19 | buffer | $@ | test.rs:22:22:22:39 | ...::read_to_string | ...::read_to_string | | test.rs:30:14:30:25 | path.clone() | test.rs:29:22:29:25 | path | test.rs:30:14:30:25 | path.clone() | $@ | test.rs:29:22:29:25 | path | path | | test.rs:31:14:31:35 | ... .as_path() | test.rs:29:22:29:25 | path | test.rs:31:14:31:35 | ... .as_path() | $@ | test.rs:29:22:29:25 | path | path | +| test.rs:40:14:40:41 | ... .unwrap() | test.rs:29:22:29:25 | path | test.rs:40:14:40:41 | ... .unwrap() | $@ | test.rs:29:22:29:25 | path | path | | test.rs:41:14:41:17 | path | test.rs:29:22:29:25 | path | test.rs:41:14:41:17 | path | $@ | test.rs:29:22:29:25 | path | path | | test.rs:44:14:44:30 | file_name.clone() | test.rs:43:27:43:35 | file_name | test.rs:44:14:44:30 | file_name.clone() | $@ | test.rs:43:27:43:35 | file_name | file_name | | test.rs:49:14:49:22 | file_name | test.rs:43:27:43:35 | file_name | test.rs:49:14:49:22 | file_name | $@ | test.rs:43:27:43:35 | file_name | file_name | diff --git a/rust/ql/test/library-tests/dataflow/sources/file/TaintSources.expected b/rust/ql/test/library-tests/dataflow/sources/file/TaintSources.expected index 0fb17232a399..dd1b94de717f 100644 --- a/rust/ql/test/library-tests/dataflow/sources/file/TaintSources.expected +++ b/rust/ql/test/library-tests/dataflow/sources/file/TaintSources.expected @@ -7,6 +7,9 @@ | test.rs:51:52:51:59 | read_dir | Flow source 'FileSource' of type file (DEFAULT). | | test.rs:54:22:54:25 | path | Flow source 'FileSource' of type file (DEFAULT). | | test.rs:55:27:55:35 | file_name | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:57:56:57:63 | read_dir | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:60:22:60:25 | path | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:61:27:61:35 | file_name | Flow source 'FileSource' of type file (DEFAULT). | | test.rs:65:22:65:34 | ...::read_link | Flow source 'FileSource' of type file (DEFAULT). | | test.rs:74:31:74:45 | ...::read | Flow source 'FileSource' of type file (DEFAULT). | | test.rs:79:31:79:45 | ...::read | Flow source 'FileSource' of type file (DEFAULT). | diff --git a/rust/ql/test/library-tests/dataflow/sources/file/test.rs b/rust/ql/test/library-tests/dataflow/sources/file/test.rs index 0124d2a094e0..4aa56a0dd74a 100644 --- a/rust/ql/test/library-tests/dataflow/sources/file/test.rs +++ b/rust/ql/test/library-tests/dataflow/sources/file/test.rs @@ -37,7 +37,7 @@ fn test_fs() -> Result<(), Box> { sink(path.to_path_buf()); // $ MISSING: hasTaintFlow sink(path.file_name().unwrap()); // $ MISSING: hasTaintFlow sink(path.extension().unwrap()); // $ MISSING: hasTaintFlow - sink(path.canonicalize().unwrap()); // $ MISSING: hasTaintFlow + sink(path.canonicalize().unwrap()); // $ hasTaintFlow sink(path); // $ hasTaintFlow let file_name = e.file_name(); // $ Alert[rust/summary/taint-sources] @@ -54,11 +54,11 @@ fn test_fs() -> Result<(), Box> { let path = e.path(); // $ Alert[rust/summary/taint-sources] let file_name = e.file_name(); // $ Alert[rust/summary/taint-sources] } - for entry in std::path::PathBuf::from("directory").read_dir()? { + for entry in std::path::PathBuf::from("directory").read_dir()? { // $ Alert[rust/summary/taint-sources] let e = entry?; - let path = e.path(); // $ MISSING: Alert[rust/summary/taint-sources] - let file_name = e.file_name(); // $ MISSING: Alert[rust/summary/taint-sources] + let path = e.path(); // $ Alert[rust/summary/taint-sources] + let file_name = e.file_name(); // $ Alert[rust/summary/taint-sources] } { diff --git a/rust/ql/test/library-tests/dataflow/sources/net/InlineFlow.expected b/rust/ql/test/library-tests/dataflow/sources/net/InlineFlow.expected index 2b39cf16c428..a5a4846284ed 100644 --- a/rust/ql/test/library-tests/dataflow/sources/net/InlineFlow.expected +++ b/rust/ql/test/library-tests/dataflow/sources/net/InlineFlow.expected @@ -1,93 +1,97 @@ models | 1 | Source: ::connect; ReturnValue.Future.Field[core::result::Result::Ok(0)]; remote | | 2 | Source: ::send_request; ReturnValue.Future.Field[core::result::Result::Ok(0)]; remote | -| 3 | Source: ::connect; ReturnValue.Field[core::result::Result::Ok(0)]; remote | -| 4 | Source: ::connect_timeout; ReturnValue.Field[core::result::Result::Ok(0)]; remote | -| 5 | Source: ::connect; ReturnValue.Future.Field[core::result::Result::Ok(0)]; remote | -| 6 | Source: reqwest::blocking::get; ReturnValue.Field[core::result::Result::Ok(0)]; remote | -| 7 | Source: reqwest::get; ReturnValue.Future.Field[core::result::Result::Ok(0)]; remote | -| 8 | Summary: <_ as core::ops::index::Index>::index; Argument[self].Reference.Element; ReturnValue.Reference; value | -| 9 | Summary: <_ as futures_io::if_std::AsyncBufRead>::poll_fill_buf; Argument[self].Reference; ReturnValue.Field[core::task::poll::Poll::Ready(0)].Field[core::result::Result::Ok(0)]; taint | -| 10 | Summary: <_ as futures_io::if_std::AsyncRead>::poll_read; Argument[self].Reference; Argument[1].Reference; taint | -| 11 | Summary: <_ as futures_util::io::AsyncBufReadExt>::fill_buf; Argument[self].Reference; ReturnValue.Future.Field[core::result::Result::Ok(0)]; taint | -| 12 | Summary: <_ as futures_util::io::AsyncBufReadExt>::read_line; Argument[self].Reference; Argument[0].Reference; taint | -| 13 | Summary: <_ as futures_util::io::AsyncBufReadExt>::read_until; Argument[self].Reference; Argument[1].Reference; taint | -| 14 | Summary: <_ as futures_util::io::AsyncReadExt>::read; Argument[self].Reference; Argument[0].Reference; taint | -| 15 | Summary: <_ as futures_util::io::AsyncReadExt>::read_to_end; Argument[self].Reference; Argument[0].Reference; taint | -| 16 | Summary: <_ as std::io::BufRead>::read_line; Argument[self].Reference; Argument[0].Reference; taint | -| 17 | Summary: <_ as std::io::Read>::read; Argument[self].Reference; Argument[0].Reference; taint | -| 18 | Summary: <_ as std::io::Read>::take; Argument[self]; ReturnValue; taint | -| 19 | Summary: <_ as tokio::io::util::async_read_ext::AsyncReadExt>::read; Argument[self].Reference; Argument[0].Reference; taint | -| 20 | Summary: ::unwrap; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | -| 21 | Summary: ::new; Argument[0].Reference; ReturnValue; value | -| 22 | Summary: ::new; Argument[0]; ReturnValue.Field[core::pin::Pin::pointer]; value | -| 23 | Summary: ::unwrap; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | -| 24 | Summary: ::connect; Argument[1]; ReturnValue.Future.Field[core::result::Result::Ok(0)]; taint | -| 25 | Summary: ::new; Argument[0]; ReturnValue; taint | -| 26 | Summary: ::bytes; Argument[self]; ReturnValue.Future.Field[core::result::Result::Ok(0)]; taint | -| 27 | Summary: ::chunk; Argument[self].Reference; ReturnValue.Future.Field[core::result::Result::Ok(0)].Field[core::option::Option::Some(0)]; taint | -| 28 | Summary: ::text; Argument[self]; ReturnValue.Future.Field[core::result::Result::Ok(0)]; taint | -| 29 | Summary: ::bytes; Argument[self]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | -| 30 | Summary: ::text; Argument[self]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | -| 31 | Summary: ::text_with_charset; Argument[self]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | -| 32 | Summary: ::new; Argument[0]; ReturnValue; taint | -| 33 | Summary: ::peek; Argument[self].Reference; Argument[0].Reference; taint | -| 34 | Summary: ::try_read; Argument[self].Reference; Argument[0].Reference; taint | -| 35 | Summary: ::try_read_buf; Argument[self].Reference; Argument[0].Reference; taint | +| 3 | Source: ::new; ReturnValue.Field[core::result::Result::Ok(0)]; remote | +| 4 | Source: ::connect; ReturnValue.Field[core::result::Result::Ok(0)]; remote | +| 5 | Source: ::connect_timeout; ReturnValue.Field[core::result::Result::Ok(0)]; remote | +| 6 | Source: ::connect; ReturnValue.Future.Field[core::result::Result::Ok(0)]; remote | +| 7 | Source: reqwest::blocking::get; ReturnValue.Field[core::result::Result::Ok(0)]; remote | +| 8 | Source: reqwest::get; ReturnValue.Future.Field[core::result::Result::Ok(0)]; remote | +| 9 | Summary: <_ as core::ops::index::Index>::index; Argument[self].Reference.Element; ReturnValue.Reference; value | +| 10 | Summary: <_ as futures_io::if_std::AsyncBufRead>::poll_fill_buf; Argument[self].Reference; ReturnValue.Field[core::task::poll::Poll::Ready(0)].Field[core::result::Result::Ok(0)]; taint | +| 11 | Summary: <_ as futures_io::if_std::AsyncRead>::poll_read; Argument[self].Reference; Argument[1].Reference; taint | +| 12 | Summary: <_ as futures_util::io::AsyncBufReadExt>::fill_buf; Argument[self].Reference; ReturnValue.Future.Field[core::result::Result::Ok(0)]; taint | +| 13 | Summary: <_ as futures_util::io::AsyncBufReadExt>::read_line; Argument[self].Reference; Argument[0].Reference; taint | +| 14 | Summary: <_ as futures_util::io::AsyncBufReadExt>::read_until; Argument[self].Reference; Argument[1].Reference; taint | +| 15 | Summary: <_ as futures_util::io::AsyncReadExt>::read; Argument[self].Reference; Argument[0].Reference; taint | +| 16 | Summary: <_ as futures_util::io::AsyncReadExt>::read_to_end; Argument[self].Reference; Argument[0].Reference; taint | +| 17 | Summary: <_ as std::io::BufRead>::read_line; Argument[self].Reference; Argument[0].Reference; taint | +| 18 | Summary: <_ as std::io::Read>::read; Argument[self].Reference; Argument[0].Reference; taint | +| 19 | Summary: <_ as std::io::Read>::read_to_end; Argument[self].Reference; Argument[0].Reference; taint | +| 20 | Summary: <_ as std::io::Read>::read_to_string; Argument[self].Reference; Argument[0].Reference; taint | +| 21 | Summary: <_ as std::io::Read>::take; Argument[self]; ReturnValue; taint | +| 22 | Summary: <_ as tokio::io::util::async_read_ext::AsyncReadExt>::read; Argument[self].Reference; Argument[0].Reference; taint | +| 23 | Summary: ::unwrap; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | +| 24 | Summary: ::new; Argument[0].Reference; ReturnValue; value | +| 25 | Summary: ::new; Argument[0]; ReturnValue.Field[core::pin::Pin::pointer]; value | +| 26 | Summary: ::unwrap; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | +| 27 | Summary: ::connect; Argument[1]; ReturnValue.Future.Field[core::result::Result::Ok(0)]; taint | +| 28 | Summary: ::new; Argument[0]; ReturnValue; taint | +| 29 | Summary: ::bytes; Argument[self]; ReturnValue.Future.Field[core::result::Result::Ok(0)]; taint | +| 30 | Summary: ::chunk; Argument[self].Reference; ReturnValue.Future.Field[core::result::Result::Ok(0)].Field[core::option::Option::Some(0)]; taint | +| 31 | Summary: ::text; Argument[self]; ReturnValue.Future.Field[core::result::Result::Ok(0)]; taint | +| 32 | Summary: ::bytes; Argument[self]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | +| 33 | Summary: ::text; Argument[self]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | +| 34 | Summary: ::text_with_charset; Argument[self]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | +| 35 | Summary: ::reader; Argument[self]; ReturnValue; taint | +| 36 | Summary: ::new; Argument[0]; ReturnValue; taint | +| 37 | Summary: ::peek; Argument[self].Reference; Argument[0].Reference; taint | +| 38 | Summary: ::try_read; Argument[self].Reference; Argument[0].Reference; taint | +| 39 | Summary: ::try_read_buf; Argument[self].Reference; Argument[0].Reference; taint | edges | test.rs:11:9:11:22 | remote_string1 | test.rs:12:10:12:23 | remote_string1 | provenance | | -| test.rs:11:26:11:47 | ...::get | test.rs:11:26:11:62 | ...::get(...) [Ok] | provenance | Src:MaD:6 | +| test.rs:11:26:11:47 | ...::get | test.rs:11:26:11:62 | ...::get(...) [Ok] | provenance | Src:MaD:7 | | test.rs:11:26:11:62 | ...::get(...) [Ok] | test.rs:11:26:11:63 | TryExpr | provenance | | -| test.rs:11:26:11:63 | TryExpr | test.rs:11:26:11:70 | ... .text() [Ok] | provenance | MaD:30 | +| test.rs:11:26:11:63 | TryExpr | test.rs:11:26:11:70 | ... .text() [Ok] | provenance | MaD:33 | | test.rs:11:26:11:70 | ... .text() [Ok] | test.rs:11:26:11:71 | TryExpr | provenance | | | test.rs:11:26:11:71 | TryExpr | test.rs:11:9:11:22 | remote_string1 | provenance | | | test.rs:14:9:14:22 | remote_string2 | test.rs:15:10:15:23 | remote_string2 | provenance | | -| test.rs:14:26:14:47 | ...::get | test.rs:14:26:14:62 | ...::get(...) [Ok] | provenance | Src:MaD:6 | -| test.rs:14:26:14:62 | ...::get(...) [Ok] | test.rs:14:26:14:71 | ... .unwrap() | provenance | MaD:23 | -| test.rs:14:26:14:71 | ... .unwrap() | test.rs:14:26:14:78 | ... .text() [Ok] | provenance | MaD:30 | -| test.rs:14:26:14:78 | ... .text() [Ok] | test.rs:14:26:14:87 | ... .unwrap() | provenance | MaD:23 | +| test.rs:14:26:14:47 | ...::get | test.rs:14:26:14:62 | ...::get(...) [Ok] | provenance | Src:MaD:7 | +| test.rs:14:26:14:62 | ...::get(...) [Ok] | test.rs:14:26:14:71 | ... .unwrap() | provenance | MaD:26 | +| test.rs:14:26:14:71 | ... .unwrap() | test.rs:14:26:14:78 | ... .text() [Ok] | provenance | MaD:33 | +| test.rs:14:26:14:78 | ... .text() [Ok] | test.rs:14:26:14:87 | ... .unwrap() | provenance | MaD:26 | | test.rs:14:26:14:87 | ... .unwrap() | test.rs:14:9:14:22 | remote_string2 | provenance | | | test.rs:17:9:17:22 | remote_string3 | test.rs:18:10:18:23 | remote_string3 | provenance | | -| test.rs:17:26:17:47 | ...::get | test.rs:17:26:17:62 | ...::get(...) [Ok] | provenance | Src:MaD:6 | -| test.rs:17:26:17:62 | ...::get(...) [Ok] | test.rs:17:26:17:71 | ... .unwrap() | provenance | MaD:23 | -| test.rs:17:26:17:71 | ... .unwrap() | test.rs:17:26:17:98 | ... .text_with_charset(...) [Ok] | provenance | MaD:31 | -| test.rs:17:26:17:98 | ... .text_with_charset(...) [Ok] | test.rs:17:26:17:107 | ... .unwrap() | provenance | MaD:23 | +| test.rs:17:26:17:47 | ...::get | test.rs:17:26:17:62 | ...::get(...) [Ok] | provenance | Src:MaD:7 | +| test.rs:17:26:17:62 | ...::get(...) [Ok] | test.rs:17:26:17:71 | ... .unwrap() | provenance | MaD:26 | +| test.rs:17:26:17:71 | ... .unwrap() | test.rs:17:26:17:98 | ... .text_with_charset(...) [Ok] | provenance | MaD:34 | +| test.rs:17:26:17:98 | ... .text_with_charset(...) [Ok] | test.rs:17:26:17:107 | ... .unwrap() | provenance | MaD:26 | | test.rs:17:26:17:107 | ... .unwrap() | test.rs:17:9:17:22 | remote_string3 | provenance | | | test.rs:20:9:20:22 | remote_string4 | test.rs:21:10:21:23 | remote_string4 | provenance | | -| test.rs:20:26:20:47 | ...::get | test.rs:20:26:20:62 | ...::get(...) [Ok] | provenance | Src:MaD:6 | -| test.rs:20:26:20:62 | ...::get(...) [Ok] | test.rs:20:26:20:71 | ... .unwrap() | provenance | MaD:23 | -| test.rs:20:26:20:71 | ... .unwrap() | test.rs:20:26:20:79 | ... .bytes() [Ok] | provenance | MaD:29 | -| test.rs:20:26:20:79 | ... .bytes() [Ok] | test.rs:20:26:20:88 | ... .unwrap() | provenance | MaD:23 | +| test.rs:20:26:20:47 | ...::get | test.rs:20:26:20:62 | ...::get(...) [Ok] | provenance | Src:MaD:7 | +| test.rs:20:26:20:62 | ...::get(...) [Ok] | test.rs:20:26:20:71 | ... .unwrap() | provenance | MaD:26 | +| test.rs:20:26:20:71 | ... .unwrap() | test.rs:20:26:20:79 | ... .bytes() [Ok] | provenance | MaD:32 | +| test.rs:20:26:20:79 | ... .bytes() [Ok] | test.rs:20:26:20:88 | ... .unwrap() | provenance | MaD:26 | | test.rs:20:26:20:88 | ... .unwrap() | test.rs:20:9:20:22 | remote_string4 | provenance | | | test.rs:23:9:23:22 | remote_string5 | test.rs:24:10:24:23 | remote_string5 | provenance | | -| test.rs:23:26:23:37 | ...::get | test.rs:23:26:23:52 | ...::get(...) [future, Ok] | provenance | Src:MaD:7 | +| test.rs:23:26:23:37 | ...::get | test.rs:23:26:23:52 | ...::get(...) [future, Ok] | provenance | Src:MaD:8 | | test.rs:23:26:23:52 | ...::get(...) [future, Ok] | test.rs:23:26:23:58 | await ... [Ok] | provenance | | | test.rs:23:26:23:58 | await ... [Ok] | test.rs:23:26:23:59 | TryExpr | provenance | | -| test.rs:23:26:23:59 | TryExpr | test.rs:23:26:23:66 | ... .text() [future, Ok] | provenance | MaD:28 | +| test.rs:23:26:23:59 | TryExpr | test.rs:23:26:23:66 | ... .text() [future, Ok] | provenance | MaD:31 | | test.rs:23:26:23:66 | ... .text() [future, Ok] | test.rs:23:26:23:72 | await ... [Ok] | provenance | | | test.rs:23:26:23:72 | await ... [Ok] | test.rs:23:26:23:73 | TryExpr | provenance | | | test.rs:23:26:23:73 | TryExpr | test.rs:23:9:23:22 | remote_string5 | provenance | | | test.rs:26:9:26:22 | remote_string6 | test.rs:27:10:27:23 | remote_string6 | provenance | | -| test.rs:26:26:26:37 | ...::get | test.rs:26:26:26:52 | ...::get(...) [future, Ok] | provenance | Src:MaD:7 | +| test.rs:26:26:26:37 | ...::get | test.rs:26:26:26:52 | ...::get(...) [future, Ok] | provenance | Src:MaD:8 | | test.rs:26:26:26:52 | ...::get(...) [future, Ok] | test.rs:26:26:26:58 | await ... [Ok] | provenance | | | test.rs:26:26:26:58 | await ... [Ok] | test.rs:26:26:26:59 | TryExpr | provenance | | -| test.rs:26:26:26:59 | TryExpr | test.rs:26:26:26:67 | ... .bytes() [future, Ok] | provenance | MaD:26 | +| test.rs:26:26:26:59 | TryExpr | test.rs:26:26:26:67 | ... .bytes() [future, Ok] | provenance | MaD:29 | | test.rs:26:26:26:67 | ... .bytes() [future, Ok] | test.rs:26:26:26:73 | await ... [Ok] | provenance | | | test.rs:26:26:26:73 | await ... [Ok] | test.rs:26:26:26:74 | TryExpr | provenance | | | test.rs:26:26:26:74 | TryExpr | test.rs:26:9:26:22 | remote_string6 | provenance | | | test.rs:29:9:29:20 | mut request1 | test.rs:30:10:30:17 | request1 | provenance | | | test.rs:29:9:29:20 | mut request1 | test.rs:31:29:31:36 | request1 | provenance | | -| test.rs:29:24:29:35 | ...::get | test.rs:29:24:29:50 | ...::get(...) [future, Ok] | provenance | Src:MaD:7 | +| test.rs:29:24:29:35 | ...::get | test.rs:29:24:29:50 | ...::get(...) [future, Ok] | provenance | Src:MaD:8 | | test.rs:29:24:29:50 | ...::get(...) [future, Ok] | test.rs:29:24:29:56 | await ... [Ok] | provenance | | | test.rs:29:24:29:56 | await ... [Ok] | test.rs:29:24:29:57 | TryExpr | provenance | | | test.rs:29:24:29:57 | TryExpr | test.rs:29:9:29:20 | mut request1 | provenance | | -| test.rs:30:10:30:17 | request1 | test.rs:30:10:30:25 | request1.chunk() [future, Ok, Some] | provenance | MaD:27 | +| test.rs:30:10:30:17 | request1 | test.rs:30:10:30:25 | request1.chunk() [future, Ok, Some] | provenance | MaD:30 | | test.rs:30:10:30:25 | request1.chunk() [future, Ok, Some] | test.rs:30:10:30:31 | await ... [Ok, Some] | provenance | | | test.rs:30:10:30:31 | await ... [Ok, Some] | test.rs:30:10:30:32 | TryExpr [Some] | provenance | | -| test.rs:30:10:30:32 | TryExpr [Some] | test.rs:30:10:30:41 | ... .unwrap() | provenance | MaD:20 | +| test.rs:30:10:30:32 | TryExpr [Some] | test.rs:30:10:30:41 | ... .unwrap() | provenance | MaD:23 | | test.rs:31:15:31:25 | Some(...) [Some] | test.rs:31:20:31:24 | chunk | provenance | | | test.rs:31:20:31:24 | chunk | test.rs:32:14:32:18 | chunk | provenance | | -| test.rs:31:29:31:36 | request1 | test.rs:31:29:31:44 | request1.chunk() [future, Ok, Some] | provenance | MaD:27 | +| test.rs:31:29:31:36 | request1 | test.rs:31:29:31:44 | request1.chunk() [future, Ok, Some] | provenance | MaD:30 | | test.rs:31:29:31:44 | request1.chunk() [future, Ok, Some] | test.rs:31:29:31:50 | await ... [Ok, Some] | provenance | | | test.rs:31:29:31:50 | await ... [Ok, Some] | test.rs:31:29:31:51 | TryExpr [Some] | provenance | | | test.rs:31:29:31:51 | TryExpr [Some] | test.rs:31:15:31:25 | Some(...) [Some] | provenance | | @@ -105,24 +109,24 @@ edges | test.rs:67:31:67:42 | send_request | test.rs:67:24:67:51 | sender.send_request(...) [future, Ok] | provenance | Src:MaD:2 | | test.rs:68:11:68:18 | response | test.rs:68:10:68:18 | &response | provenance | | | test.rs:155:13:155:22 | mut stream | test.rs:162:17:162:22 | stream | provenance | | -| test.rs:155:26:155:53 | ...::connect | test.rs:155:26:155:62 | ...::connect(...) [Ok] | provenance | Src:MaD:3 | +| test.rs:155:26:155:53 | ...::connect | test.rs:155:26:155:62 | ...::connect(...) [Ok] | provenance | Src:MaD:4 | | test.rs:155:26:155:62 | ...::connect(...) [Ok] | test.rs:155:26:155:63 | TryExpr | provenance | | | test.rs:155:26:155:63 | TryExpr | test.rs:155:13:155:22 | mut stream | provenance | | -| test.rs:162:17:162:22 | stream | test.rs:162:29:162:39 | [post] &mut buffer [&ref] | provenance | MaD:17 | +| test.rs:162:17:162:22 | stream | test.rs:162:29:162:39 | [post] &mut buffer [&ref] | provenance | MaD:18 | | test.rs:162:29:162:39 | [post] &mut buffer [&ref] | test.rs:162:34:162:39 | [post] buffer | provenance | | | test.rs:162:34:162:39 | [post] buffer | test.rs:165:15:165:20 | buffer | provenance | | | test.rs:162:34:162:39 | [post] buffer | test.rs:166:14:166:19 | buffer | provenance | | | test.rs:165:15:165:20 | buffer | test.rs:165:14:165:20 | &buffer | provenance | | -| test.rs:166:14:166:19 | buffer | test.rs:166:14:166:22 | buffer[0] | provenance | MaD:8 | +| test.rs:166:14:166:19 | buffer | test.rs:166:14:166:22 | buffer[0] | provenance | MaD:9 | | test.rs:174:13:174:22 | mut stream | test.rs:182:58:182:63 | stream | provenance | | -| test.rs:174:26:174:61 | ...::connect_timeout | test.rs:174:26:174:105 | ...::connect_timeout(...) [Ok] | provenance | Src:MaD:4 | +| test.rs:174:26:174:61 | ...::connect_timeout | test.rs:174:26:174:105 | ...::connect_timeout(...) [Ok] | provenance | Src:MaD:5 | | test.rs:174:26:174:105 | ...::connect_timeout(...) [Ok] | test.rs:174:26:174:106 | TryExpr | provenance | | | test.rs:174:26:174:106 | TryExpr | test.rs:174:13:174:22 | mut stream | provenance | | | test.rs:182:21:182:30 | mut reader | test.rs:185:27:185:32 | reader | provenance | | -| test.rs:182:34:182:64 | ...::new(...) | test.rs:182:34:182:74 | ... .take(...) | provenance | MaD:18 | +| test.rs:182:34:182:64 | ...::new(...) | test.rs:182:34:182:74 | ... .take(...) | provenance | MaD:21 | | test.rs:182:34:182:74 | ... .take(...) | test.rs:182:21:182:30 | mut reader | provenance | | -| test.rs:182:58:182:63 | stream | test.rs:182:34:182:64 | ...::new(...) | provenance | MaD:32 | -| test.rs:185:27:185:32 | reader | test.rs:185:44:185:52 | [post] &mut line [&ref] | provenance | MaD:16 | +| test.rs:182:58:182:63 | stream | test.rs:182:34:182:64 | ...::new(...) | provenance | MaD:36 | +| test.rs:185:27:185:32 | reader | test.rs:185:44:185:52 | [post] &mut line [&ref] | provenance | MaD:17 | | test.rs:185:44:185:52 | [post] &mut line [&ref] | test.rs:185:49:185:52 | [post] line | provenance | | | test.rs:185:49:185:52 | [post] line | test.rs:192:35:192:38 | line | provenance | | | test.rs:192:35:192:38 | line | test.rs:192:34:192:38 | &line | provenance | | @@ -130,30 +134,53 @@ edges | test.rs:224:9:224:24 | mut tokio_stream | test.rs:236:18:236:29 | tokio_stream | provenance | | | test.rs:224:9:224:24 | mut tokio_stream | test.rs:252:19:252:30 | tokio_stream | provenance | | | test.rs:224:9:224:24 | mut tokio_stream | test.rs:275:19:275:30 | tokio_stream | provenance | | -| test.rs:224:28:224:57 | ...::connect | test.rs:224:28:224:66 | ...::connect(...) [future, Ok] | provenance | Src:MaD:5 | +| test.rs:224:28:224:57 | ...::connect | test.rs:224:28:224:66 | ...::connect(...) [future, Ok] | provenance | Src:MaD:6 | | test.rs:224:28:224:66 | ...::connect(...) [future, Ok] | test.rs:224:28:224:72 | await ... [Ok] | provenance | | | test.rs:224:28:224:72 | await ... [Ok] | test.rs:224:28:224:73 | TryExpr | provenance | | | test.rs:224:28:224:73 | TryExpr | test.rs:224:9:224:24 | mut tokio_stream | provenance | | -| test.rs:232:17:232:28 | tokio_stream | test.rs:232:35:232:46 | [post] &mut buffer1 [&ref] | provenance | MaD:33 | +| test.rs:232:17:232:28 | tokio_stream | test.rs:232:35:232:46 | [post] &mut buffer1 [&ref] | provenance | MaD:37 | | test.rs:232:35:232:46 | [post] &mut buffer1 [&ref] | test.rs:232:40:232:46 | [post] buffer1 | provenance | | | test.rs:232:40:232:46 | [post] buffer1 | test.rs:239:15:239:21 | buffer1 | provenance | | | test.rs:232:40:232:46 | [post] buffer1 | test.rs:240:14:240:20 | buffer1 | provenance | | -| test.rs:236:18:236:29 | tokio_stream | test.rs:236:36:236:47 | [post] &mut buffer2 [&ref] | provenance | MaD:19 | +| test.rs:236:18:236:29 | tokio_stream | test.rs:236:36:236:47 | [post] &mut buffer2 [&ref] | provenance | MaD:22 | | test.rs:236:36:236:47 | [post] &mut buffer2 [&ref] | test.rs:236:41:236:47 | [post] buffer2 | provenance | | | test.rs:236:41:236:47 | [post] buffer2 | test.rs:243:15:243:21 | buffer2 | provenance | | | test.rs:236:41:236:47 | [post] buffer2 | test.rs:244:14:244:20 | buffer2 | provenance | | | test.rs:239:15:239:21 | buffer1 | test.rs:239:14:239:21 | &buffer1 | provenance | | -| test.rs:240:14:240:20 | buffer1 | test.rs:240:14:240:23 | buffer1[0] | provenance | MaD:8 | +| test.rs:240:14:240:20 | buffer1 | test.rs:240:14:240:23 | buffer1[0] | provenance | MaD:9 | | test.rs:243:15:243:21 | buffer2 | test.rs:243:14:243:21 | &buffer2 | provenance | | -| test.rs:244:14:244:20 | buffer2 | test.rs:244:14:244:23 | buffer2[0] | provenance | MaD:8 | -| test.rs:252:19:252:30 | tokio_stream | test.rs:252:41:252:51 | [post] &mut buffer [&ref] | provenance | MaD:34 | +| test.rs:244:14:244:20 | buffer2 | test.rs:244:14:244:23 | buffer2[0] | provenance | MaD:9 | +| test.rs:252:19:252:30 | tokio_stream | test.rs:252:41:252:51 | [post] &mut buffer [&ref] | provenance | MaD:38 | | test.rs:252:41:252:51 | [post] &mut buffer [&ref] | test.rs:252:46:252:51 | [post] buffer | provenance | | | test.rs:252:46:252:51 | [post] buffer | test.rs:259:27:259:32 | buffer | provenance | | | test.rs:259:27:259:32 | buffer | test.rs:259:26:259:32 | &buffer | provenance | | -| test.rs:275:19:275:30 | tokio_stream | test.rs:275:45:275:55 | [post] &mut buffer [&ref] | provenance | MaD:35 | +| test.rs:275:19:275:30 | tokio_stream | test.rs:275:45:275:55 | [post] &mut buffer [&ref] | provenance | MaD:39 | | test.rs:275:45:275:55 | [post] &mut buffer [&ref] | test.rs:275:50:275:55 | [post] buffer | provenance | | | test.rs:275:50:275:55 | [post] buffer | test.rs:282:27:282:32 | buffer | provenance | | | test.rs:282:27:282:32 | buffer | test.rs:282:26:282:32 | &buffer | provenance | | +| test.rs:332:9:332:18 | mut client | test.rs:333:22:333:27 | client | provenance | | +| test.rs:332:22:332:50 | ...::new | test.rs:332:22:332:75 | ...::new(...) [Ok] | provenance | Src:MaD:3 | +| test.rs:332:22:332:75 | ...::new(...) [Ok] | test.rs:332:22:332:84 | ... .unwrap() | provenance | MaD:26 | +| test.rs:332:22:332:84 | ... .unwrap() | test.rs:332:9:332:18 | mut client | provenance | | +| test.rs:333:9:333:18 | mut reader | test.rs:334:11:334:16 | reader | provenance | | +| test.rs:333:9:333:18 | mut reader | test.rs:338:22:338:27 | reader | provenance | | +| test.rs:333:9:333:18 | mut reader | test.rs:344:22:344:27 | reader | provenance | | +| test.rs:333:9:333:18 | mut reader | test.rs:350:22:350:27 | reader | provenance | | +| test.rs:333:22:333:27 | client | test.rs:333:22:333:36 | client.reader() | provenance | MaD:35 | +| test.rs:333:22:333:36 | client.reader() | test.rs:333:9:333:18 | mut reader | provenance | | +| test.rs:334:11:334:16 | reader | test.rs:334:10:334:16 | &reader | provenance | | +| test.rs:338:22:338:27 | reader | test.rs:338:34:338:44 | [post] &mut buffer [&ref] | provenance | MaD:18 | +| test.rs:338:34:338:44 | [post] &mut buffer [&ref] | test.rs:338:39:338:44 | [post] buffer | provenance | | +| test.rs:338:39:338:44 | [post] buffer | test.rs:339:15:339:20 | buffer | provenance | | +| test.rs:339:15:339:20 | buffer | test.rs:339:14:339:20 | &buffer | provenance | | +| test.rs:344:22:344:27 | reader | test.rs:344:41:344:51 | [post] &mut buffer [&ref] | provenance | MaD:19 | +| test.rs:344:41:344:51 | [post] &mut buffer [&ref] | test.rs:344:46:344:51 | [post] buffer | provenance | | +| test.rs:344:46:344:51 | [post] buffer | test.rs:345:15:345:20 | buffer | provenance | | +| test.rs:345:15:345:20 | buffer | test.rs:345:14:345:20 | &buffer | provenance | | +| test.rs:350:22:350:27 | reader | test.rs:350:44:350:54 | [post] &mut buffer [&ref] | provenance | MaD:20 | +| test.rs:350:44:350:54 | [post] &mut buffer [&ref] | test.rs:350:49:350:54 | [post] buffer | provenance | | +| test.rs:350:49:350:54 | [post] buffer | test.rs:351:15:351:20 | buffer | provenance | | +| test.rs:351:15:351:20 | buffer | test.rs:351:14:351:20 | &buffer | provenance | | | test.rs:373:13:373:15 | tcp | test.rs:374:15:374:17 | tcp | provenance | | | test.rs:373:13:373:15 | tcp | test.rs:380:57:380:59 | tcp | provenance | | | test.rs:373:19:373:36 | ...::connect | test.rs:373:19:373:41 | ...::connect(...) [future, Ok] | provenance | Src:MaD:1 | @@ -169,38 +196,38 @@ edges | test.rs:380:26:380:60 | connector.connect(...) [future, Ok] | test.rs:380:26:380:66 | await ... [Ok] | provenance | | | test.rs:380:26:380:66 | await ... [Ok] | test.rs:380:26:380:67 | TryExpr | provenance | | | test.rs:380:26:380:67 | TryExpr | test.rs:380:13:380:22 | mut reader | provenance | | -| test.rs:380:57:380:59 | tcp | test.rs:380:26:380:60 | connector.connect(...) [future, Ok] | provenance | MaD:24 | +| test.rs:380:57:380:59 | tcp | test.rs:380:26:380:60 | connector.connect(...) [future, Ok] | provenance | MaD:27 | | test.rs:381:15:381:20 | reader | test.rs:381:14:381:20 | &reader | provenance | | | test.rs:386:17:386:26 | mut pinned | test.rs:387:19:387:24 | pinned | provenance | | | test.rs:386:17:386:26 | mut pinned | test.rs:389:30:389:35 | pinned | provenance | | | test.rs:386:17:386:26 | mut pinned [Pin, &ref] | test.rs:387:19:387:24 | pinned [Pin, &ref] | provenance | | | test.rs:386:30:386:50 | ...::new(...) | test.rs:386:17:386:26 | mut pinned | provenance | | | test.rs:386:30:386:50 | ...::new(...) [Pin, &ref] | test.rs:386:17:386:26 | mut pinned [Pin, &ref] | provenance | | -| test.rs:386:39:386:49 | &mut reader [&ref] | test.rs:386:30:386:50 | ...::new(...) | provenance | MaD:21 | -| test.rs:386:39:386:49 | &mut reader [&ref] | test.rs:386:30:386:50 | ...::new(...) [Pin, &ref] | provenance | MaD:22 | +| test.rs:386:39:386:49 | &mut reader [&ref] | test.rs:386:30:386:50 | ...::new(...) | provenance | MaD:24 | +| test.rs:386:39:386:49 | &mut reader [&ref] | test.rs:386:30:386:50 | ...::new(...) [Pin, &ref] | provenance | MaD:25 | | test.rs:386:44:386:49 | reader | test.rs:386:39:386:49 | &mut reader [&ref] | provenance | | | test.rs:387:19:387:24 | pinned | test.rs:387:18:387:24 | &pinned | provenance | | | test.rs:387:19:387:24 | pinned [Pin, &ref] | test.rs:387:18:387:24 | &pinned | provenance | | -| test.rs:389:30:389:35 | pinned | test.rs:389:56:389:66 | [post] &mut buffer [&ref] | provenance | MaD:10 | +| test.rs:389:30:389:35 | pinned | test.rs:389:56:389:66 | [post] &mut buffer [&ref] | provenance | MaD:11 | | test.rs:389:56:389:66 | [post] &mut buffer [&ref] | test.rs:389:61:389:66 | [post] buffer | provenance | | | test.rs:389:61:389:66 | [post] buffer | test.rs:391:23:391:28 | buffer | provenance | | | test.rs:389:61:389:66 | [post] buffer | test.rs:392:23:392:28 | buffer | provenance | | | test.rs:389:61:389:66 | [post] buffer | test.rs:392:23:392:33 | buffer[...] | provenance | | | test.rs:391:23:391:28 | buffer | test.rs:391:22:391:28 | &buffer | provenance | | -| test.rs:392:23:392:28 | buffer | test.rs:392:23:392:33 | buffer[...] | provenance | MaD:8 | +| test.rs:392:23:392:28 | buffer | test.rs:392:23:392:33 | buffer[...] | provenance | MaD:9 | | test.rs:392:23:392:33 | buffer[...] | test.rs:392:22:392:33 | &... | provenance | | -| test.rs:399:63:399:73 | &mut reader [&ref] | test.rs:399:76:399:87 | [post] &mut buffer1 [&ref] | provenance | MaD:14 | +| test.rs:399:63:399:73 | &mut reader [&ref] | test.rs:399:76:399:87 | [post] &mut buffer1 [&ref] | provenance | MaD:15 | | test.rs:399:68:399:73 | reader | test.rs:399:63:399:73 | &mut reader [&ref] | provenance | | | test.rs:399:76:399:87 | [post] &mut buffer1 [&ref] | test.rs:399:81:399:87 | [post] buffer1 | provenance | | | test.rs:399:81:399:87 | [post] buffer1 | test.rs:400:19:400:25 | buffer1 | provenance | | | test.rs:399:81:399:87 | [post] buffer1 | test.rs:400:19:400:40 | buffer1[...] | provenance | | -| test.rs:400:19:400:25 | buffer1 | test.rs:400:19:400:40 | buffer1[...] | provenance | MaD:8 | +| test.rs:400:19:400:25 | buffer1 | test.rs:400:19:400:40 | buffer1[...] | provenance | MaD:9 | | test.rs:400:19:400:40 | buffer1[...] | test.rs:400:18:400:40 | &... | provenance | | -| test.rs:403:31:403:36 | reader | test.rs:403:43:403:54 | [post] &mut buffer2 [&ref] | provenance | MaD:14 | +| test.rs:403:31:403:36 | reader | test.rs:403:43:403:54 | [post] &mut buffer2 [&ref] | provenance | MaD:15 | | test.rs:403:43:403:54 | [post] &mut buffer2 [&ref] | test.rs:403:48:403:54 | [post] buffer2 | provenance | | | test.rs:403:48:403:54 | [post] buffer2 | test.rs:405:19:405:25 | buffer2 | provenance | | | test.rs:403:48:403:54 | [post] buffer2 | test.rs:405:19:405:40 | buffer2[...] | provenance | | -| test.rs:405:19:405:25 | buffer2 | test.rs:405:19:405:40 | buffer2[...] | provenance | MaD:8 | +| test.rs:405:19:405:25 | buffer2 | test.rs:405:19:405:40 | buffer2[...] | provenance | MaD:9 | | test.rs:405:19:405:40 | buffer2[...] | test.rs:405:18:405:40 | &... | provenance | | | test.rs:408:13:408:23 | mut reader2 | test.rs:409:15:409:21 | reader2 | provenance | | | test.rs:408:13:408:23 | mut reader2 | test.rs:413:44:413:50 | reader2 | provenance | | @@ -215,30 +242,30 @@ edges | test.rs:408:13:408:23 | mut reader2 | test.rs:493:31:493:37 | reader2 | provenance | | | test.rs:408:13:408:23 | mut reader2 | test.rs:500:31:500:37 | reader2 | provenance | | | test.rs:408:27:408:61 | ...::new(...) | test.rs:408:13:408:23 | mut reader2 | provenance | | -| test.rs:408:55:408:60 | reader | test.rs:408:27:408:61 | ...::new(...) | provenance | MaD:25 | +| test.rs:408:55:408:60 | reader | test.rs:408:27:408:61 | ...::new(...) | provenance | MaD:28 | | test.rs:409:15:409:21 | reader2 | test.rs:409:14:409:21 | &reader2 | provenance | | | test.rs:413:17:413:26 | mut pinned | test.rs:414:19:414:24 | pinned | provenance | | | test.rs:413:17:413:26 | mut pinned | test.rs:416:26:416:31 | pinned | provenance | | | test.rs:413:17:413:26 | mut pinned [Pin, &ref] | test.rs:414:19:414:24 | pinned [Pin, &ref] | provenance | | | test.rs:413:30:413:51 | ...::new(...) | test.rs:413:17:413:26 | mut pinned | provenance | | | test.rs:413:30:413:51 | ...::new(...) [Pin, &ref] | test.rs:413:17:413:26 | mut pinned [Pin, &ref] | provenance | | -| test.rs:413:39:413:50 | &mut reader2 [&ref] | test.rs:413:30:413:51 | ...::new(...) | provenance | MaD:21 | -| test.rs:413:39:413:50 | &mut reader2 [&ref] | test.rs:413:30:413:51 | ...::new(...) [Pin, &ref] | provenance | MaD:22 | +| test.rs:413:39:413:50 | &mut reader2 [&ref] | test.rs:413:30:413:51 | ...::new(...) | provenance | MaD:24 | +| test.rs:413:39:413:50 | &mut reader2 [&ref] | test.rs:413:30:413:51 | ...::new(...) [Pin, &ref] | provenance | MaD:25 | | test.rs:413:44:413:50 | reader2 | test.rs:413:39:413:50 | &mut reader2 [&ref] | provenance | | | test.rs:414:19:414:24 | pinned | test.rs:414:18:414:24 | &pinned | provenance | | | test.rs:414:19:414:24 | pinned [Pin, &ref] | test.rs:414:18:414:24 | &pinned | provenance | | | test.rs:416:17:416:22 | buffer [Ready, Ok] | test.rs:417:20:417:39 | ...::Ready(...) [Ready, Ok] | provenance | | | test.rs:416:17:416:22 | buffer [Ready, Ok] | test.rs:418:23:418:28 | buffer [Ready, Ok] | provenance | | -| test.rs:416:26:416:31 | pinned | test.rs:416:26:416:54 | pinned.poll_fill_buf(...) [Ready, Ok] | provenance | MaD:9 | +| test.rs:416:26:416:31 | pinned | test.rs:416:26:416:54 | pinned.poll_fill_buf(...) [Ready, Ok] | provenance | MaD:10 | | test.rs:416:26:416:54 | pinned.poll_fill_buf(...) [Ready, Ok] | test.rs:416:17:416:22 | buffer [Ready, Ok] | provenance | | | test.rs:417:20:417:39 | ...::Ready(...) [Ready, Ok] | test.rs:417:32:417:38 | Ok(...) [Ok] | provenance | | | test.rs:417:32:417:38 | Ok(...) [Ok] | test.rs:417:35:417:37 | buf | provenance | | | test.rs:417:35:417:37 | buf | test.rs:419:22:419:24 | buf | provenance | | | test.rs:418:23:418:28 | buffer [Ready, Ok] | test.rs:418:22:418:28 | &buffer | provenance | | | test.rs:423:17:423:23 | buffer2 [Ready, Ok] | test.rs:424:20:424:26 | buffer2 [Ready, Ok] | provenance | | -| test.rs:423:27:423:48 | ...::new(...) | test.rs:423:27:423:71 | ... .poll_fill_buf(...) [Ready, Ok] | provenance | MaD:9 | +| test.rs:423:27:423:48 | ...::new(...) | test.rs:423:27:423:71 | ... .poll_fill_buf(...) [Ready, Ok] | provenance | MaD:10 | | test.rs:423:27:423:71 | ... .poll_fill_buf(...) [Ready, Ok] | test.rs:423:17:423:23 | buffer2 [Ready, Ok] | provenance | | -| test.rs:423:36:423:47 | &mut reader2 [&ref] | test.rs:423:27:423:48 | ...::new(...) | provenance | MaD:21 | +| test.rs:423:36:423:47 | &mut reader2 [&ref] | test.rs:423:27:423:48 | ...::new(...) | provenance | MaD:24 | | test.rs:423:41:423:47 | reader2 | test.rs:423:36:423:47 | &mut reader2 [&ref] | provenance | | | test.rs:424:20:424:26 | buffer2 [Ready, Ok] | test.rs:425:17:425:36 | ...::Ready(...) [Ready, Ok] | provenance | | | test.rs:424:20:424:26 | buffer2 [Ready, Ok] | test.rs:426:27:426:33 | buffer2 [Ready, Ok] | provenance | | @@ -247,7 +274,7 @@ edges | test.rs:425:32:425:34 | buf | test.rs:427:26:427:28 | buf | provenance | | | test.rs:426:27:426:33 | buffer2 [Ready, Ok] | test.rs:426:26:426:33 | &buffer2 | provenance | | | test.rs:437:17:437:22 | buffer | test.rs:438:18:438:23 | buffer | provenance | | -| test.rs:437:26:437:32 | reader2 | test.rs:437:26:437:43 | reader2.fill_buf() [future, Ok] | provenance | MaD:11 | +| test.rs:437:26:437:32 | reader2 | test.rs:437:26:437:43 | reader2.fill_buf() [future, Ok] | provenance | MaD:12 | | test.rs:437:26:437:43 | reader2.fill_buf() [future, Ok] | test.rs:437:26:437:49 | await ... [Ok] | provenance | | | test.rs:437:26:437:49 | await ... [Ok] | test.rs:437:26:437:50 | TryExpr | provenance | | | test.rs:437:26:437:50 | TryExpr | test.rs:437:17:437:22 | buffer | provenance | | @@ -256,64 +283,64 @@ edges | test.rs:444:17:444:26 | mut pinned [Pin, &ref] | test.rs:445:19:445:24 | pinned [Pin, &ref] | provenance | | | test.rs:444:30:444:51 | ...::new(...) | test.rs:444:17:444:26 | mut pinned | provenance | | | test.rs:444:30:444:51 | ...::new(...) [Pin, &ref] | test.rs:444:17:444:26 | mut pinned [Pin, &ref] | provenance | | -| test.rs:444:39:444:50 | &mut reader2 [&ref] | test.rs:444:30:444:51 | ...::new(...) | provenance | MaD:21 | -| test.rs:444:39:444:50 | &mut reader2 [&ref] | test.rs:444:30:444:51 | ...::new(...) [Pin, &ref] | provenance | MaD:22 | +| test.rs:444:39:444:50 | &mut reader2 [&ref] | test.rs:444:30:444:51 | ...::new(...) | provenance | MaD:24 | +| test.rs:444:39:444:50 | &mut reader2 [&ref] | test.rs:444:30:444:51 | ...::new(...) [Pin, &ref] | provenance | MaD:25 | | test.rs:444:44:444:50 | reader2 | test.rs:444:39:444:50 | &mut reader2 [&ref] | provenance | | | test.rs:445:19:445:24 | pinned | test.rs:445:18:445:24 | &pinned | provenance | | | test.rs:445:19:445:24 | pinned [Pin, &ref] | test.rs:445:18:445:24 | &pinned | provenance | | -| test.rs:447:30:447:35 | pinned | test.rs:447:56:447:66 | [post] &mut buffer [&ref] | provenance | MaD:10 | +| test.rs:447:30:447:35 | pinned | test.rs:447:56:447:66 | [post] &mut buffer [&ref] | provenance | MaD:11 | | test.rs:447:56:447:66 | [post] &mut buffer [&ref] | test.rs:447:61:447:66 | [post] buffer | provenance | | | test.rs:447:61:447:66 | [post] buffer | test.rs:448:19:448:24 | buffer | provenance | | | test.rs:447:61:447:66 | [post] buffer | test.rs:450:23:450:28 | buffer | provenance | | | test.rs:447:61:447:66 | [post] buffer | test.rs:450:23:450:33 | buffer[...] | provenance | | | test.rs:448:19:448:24 | buffer | test.rs:448:18:448:24 | &buffer | provenance | | -| test.rs:450:23:450:28 | buffer | test.rs:450:23:450:33 | buffer[...] | provenance | MaD:8 | +| test.rs:450:23:450:28 | buffer | test.rs:450:23:450:33 | buffer[...] | provenance | MaD:9 | | test.rs:450:23:450:33 | buffer[...] | test.rs:450:22:450:33 | &... | provenance | | -| test.rs:457:63:457:74 | &mut reader2 [&ref] | test.rs:457:77:457:88 | [post] &mut buffer1 [&ref] | provenance | MaD:14 | +| test.rs:457:63:457:74 | &mut reader2 [&ref] | test.rs:457:77:457:88 | [post] &mut buffer1 [&ref] | provenance | MaD:15 | | test.rs:457:68:457:74 | reader2 | test.rs:457:63:457:74 | &mut reader2 [&ref] | provenance | | | test.rs:457:77:457:88 | [post] &mut buffer1 [&ref] | test.rs:457:82:457:88 | [post] buffer1 | provenance | | | test.rs:457:82:457:88 | [post] buffer1 | test.rs:458:19:458:25 | buffer1 | provenance | | | test.rs:457:82:457:88 | [post] buffer1 | test.rs:458:19:458:40 | buffer1[...] | provenance | | -| test.rs:458:19:458:25 | buffer1 | test.rs:458:19:458:40 | buffer1[...] | provenance | MaD:8 | +| test.rs:458:19:458:25 | buffer1 | test.rs:458:19:458:40 | buffer1[...] | provenance | MaD:9 | | test.rs:458:19:458:40 | buffer1[...] | test.rs:458:18:458:40 | &... | provenance | | -| test.rs:461:31:461:37 | reader2 | test.rs:461:44:461:55 | [post] &mut buffer2 [&ref] | provenance | MaD:14 | +| test.rs:461:31:461:37 | reader2 | test.rs:461:44:461:55 | [post] &mut buffer2 [&ref] | provenance | MaD:15 | | test.rs:461:44:461:55 | [post] &mut buffer2 [&ref] | test.rs:461:49:461:55 | [post] buffer2 | provenance | | | test.rs:461:49:461:55 | [post] buffer2 | test.rs:462:19:462:25 | buffer2 | provenance | | | test.rs:461:49:461:55 | [post] buffer2 | test.rs:462:19:462:40 | buffer2[...] | provenance | | -| test.rs:462:19:462:25 | buffer2 | test.rs:462:19:462:40 | buffer2[...] | provenance | MaD:8 | +| test.rs:462:19:462:25 | buffer2 | test.rs:462:19:462:40 | buffer2[...] | provenance | MaD:9 | | test.rs:462:19:462:40 | buffer2[...] | test.rs:462:18:462:40 | &... | provenance | | | test.rs:467:17:467:26 | mut pinned | test.rs:468:19:468:24 | pinned | provenance | | | test.rs:467:17:467:26 | mut pinned | test.rs:470:26:470:31 | pinned | provenance | | | test.rs:467:17:467:26 | mut pinned [Pin, &ref] | test.rs:468:19:468:24 | pinned [Pin, &ref] | provenance | | | test.rs:467:30:467:51 | ...::new(...) | test.rs:467:17:467:26 | mut pinned | provenance | | | test.rs:467:30:467:51 | ...::new(...) [Pin, &ref] | test.rs:467:17:467:26 | mut pinned [Pin, &ref] | provenance | | -| test.rs:467:39:467:50 | &mut reader2 [&ref] | test.rs:467:30:467:51 | ...::new(...) | provenance | MaD:21 | -| test.rs:467:39:467:50 | &mut reader2 [&ref] | test.rs:467:30:467:51 | ...::new(...) [Pin, &ref] | provenance | MaD:22 | +| test.rs:467:39:467:50 | &mut reader2 [&ref] | test.rs:467:30:467:51 | ...::new(...) | provenance | MaD:24 | +| test.rs:467:39:467:50 | &mut reader2 [&ref] | test.rs:467:30:467:51 | ...::new(...) [Pin, &ref] | provenance | MaD:25 | | test.rs:467:44:467:50 | reader2 | test.rs:467:39:467:50 | &mut reader2 [&ref] | provenance | | | test.rs:468:19:468:24 | pinned | test.rs:468:18:468:24 | &pinned | provenance | | | test.rs:468:19:468:24 | pinned [Pin, &ref] | test.rs:468:18:468:24 | &pinned | provenance | | | test.rs:470:17:470:22 | buffer [Ready, Ok] | test.rs:471:19:471:24 | buffer [Ready, Ok] | provenance | | | test.rs:470:17:470:22 | buffer [Ready, Ok] | test.rs:472:20:472:39 | ...::Ready(...) [Ready, Ok] | provenance | | -| test.rs:470:26:470:31 | pinned | test.rs:470:26:470:54 | pinned.poll_fill_buf(...) [Ready, Ok] | provenance | MaD:9 | +| test.rs:470:26:470:31 | pinned | test.rs:470:26:470:54 | pinned.poll_fill_buf(...) [Ready, Ok] | provenance | MaD:10 | | test.rs:470:26:470:54 | pinned.poll_fill_buf(...) [Ready, Ok] | test.rs:470:17:470:22 | buffer [Ready, Ok] | provenance | | | test.rs:471:19:471:24 | buffer [Ready, Ok] | test.rs:471:18:471:24 | &buffer | provenance | | | test.rs:472:20:472:39 | ...::Ready(...) [Ready, Ok] | test.rs:472:32:472:38 | Ok(...) [Ok] | provenance | | | test.rs:472:32:472:38 | Ok(...) [Ok] | test.rs:472:35:472:37 | buf | provenance | | | test.rs:472:35:472:37 | buf | test.rs:473:22:473:24 | buf | provenance | | | test.rs:479:17:479:22 | buffer | test.rs:480:18:480:23 | buffer | provenance | | -| test.rs:479:26:479:32 | reader2 | test.rs:479:26:479:43 | reader2.fill_buf() [future, Ok] | provenance | MaD:11 | +| test.rs:479:26:479:32 | reader2 | test.rs:479:26:479:43 | reader2.fill_buf() [future, Ok] | provenance | MaD:12 | | test.rs:479:26:479:43 | reader2.fill_buf() [future, Ok] | test.rs:479:26:479:49 | await ... [Ok] | provenance | | | test.rs:479:26:479:49 | await ... [Ok] | test.rs:479:26:479:50 | TryExpr | provenance | | | test.rs:479:26:479:50 | TryExpr | test.rs:479:17:479:22 | buffer | provenance | | -| test.rs:486:31:486:37 | reader2 | test.rs:486:57:486:65 | [post] &mut line [&ref] | provenance | MaD:13 | +| test.rs:486:31:486:37 | reader2 | test.rs:486:57:486:65 | [post] &mut line [&ref] | provenance | MaD:14 | | test.rs:486:57:486:65 | [post] &mut line [&ref] | test.rs:486:62:486:65 | [post] line | provenance | | | test.rs:486:62:486:65 | [post] line | test.rs:487:19:487:22 | line | provenance | | | test.rs:487:19:487:22 | line | test.rs:487:18:487:22 | &line | provenance | | -| test.rs:493:31:493:37 | reader2 | test.rs:493:49:493:57 | [post] &mut line [&ref] | provenance | MaD:12 | +| test.rs:493:31:493:37 | reader2 | test.rs:493:49:493:57 | [post] &mut line [&ref] | provenance | MaD:13 | | test.rs:493:49:493:57 | [post] &mut line [&ref] | test.rs:493:54:493:57 | [post] line | provenance | | | test.rs:493:54:493:57 | [post] line | test.rs:494:19:494:22 | line | provenance | | | test.rs:494:19:494:22 | line | test.rs:494:18:494:22 | &line | provenance | | -| test.rs:500:31:500:37 | reader2 | test.rs:500:51:500:61 | [post] &mut buffer [&ref] | provenance | MaD:15 | +| test.rs:500:31:500:37 | reader2 | test.rs:500:51:500:61 | [post] &mut buffer [&ref] | provenance | MaD:16 | | test.rs:500:51:500:61 | [post] &mut buffer [&ref] | test.rs:500:56:500:61 | [post] buffer | provenance | | | test.rs:500:56:500:61 | [post] buffer | test.rs:501:19:501:24 | buffer | provenance | | | test.rs:501:19:501:24 | buffer | test.rs:501:18:501:24 | &buffer | provenance | | @@ -449,6 +476,30 @@ nodes | test.rs:275:50:275:55 | [post] buffer | semmle.label | [post] buffer | | test.rs:282:26:282:32 | &buffer | semmle.label | &buffer | | test.rs:282:27:282:32 | buffer | semmle.label | buffer | +| test.rs:332:9:332:18 | mut client | semmle.label | mut client | +| test.rs:332:22:332:50 | ...::new | semmle.label | ...::new | +| test.rs:332:22:332:75 | ...::new(...) [Ok] | semmle.label | ...::new(...) [Ok] | +| test.rs:332:22:332:84 | ... .unwrap() | semmle.label | ... .unwrap() | +| test.rs:333:9:333:18 | mut reader | semmle.label | mut reader | +| test.rs:333:22:333:27 | client | semmle.label | client | +| test.rs:333:22:333:36 | client.reader() | semmle.label | client.reader() | +| test.rs:334:10:334:16 | &reader | semmle.label | &reader | +| test.rs:334:11:334:16 | reader | semmle.label | reader | +| test.rs:338:22:338:27 | reader | semmle.label | reader | +| test.rs:338:34:338:44 | [post] &mut buffer [&ref] | semmle.label | [post] &mut buffer [&ref] | +| test.rs:338:39:338:44 | [post] buffer | semmle.label | [post] buffer | +| test.rs:339:14:339:20 | &buffer | semmle.label | &buffer | +| test.rs:339:15:339:20 | buffer | semmle.label | buffer | +| test.rs:344:22:344:27 | reader | semmle.label | reader | +| test.rs:344:41:344:51 | [post] &mut buffer [&ref] | semmle.label | [post] &mut buffer [&ref] | +| test.rs:344:46:344:51 | [post] buffer | semmle.label | [post] buffer | +| test.rs:345:14:345:20 | &buffer | semmle.label | &buffer | +| test.rs:345:15:345:20 | buffer | semmle.label | buffer | +| test.rs:350:22:350:27 | reader | semmle.label | reader | +| test.rs:350:44:350:54 | [post] &mut buffer [&ref] | semmle.label | [post] &mut buffer [&ref] | +| test.rs:350:49:350:54 | [post] buffer | semmle.label | [post] buffer | +| test.rs:351:14:351:20 | &buffer | semmle.label | &buffer | +| test.rs:351:15:351:20 | buffer | semmle.label | buffer | | test.rs:373:13:373:15 | tcp | semmle.label | tcp | | test.rs:373:19:373:36 | ...::connect | semmle.label | ...::connect | | test.rs:373:19:373:41 | ...::connect(...) [future, Ok] | semmle.label | ...::connect(...) [future, Ok] | @@ -626,6 +677,10 @@ testFailures | test.rs:244:14:244:23 | buffer2[0] | test.rs:224:28:224:57 | ...::connect | test.rs:244:14:244:23 | buffer2[0] | $@ | test.rs:224:28:224:57 | ...::connect | ...::connect | | test.rs:259:26:259:32 | &buffer | test.rs:224:28:224:57 | ...::connect | test.rs:259:26:259:32 | &buffer | $@ | test.rs:224:28:224:57 | ...::connect | ...::connect | | test.rs:282:26:282:32 | &buffer | test.rs:224:28:224:57 | ...::connect | test.rs:282:26:282:32 | &buffer | $@ | test.rs:224:28:224:57 | ...::connect | ...::connect | +| test.rs:334:10:334:16 | &reader | test.rs:332:22:332:50 | ...::new | test.rs:334:10:334:16 | &reader | $@ | test.rs:332:22:332:50 | ...::new | ...::new | +| test.rs:339:14:339:20 | &buffer | test.rs:332:22:332:50 | ...::new | test.rs:339:14:339:20 | &buffer | $@ | test.rs:332:22:332:50 | ...::new | ...::new | +| test.rs:345:14:345:20 | &buffer | test.rs:332:22:332:50 | ...::new | test.rs:345:14:345:20 | &buffer | $@ | test.rs:332:22:332:50 | ...::new | ...::new | +| test.rs:351:14:351:20 | &buffer | test.rs:332:22:332:50 | ...::new | test.rs:351:14:351:20 | &buffer | $@ | test.rs:332:22:332:50 | ...::new | ...::new | | test.rs:374:14:374:17 | &tcp | test.rs:373:19:373:36 | ...::connect | test.rs:374:14:374:17 | &tcp | $@ | test.rs:373:19:373:36 | ...::connect | ...::connect | | test.rs:381:14:381:20 | &reader | test.rs:373:19:373:36 | ...::connect | test.rs:381:14:381:20 | &reader | $@ | test.rs:373:19:373:36 | ...::connect | ...::connect | | test.rs:387:18:387:24 | &pinned | test.rs:373:19:373:36 | ...::connect | test.rs:387:18:387:24 | &pinned | $@ | test.rs:373:19:373:36 | ...::connect | ...::connect | diff --git a/rust/ql/test/library-tests/dataflow/sources/net/test.rs b/rust/ql/test/library-tests/dataflow/sources/net/test.rs index 178f539dc6e8..9fee46b11c02 100644 --- a/rust/ql/test/library-tests/dataflow/sources/net/test.rs +++ b/rust/ql/test/library-tests/dataflow/sources/net/test.rs @@ -331,24 +331,24 @@ fn test_rustls() -> std::io::Result<()> { let config_arc = std::sync::Arc::new(config); let mut client = rustls::ClientConnection::new(config_arc, server_name).unwrap(); // $ Alert[rust/summary/taint-sources] let mut reader = client.reader(); // We cannot resolve the `reader` call because it comes from `Deref`: https://docs.rs/rustls/latest/rustls/client/struct.ClientConnection.html#deref-methods-ConnectionCommon%3CClientConnectionData%3E - sink(&reader); // $ MISSING: hasTaintFlow=config_arc + sink(&reader); // $ hasTaintFlow=config_arc { let mut buffer = [0u8; 100]; let _bytes = reader.read(&mut buffer)?; - sink(&buffer); // $ MISSING: hasTaintFlow=config_arc + sink(&buffer); // $ hasTaintFlow=config_arc } { let mut buffer = Vec::::new(); let _bytes = reader.read_to_end(&mut buffer)?; - sink(&buffer); // $ MISSING: hasTaintFlow=config_arc + sink(&buffer); // $ hasTaintFlow=config_arc } { let mut buffer = String::new(); let _bytes = reader.read_to_string(&mut buffer)?; - sink(&buffer); // $ MISSING: hasTaintFlow=config_arc + sink(&buffer); // $ hasTaintFlow=config_arc } Ok(()) diff --git a/rust/ql/test/library-tests/dataflow/taint/TaintFlowStep.expected b/rust/ql/test/library-tests/dataflow/taint/TaintFlowStep.expected index 9799d66b124a..2f9bd4c998ce 100644 --- a/rust/ql/test/library-tests/dataflow/taint/TaintFlowStep.expected +++ b/rust/ql/test/library-tests/dataflow/taint/TaintFlowStep.expected @@ -1,19 +1,19 @@ | main.rs:8:20:8:20 | s | main.rs:8:14:8:20 | FormatArgsExpr | -| main.rs:16:5:16:5 | [post] b [borrowed] | main.rs:16:5:16:5 | [SSA] b | -| main.rs:20:5:20:5 | [post] c [borrowed] | main.rs:20:5:20:5 | [SSA] c | +| main.rs:16:5:16:5 | [post] b [implicit borrow] | main.rs:16:5:16:5 | [SSA] b | +| main.rs:20:5:20:5 | [post] c [implicit borrow] | main.rs:20:5:20:5 | [SSA] c | | main.rs:31:13:31:13 | a | main.rs:31:13:31:19 | a as u8 | | main.rs:32:10:32:10 | b | main.rs:32:10:32:17 | b as i64 | | main.rs:32:10:32:17 | [post] b as i64 | main.rs:32:10:32:10 | [post] b | | main.rs:37:23:37:23 | i | main.rs:37:17:37:23 | FormatArgsExpr | | main.rs:41:24:41:24 | s | main.rs:41:18:41:24 | FormatArgsExpr | -| main.rs:46:23:46:23 | [post] s [borrowed] | main.rs:46:23:46:23 | [post] s | +| main.rs:46:23:46:23 | [post] s [implicit borrow] | main.rs:46:23:46:23 | [post] s | | main.rs:46:23:46:23 | s | main.rs:46:23:46:29 | s[...] | | main.rs:46:23:46:29 | s[...] [pre-dereferenced] | main.rs:46:23:46:29 | s[...] | | main.rs:57:24:57:24 | i | main.rs:57:18:57:24 | FormatArgsExpr | -| main.rs:62:14:62:16 | [post] arr [borrowed] | main.rs:62:14:62:16 | [post] arr | +| main.rs:62:14:62:16 | [post] arr [implicit borrow] | main.rs:62:14:62:16 | [post] arr | | main.rs:62:14:62:19 | arr[1] [pre-dereferenced] | main.rs:62:14:62:19 | arr[1] | -| main.rs:72:24:72:24 | [post] s [borrowed] | main.rs:72:24:72:24 | [post] s | +| main.rs:72:24:72:24 | [post] s [implicit borrow] | main.rs:72:24:72:24 | [post] s | | main.rs:72:24:72:27 | s[1] | main.rs:72:18:72:27 | FormatArgsExpr | | main.rs:72:24:72:27 | s[1] [pre-dereferenced] | main.rs:72:24:72:27 | s[1] | -| main.rs:77:9:77:12 | [post] arr2 [borrowed] | main.rs:77:9:77:12 | [post] arr2 | +| main.rs:77:9:77:12 | [post] arr2 [implicit borrow] | main.rs:77:9:77:12 | [post] arr2 | | main.rs:77:9:77:15 | arr2[1] [pre-dereferenced] | main.rs:77:9:77:15 | arr2[1] | diff --git a/rust/ql/test/library-tests/sensitivedata/test.rs b/rust/ql/test/library-tests/sensitivedata/test.rs index 0f4965ce2856..f8d850beeb80 100644 --- a/rust/ql/test/library-tests/sensitivedata/test.rs +++ b/rust/ql/test/library-tests/sensitivedata/test.rs @@ -287,7 +287,7 @@ fn test_private_info( sink(&info.medical_notes); // $ sensitive=private sink(info.medical_notes[0].as_str()); // $ sensitive=private for n in info.medical_notes.iter() { - sink(n.as_str()); // $ MISSING: sensitive=private + sink(n.as_str()); // $ sensitive=private } sink(info.confidentialMessage.as_str()); // $ sensitive=secret sink(info.confidentialMessage.to_lowercase()); // $ sensitive=secret diff --git a/rust/ql/test/library-tests/type-inference/blanket_impl.rs b/rust/ql/test/library-tests/type-inference/blanket_impl.rs index c139af01c422..b25a0f8cf77a 100644 --- a/rust/ql/test/library-tests/type-inference/blanket_impl.rs +++ b/rust/ql/test/library-tests/type-inference/blanket_impl.rs @@ -53,9 +53,9 @@ mod basic_blanket_impl { println!("{x4:?}"); let x5 = S1::duplicate(&S1); // $ target=Clone1duplicate println!("{x5:?}"); - let x6 = S2.duplicate(); // $ MISSING: target=Clone1duplicate + let x6 = S2.duplicate(); // $ target=Clone1duplicate println!("{x6:?}"); - let x7 = (&S2).duplicate(); // $ MISSING: target=Clone1duplicate + let x7 = (&S2).duplicate(); // $ target=Clone1duplicate println!("{x7:?}"); } } diff --git a/rust/ql/test/library-tests/type-inference/dereference.rs b/rust/ql/test/library-tests/type-inference/dereference.rs index 6b8d659eb3e1..4767e07576f4 100644 --- a/rust/ql/test/library-tests/type-inference/dereference.rs +++ b/rust/ql/test/library-tests/type-inference/dereference.rs @@ -1,5 +1,6 @@ /// This file contains tests for dereferencing with through the `Deref` trait. use std::ops::Deref; +use std::ops::DerefMut; struct MyIntPointer { value: i64, @@ -27,6 +28,13 @@ impl Deref for MySmartPointer { } } +impl DerefMut for MySmartPointer { + // MySmartPointer::deref_mut + fn deref_mut(&mut self) -> &mut T { + &mut self.value // $ fieldof=MySmartPointer + } +} + struct S(T); impl S { @@ -94,14 +102,18 @@ fn explicit_box_dereference() { fn implicit_dereference() { // Call method on implicitly dereferenced value let x = MyIntPointer { value: 34i64 }; - let _y = x.is_positive(); // $ MISSING: target=is_positive type=_y:bool + let _y = x.is_positive(); // $ target=is_positive type=_y:bool // Call method on implicitly dereferenced value let x = MySmartPointer { value: 34i64 }; - let _y = x.is_positive(); // $ MISSING: target=is_positive type=_y:bool + let _y = x.is_positive(); // $ target=is_positive type=_y:bool let z = MySmartPointer { value: S(0i64) }; - let z_ = z.foo(); // $ MISSING: target=foo type=z_:TRef.i64 + let z_ = z.foo(); // $ target=foo type=z_:TRef.i64 + + let v = Vec::new(); // $ target=new type=v:T.i32 + let mut x = MySmartPointer { value: v }; + x.push(0); // $ target=push } mod implicit_deref_coercion_cycle { diff --git a/rust/ql/test/library-tests/type-inference/main.rs b/rust/ql/test/library-tests/type-inference/main.rs index d367525c7b8a..840e17b52ef9 100644 --- a/rust/ql/test/library-tests/type-inference/main.rs +++ b/rust/ql/test/library-tests/type-inference/main.rs @@ -2902,8 +2902,8 @@ pub mod path_buf { let path3 = path2.unwrap(); // $ target=unwrap type=path3:PathBuf let pathbuf1 = PathBuf::new(); // $ target=new certainType=pathbuf1:PathBuf - let pathbuf2 = pathbuf1.canonicalize(); // $ MISSING: target=canonicalize - let pathbuf3 = pathbuf2.unwrap(); // $ MISSING: target=unwrap type=pathbuf3:PathBuf + let pathbuf2 = pathbuf1.canonicalize(); // $ target=canonicalize + let pathbuf3 = pathbuf2.unwrap(); // $ target=unwrap type=pathbuf3:PathBuf } } diff --git a/rust/ql/test/library-tests/type-inference/type-inference.expected b/rust/ql/test/library-tests/type-inference/type-inference.expected index d5b9e30f05e4..a93284881564 100644 --- a/rust/ql/test/library-tests/type-inference/type-inference.expected +++ b/rust/ql/test/library-tests/type-inference/type-inference.expected @@ -275,198 +275,216 @@ inferCertainType | closure.rs:74:31:74:53 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | | closure.rs:74:41:74:41 | _ | | {EXTERNAL LOCATION} | i64 | | closure.rs:74:49:74:52 | true | | {EXTERNAL LOCATION} | bool | -| dereference.rs:12:14:12:18 | SelfParam | | {EXTERNAL LOCATION} | & | -| dereference.rs:12:14:12:18 | SelfParam | TRef | dereference.rs:4:1:6:1 | MyIntPointer | -| dereference.rs:12:29:14:5 | { ... } | | {EXTERNAL LOCATION} | & | -| dereference.rs:12:29:14:5 | { ... } | TRef | {EXTERNAL LOCATION} | i64 | -| dereference.rs:13:9:13:19 | &... | | {EXTERNAL LOCATION} | & | -| dereference.rs:13:10:13:13 | self | | {EXTERNAL LOCATION} | & | -| dereference.rs:13:10:13:13 | self | TRef | dereference.rs:4:1:6:1 | MyIntPointer | -| dereference.rs:25:14:25:18 | SelfParam | | {EXTERNAL LOCATION} | & | -| dereference.rs:25:14:25:18 | SelfParam | TRef | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:25:14:25:18 | SelfParam | TRef.T | dereference.rs:21:6:21:6 | T | -| dereference.rs:25:27:27:5 | { ... } | | {EXTERNAL LOCATION} | & | -| dereference.rs:25:27:27:5 | { ... } | TRef | dereference.rs:21:6:21:6 | T | -| dereference.rs:26:9:26:19 | &... | | {EXTERNAL LOCATION} | & | -| dereference.rs:26:10:26:13 | self | | {EXTERNAL LOCATION} | & | -| dereference.rs:26:10:26:13 | self | TRef | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:26:10:26:13 | self | TRef.T | dereference.rs:21:6:21:6 | T | -| dereference.rs:33:12:33:16 | SelfParam | | {EXTERNAL LOCATION} | & | -| dereference.rs:33:12:33:16 | SelfParam | TRef | dereference.rs:30:1:30:15 | S | -| dereference.rs:33:12:33:16 | SelfParam | TRef.T | dereference.rs:32:6:32:6 | T | -| dereference.rs:33:25:35:5 | { ... } | | {EXTERNAL LOCATION} | & | -| dereference.rs:33:25:35:5 | { ... } | TRef | dereference.rs:32:6:32:6 | T | -| dereference.rs:34:9:34:15 | &... | | {EXTERNAL LOCATION} | & | -| dereference.rs:34:10:34:13 | self | | {EXTERNAL LOCATION} | & | -| dereference.rs:34:10:34:13 | self | TRef | dereference.rs:30:1:30:15 | S | -| dereference.rs:34:10:34:13 | self | TRef.T | dereference.rs:32:6:32:6 | T | -| dereference.rs:38:39:50:1 | { ... } | | {EXTERNAL LOCATION} | () | -| dereference.rs:40:9:40:10 | a1 | | dereference.rs:4:1:6:1 | MyIntPointer | -| dereference.rs:40:14:40:42 | MyIntPointer {...} | | dereference.rs:4:1:6:1 | MyIntPointer | -| dereference.rs:40:36:40:40 | 34i64 | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:41:15:41:16 | a1 | | dereference.rs:4:1:6:1 | MyIntPointer | -| dereference.rs:44:9:44:10 | a2 | | dereference.rs:4:1:6:1 | MyIntPointer | -| dereference.rs:44:14:44:42 | MyIntPointer {...} | | dereference.rs:4:1:6:1 | MyIntPointer | -| dereference.rs:44:36:44:40 | 34i64 | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:45:16:45:17 | a2 | | dereference.rs:4:1:6:1 | MyIntPointer | -| dereference.rs:48:9:48:10 | a3 | | dereference.rs:4:1:6:1 | MyIntPointer | -| dereference.rs:48:14:48:42 | MyIntPointer {...} | | dereference.rs:4:1:6:1 | MyIntPointer | +| dereference.rs:13:14:13:18 | SelfParam | | {EXTERNAL LOCATION} | & | +| dereference.rs:13:14:13:18 | SelfParam | TRef | dereference.rs:5:1:7:1 | MyIntPointer | +| dereference.rs:13:29:15:5 | { ... } | | {EXTERNAL LOCATION} | & | +| dereference.rs:13:29:15:5 | { ... } | TRef | {EXTERNAL LOCATION} | i64 | +| dereference.rs:14:9:14:19 | &... | | {EXTERNAL LOCATION} | & | +| dereference.rs:14:10:14:13 | self | | {EXTERNAL LOCATION} | & | +| dereference.rs:14:10:14:13 | self | TRef | dereference.rs:5:1:7:1 | MyIntPointer | +| dereference.rs:26:14:26:18 | SelfParam | | {EXTERNAL LOCATION} | & | +| dereference.rs:26:14:26:18 | SelfParam | TRef | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:26:14:26:18 | SelfParam | TRef.T | dereference.rs:22:6:22:6 | T | +| dereference.rs:26:27:28:5 | { ... } | | {EXTERNAL LOCATION} | & | +| dereference.rs:26:27:28:5 | { ... } | TRef | dereference.rs:22:6:22:6 | T | +| dereference.rs:27:9:27:19 | &... | | {EXTERNAL LOCATION} | & | +| dereference.rs:27:10:27:13 | self | | {EXTERNAL LOCATION} | & | +| dereference.rs:27:10:27:13 | self | TRef | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:27:10:27:13 | self | TRef.T | dereference.rs:22:6:22:6 | T | +| dereference.rs:33:18:33:26 | SelfParam | | {EXTERNAL LOCATION} | &mut | +| dereference.rs:33:18:33:26 | SelfParam | TRefMut | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:33:18:33:26 | SelfParam | TRefMut.T | dereference.rs:31:6:31:6 | T | +| dereference.rs:33:39:35:5 | { ... } | | {EXTERNAL LOCATION} | &mut | +| dereference.rs:33:39:35:5 | { ... } | TRefMut | dereference.rs:31:6:31:6 | T | +| dereference.rs:34:9:34:23 | &mut ... | | {EXTERNAL LOCATION} | &mut | +| dereference.rs:34:14:34:17 | self | | {EXTERNAL LOCATION} | &mut | +| dereference.rs:34:14:34:17 | self | TRefMut | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:34:14:34:17 | self | TRefMut.T | dereference.rs:31:6:31:6 | T | +| dereference.rs:41:12:41:16 | SelfParam | | {EXTERNAL LOCATION} | & | +| dereference.rs:41:12:41:16 | SelfParam | TRef | dereference.rs:38:1:38:15 | S | +| dereference.rs:41:12:41:16 | SelfParam | TRef.T | dereference.rs:40:6:40:6 | T | +| dereference.rs:41:25:43:5 | { ... } | | {EXTERNAL LOCATION} | & | +| dereference.rs:41:25:43:5 | { ... } | TRef | dereference.rs:40:6:40:6 | T | +| dereference.rs:42:9:42:15 | &... | | {EXTERNAL LOCATION} | & | +| dereference.rs:42:10:42:13 | self | | {EXTERNAL LOCATION} | & | +| dereference.rs:42:10:42:13 | self | TRef | dereference.rs:38:1:38:15 | S | +| dereference.rs:42:10:42:13 | self | TRef.T | dereference.rs:40:6:40:6 | T | +| dereference.rs:46:39:58:1 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:48:9:48:10 | a1 | | dereference.rs:5:1:7:1 | MyIntPointer | +| dereference.rs:48:14:48:42 | MyIntPointer {...} | | dereference.rs:5:1:7:1 | MyIntPointer | | dereference.rs:48:36:48:40 | 34i64 | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:49:17:49:18 | a3 | | dereference.rs:4:1:6:1 | MyIntPointer | -| dereference.rs:52:39:64:1 | { ... } | | {EXTERNAL LOCATION} | () | -| dereference.rs:54:9:54:10 | c1 | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:54:14:54:42 | MySmartPointer {...} | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:54:38:54:40 | 'a' | | {EXTERNAL LOCATION} | char | -| dereference.rs:55:15:55:16 | c1 | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:58:9:58:10 | c2 | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:58:14:58:42 | MySmartPointer {...} | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:58:38:58:40 | 'a' | | {EXTERNAL LOCATION} | char | -| dereference.rs:59:16:59:17 | c2 | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:62:9:62:10 | c3 | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:62:14:62:44 | MySmartPointer {...} | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:62:38:62:42 | 34i64 | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:63:17:63:18 | c3 | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:66:31:78:1 | { ... } | | {EXTERNAL LOCATION} | () | -| dereference.rs:68:9:68:10 | e1 | | {EXTERNAL LOCATION} | & | -| dereference.rs:68:14:68:17 | &'a' | | {EXTERNAL LOCATION} | & | -| dereference.rs:68:15:68:17 | 'a' | | {EXTERNAL LOCATION} | char | -| dereference.rs:69:15:69:16 | e1 | | {EXTERNAL LOCATION} | & | -| dereference.rs:72:9:72:10 | e2 | | {EXTERNAL LOCATION} | & | -| dereference.rs:72:14:72:17 | &'a' | | {EXTERNAL LOCATION} | & | -| dereference.rs:72:15:72:17 | 'a' | | {EXTERNAL LOCATION} | char | -| dereference.rs:73:16:73:17 | e2 | | {EXTERNAL LOCATION} | & | -| dereference.rs:76:9:76:10 | e3 | | {EXTERNAL LOCATION} | & | -| dereference.rs:76:14:76:19 | &34i64 | | {EXTERNAL LOCATION} | & | -| dereference.rs:76:15:76:19 | 34i64 | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:77:17:77:18 | e3 | | {EXTERNAL LOCATION} | & | -| dereference.rs:80:31:92:1 | { ... } | | {EXTERNAL LOCATION} | () | -| dereference.rs:82:9:82:10 | g1 | | {EXTERNAL LOCATION} | Box | -| dereference.rs:82:9:82:10 | g1 | A | {EXTERNAL LOCATION} | Global | -| dereference.rs:82:9:82:10 | g1 | T | {EXTERNAL LOCATION} | char | -| dereference.rs:82:25:82:37 | ...::new(...) | | {EXTERNAL LOCATION} | Box | -| dereference.rs:82:25:82:37 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | -| dereference.rs:82:34:82:36 | 'a' | | {EXTERNAL LOCATION} | char | -| dereference.rs:83:15:83:16 | g1 | | {EXTERNAL LOCATION} | Box | -| dereference.rs:83:15:83:16 | g1 | A | {EXTERNAL LOCATION} | Global | -| dereference.rs:83:15:83:16 | g1 | T | {EXTERNAL LOCATION} | char | -| dereference.rs:86:9:86:10 | g2 | | {EXTERNAL LOCATION} | Box | -| dereference.rs:86:9:86:10 | g2 | A | {EXTERNAL LOCATION} | Global | -| dereference.rs:86:9:86:10 | g2 | T | {EXTERNAL LOCATION} | char | -| dereference.rs:86:25:86:37 | ...::new(...) | | {EXTERNAL LOCATION} | Box | -| dereference.rs:86:25:86:37 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | -| dereference.rs:86:34:86:36 | 'a' | | {EXTERNAL LOCATION} | char | -| dereference.rs:87:16:87:17 | g2 | | {EXTERNAL LOCATION} | Box | -| dereference.rs:87:16:87:17 | g2 | A | {EXTERNAL LOCATION} | Global | -| dereference.rs:87:16:87:17 | g2 | T | {EXTERNAL LOCATION} | char | -| dereference.rs:90:9:90:10 | g3 | | {EXTERNAL LOCATION} | Box | -| dereference.rs:90:9:90:10 | g3 | A | {EXTERNAL LOCATION} | Global | -| dereference.rs:90:9:90:10 | g3 | T | {EXTERNAL LOCATION} | i64 | -| dereference.rs:90:24:90:38 | ...::new(...) | | {EXTERNAL LOCATION} | Box | -| dereference.rs:90:24:90:38 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | -| dereference.rs:90:33:90:37 | 34i64 | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:91:17:91:18 | g3 | | {EXTERNAL LOCATION} | Box | -| dereference.rs:91:17:91:18 | g3 | A | {EXTERNAL LOCATION} | Global | -| dereference.rs:91:17:91:18 | g3 | T | {EXTERNAL LOCATION} | i64 | -| dereference.rs:94:27:105:1 | { ... } | | {EXTERNAL LOCATION} | () | -| dereference.rs:96:9:96:9 | x | | dereference.rs:4:1:6:1 | MyIntPointer | -| dereference.rs:96:13:96:41 | MyIntPointer {...} | | dereference.rs:4:1:6:1 | MyIntPointer | -| dereference.rs:96:35:96:39 | 34i64 | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:97:14:97:14 | x | | dereference.rs:4:1:6:1 | MyIntPointer | -| dereference.rs:100:9:100:9 | x | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:100:13:100:43 | MySmartPointer {...} | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:100:37:100:41 | 34i64 | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:101:14:101:14 | x | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:103:9:103:9 | z | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:103:13:103:45 | MySmartPointer {...} | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:103:39:103:42 | 0i64 | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:104:14:104:14 | z | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:131:19:139:5 | { ... } | | {EXTERNAL LOCATION} | () | -| dereference.rs:132:17:132:26 | key_to_key | | {EXTERNAL LOCATION} | HashMap | -| dereference.rs:132:17:132:26 | key_to_key | K | {EXTERNAL LOCATION} | & | -| dereference.rs:132:17:132:26 | key_to_key | K.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:132:17:132:26 | key_to_key | S | {EXTERNAL LOCATION} | RandomState | -| dereference.rs:132:17:132:26 | key_to_key | V | {EXTERNAL LOCATION} | & | -| dereference.rs:132:17:132:26 | key_to_key | V.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:132:30:132:57 | ...::new(...) | | {EXTERNAL LOCATION} | HashMap | -| dereference.rs:132:30:132:57 | ...::new(...) | K | {EXTERNAL LOCATION} | & | -| dereference.rs:132:30:132:57 | ...::new(...) | K.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:132:30:132:57 | ...::new(...) | S | {EXTERNAL LOCATION} | RandomState | -| dereference.rs:132:30:132:57 | ...::new(...) | V | {EXTERNAL LOCATION} | & | -| dereference.rs:132:30:132:57 | ...::new(...) | V.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:133:17:133:19 | key | | {EXTERNAL LOCATION} | & | -| dereference.rs:133:23:133:29 | &... | | {EXTERNAL LOCATION} | & | -| dereference.rs:133:24:133:29 | Key {...} | | dereference.rs:110:5:111:21 | Key | -| dereference.rs:134:9:137:9 | if ... {...} | | {EXTERNAL LOCATION} | () | -| dereference.rs:134:32:134:41 | key_to_key | | {EXTERNAL LOCATION} | HashMap | -| dereference.rs:134:32:134:41 | key_to_key | K | {EXTERNAL LOCATION} | & | -| dereference.rs:134:32:134:41 | key_to_key | K.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:134:32:134:41 | key_to_key | S | {EXTERNAL LOCATION} | RandomState | -| dereference.rs:134:32:134:41 | key_to_key | V | {EXTERNAL LOCATION} | & | -| dereference.rs:134:32:134:41 | key_to_key | V.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:134:47:134:49 | key | | {EXTERNAL LOCATION} | & | -| dereference.rs:134:52:137:9 | { ... } | | {EXTERNAL LOCATION} | () | -| dereference.rs:136:13:136:15 | key | | {EXTERNAL LOCATION} | & | -| dereference.rs:138:9:138:18 | key_to_key | | {EXTERNAL LOCATION} | HashMap | -| dereference.rs:138:9:138:18 | key_to_key | K | {EXTERNAL LOCATION} | & | -| dereference.rs:138:9:138:18 | key_to_key | K.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:138:9:138:18 | key_to_key | S | {EXTERNAL LOCATION} | RandomState | -| dereference.rs:138:9:138:18 | key_to_key | V | {EXTERNAL LOCATION} | & | -| dereference.rs:138:9:138:18 | key_to_key | V.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:138:27:138:29 | key | | {EXTERNAL LOCATION} | & | -| dereference.rs:138:32:138:34 | key | | {EXTERNAL LOCATION} | & | -| dereference.rs:144:16:144:19 | SelfParam | | dereference.rs:143:5:145:5 | Self [trait MyTrait1] | -| dereference.rs:151:16:151:19 | SelfParam | | {EXTERNAL LOCATION} | & | -| dereference.rs:151:16:151:19 | SelfParam | TRef | dereference.rs:147:5:147:13 | S | -| dereference.rs:151:27:153:9 | { ... } | | dereference.rs:147:5:147:13 | S | -| dereference.rs:158:16:158:19 | SelfParam | | {EXTERNAL LOCATION} | &mut | -| dereference.rs:158:16:158:19 | SelfParam | TRefMut | dereference.rs:147:5:147:13 | S | -| dereference.rs:158:29:160:9 | { ... } | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:164:16:164:19 | SelfParam | | dereference.rs:163:5:165:5 | Self [trait MyTrait2] | -| dereference.rs:164:22:164:24 | arg | | dereference.rs:163:20:163:21 | T1 | -| dereference.rs:169:16:169:19 | SelfParam | | dereference.rs:147:5:147:13 | S | -| dereference.rs:169:22:169:24 | arg | | {EXTERNAL LOCATION} | & | -| dereference.rs:169:22:169:24 | arg | TRef | dereference.rs:147:5:147:13 | S | -| dereference.rs:169:36:171:9 | { ... } | | dereference.rs:147:5:147:13 | S | -| dereference.rs:176:16:176:19 | SelfParam | | dereference.rs:147:5:147:13 | S | -| dereference.rs:176:22:176:24 | arg | | {EXTERNAL LOCATION} | &mut | -| dereference.rs:176:22:176:24 | arg | TRefMut | dereference.rs:147:5:147:13 | S | -| dereference.rs:176:42:178:9 | { ... } | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:181:19:188:5 | { ... } | | {EXTERNAL LOCATION} | () | -| dereference.rs:182:17:182:20 | (...) | | {EXTERNAL LOCATION} | & | -| dereference.rs:182:18:182:19 | &S | | {EXTERNAL LOCATION} | & | -| dereference.rs:184:17:184:24 | (...) | | {EXTERNAL LOCATION} | &mut | -| dereference.rs:184:18:184:23 | &mut S | | {EXTERNAL LOCATION} | &mut | -| dereference.rs:186:23:186:24 | &S | | {EXTERNAL LOCATION} | & | -| dereference.rs:187:23:187:28 | &mut S | | {EXTERNAL LOCATION} | &mut | -| dereference.rs:196:16:196:20 | SelfParam | | {EXTERNAL LOCATION} | & | -| dereference.rs:196:16:196:20 | SelfParam | TRef | dereference.rs:195:5:197:5 | Self [trait Bar] | -| dereference.rs:201:16:201:24 | SelfParam | | {EXTERNAL LOCATION} | &mut | -| dereference.rs:201:16:201:24 | SelfParam | TRefMut | dereference.rs:193:5:193:17 | Foo | -| dereference.rs:201:27:203:9 | { ... } | | {EXTERNAL LOCATION} | () | -| dereference.rs:202:22:202:38 | "In struct impl!\\n" | | {EXTERNAL LOCATION} | & | -| dereference.rs:202:22:202:38 | "In struct impl!\\n" | TRef | {EXTERNAL LOCATION} | str | -| dereference.rs:202:22:202:38 | ...::_print(...) | | {EXTERNAL LOCATION} | () | -| dereference.rs:202:22:202:38 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:49:15:49:16 | a1 | | dereference.rs:5:1:7:1 | MyIntPointer | +| dereference.rs:52:9:52:10 | a2 | | dereference.rs:5:1:7:1 | MyIntPointer | +| dereference.rs:52:14:52:42 | MyIntPointer {...} | | dereference.rs:5:1:7:1 | MyIntPointer | +| dereference.rs:52:36:52:40 | 34i64 | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:53:16:53:17 | a2 | | dereference.rs:5:1:7:1 | MyIntPointer | +| dereference.rs:56:9:56:10 | a3 | | dereference.rs:5:1:7:1 | MyIntPointer | +| dereference.rs:56:14:56:42 | MyIntPointer {...} | | dereference.rs:5:1:7:1 | MyIntPointer | +| dereference.rs:56:36:56:40 | 34i64 | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:57:17:57:18 | a3 | | dereference.rs:5:1:7:1 | MyIntPointer | +| dereference.rs:60:39:72:1 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:62:9:62:10 | c1 | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:62:14:62:42 | MySmartPointer {...} | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:62:38:62:40 | 'a' | | {EXTERNAL LOCATION} | char | +| dereference.rs:63:15:63:16 | c1 | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:66:9:66:10 | c2 | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:66:14:66:42 | MySmartPointer {...} | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:66:38:66:40 | 'a' | | {EXTERNAL LOCATION} | char | +| dereference.rs:67:16:67:17 | c2 | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:70:9:70:10 | c3 | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:70:14:70:44 | MySmartPointer {...} | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:70:38:70:42 | 34i64 | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:71:17:71:18 | c3 | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:74:31:86:1 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:76:9:76:10 | e1 | | {EXTERNAL LOCATION} | & | +| dereference.rs:76:14:76:17 | &'a' | | {EXTERNAL LOCATION} | & | +| dereference.rs:76:15:76:17 | 'a' | | {EXTERNAL LOCATION} | char | +| dereference.rs:77:15:77:16 | e1 | | {EXTERNAL LOCATION} | & | +| dereference.rs:80:9:80:10 | e2 | | {EXTERNAL LOCATION} | & | +| dereference.rs:80:14:80:17 | &'a' | | {EXTERNAL LOCATION} | & | +| dereference.rs:80:15:80:17 | 'a' | | {EXTERNAL LOCATION} | char | +| dereference.rs:81:16:81:17 | e2 | | {EXTERNAL LOCATION} | & | +| dereference.rs:84:9:84:10 | e3 | | {EXTERNAL LOCATION} | & | +| dereference.rs:84:14:84:19 | &34i64 | | {EXTERNAL LOCATION} | & | +| dereference.rs:84:15:84:19 | 34i64 | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:85:17:85:18 | e3 | | {EXTERNAL LOCATION} | & | +| dereference.rs:88:31:100:1 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:90:9:90:10 | g1 | | {EXTERNAL LOCATION} | Box | +| dereference.rs:90:9:90:10 | g1 | A | {EXTERNAL LOCATION} | Global | +| dereference.rs:90:9:90:10 | g1 | T | {EXTERNAL LOCATION} | char | +| dereference.rs:90:25:90:37 | ...::new(...) | | {EXTERNAL LOCATION} | Box | +| dereference.rs:90:25:90:37 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | +| dereference.rs:90:34:90:36 | 'a' | | {EXTERNAL LOCATION} | char | +| dereference.rs:91:15:91:16 | g1 | | {EXTERNAL LOCATION} | Box | +| dereference.rs:91:15:91:16 | g1 | A | {EXTERNAL LOCATION} | Global | +| dereference.rs:91:15:91:16 | g1 | T | {EXTERNAL LOCATION} | char | +| dereference.rs:94:9:94:10 | g2 | | {EXTERNAL LOCATION} | Box | +| dereference.rs:94:9:94:10 | g2 | A | {EXTERNAL LOCATION} | Global | +| dereference.rs:94:9:94:10 | g2 | T | {EXTERNAL LOCATION} | char | +| dereference.rs:94:25:94:37 | ...::new(...) | | {EXTERNAL LOCATION} | Box | +| dereference.rs:94:25:94:37 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | +| dereference.rs:94:34:94:36 | 'a' | | {EXTERNAL LOCATION} | char | +| dereference.rs:95:16:95:17 | g2 | | {EXTERNAL LOCATION} | Box | +| dereference.rs:95:16:95:17 | g2 | A | {EXTERNAL LOCATION} | Global | +| dereference.rs:95:16:95:17 | g2 | T | {EXTERNAL LOCATION} | char | +| dereference.rs:98:9:98:10 | g3 | | {EXTERNAL LOCATION} | Box | +| dereference.rs:98:9:98:10 | g3 | A | {EXTERNAL LOCATION} | Global | +| dereference.rs:98:9:98:10 | g3 | T | {EXTERNAL LOCATION} | i64 | +| dereference.rs:98:24:98:38 | ...::new(...) | | {EXTERNAL LOCATION} | Box | +| dereference.rs:98:24:98:38 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | +| dereference.rs:98:33:98:37 | 34i64 | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:99:17:99:18 | g3 | | {EXTERNAL LOCATION} | Box | +| dereference.rs:99:17:99:18 | g3 | A | {EXTERNAL LOCATION} | Global | +| dereference.rs:99:17:99:18 | g3 | T | {EXTERNAL LOCATION} | i64 | +| dereference.rs:102:27:117:1 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:104:9:104:9 | x | | dereference.rs:5:1:7:1 | MyIntPointer | +| dereference.rs:104:13:104:41 | MyIntPointer {...} | | dereference.rs:5:1:7:1 | MyIntPointer | +| dereference.rs:104:35:104:39 | 34i64 | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:105:14:105:14 | x | | dereference.rs:5:1:7:1 | MyIntPointer | +| dereference.rs:108:9:108:9 | x | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:108:13:108:43 | MySmartPointer {...} | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:108:37:108:41 | 34i64 | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:109:14:109:14 | x | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:111:9:111:9 | z | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:111:13:111:45 | MySmartPointer {...} | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:111:39:111:42 | 0i64 | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:112:14:112:14 | z | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:114:9:114:9 | v | | {EXTERNAL LOCATION} | Vec | +| dereference.rs:114:9:114:9 | v | A | {EXTERNAL LOCATION} | Global | +| dereference.rs:114:13:114:22 | ...::new(...) | | {EXTERNAL LOCATION} | Vec | +| dereference.rs:114:13:114:22 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | +| dereference.rs:115:13:115:13 | x | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:115:17:115:43 | MySmartPointer {...} | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:115:41:115:41 | v | | {EXTERNAL LOCATION} | Vec | +| dereference.rs:115:41:115:41 | v | A | {EXTERNAL LOCATION} | Global | +| dereference.rs:116:5:116:5 | x | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:143:19:151:5 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:144:17:144:26 | key_to_key | | {EXTERNAL LOCATION} | HashMap | +| dereference.rs:144:17:144:26 | key_to_key | K | {EXTERNAL LOCATION} | & | +| dereference.rs:144:17:144:26 | key_to_key | K.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:144:17:144:26 | key_to_key | S | {EXTERNAL LOCATION} | RandomState | +| dereference.rs:144:17:144:26 | key_to_key | V | {EXTERNAL LOCATION} | & | +| dereference.rs:144:17:144:26 | key_to_key | V.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:144:30:144:57 | ...::new(...) | | {EXTERNAL LOCATION} | HashMap | +| dereference.rs:144:30:144:57 | ...::new(...) | K | {EXTERNAL LOCATION} | & | +| dereference.rs:144:30:144:57 | ...::new(...) | K.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:144:30:144:57 | ...::new(...) | S | {EXTERNAL LOCATION} | RandomState | +| dereference.rs:144:30:144:57 | ...::new(...) | V | {EXTERNAL LOCATION} | & | +| dereference.rs:144:30:144:57 | ...::new(...) | V.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:145:17:145:19 | key | | {EXTERNAL LOCATION} | & | +| dereference.rs:145:23:145:29 | &... | | {EXTERNAL LOCATION} | & | +| dereference.rs:145:24:145:29 | Key {...} | | dereference.rs:122:5:123:21 | Key | +| dereference.rs:146:9:149:9 | if ... {...} | | {EXTERNAL LOCATION} | () | +| dereference.rs:146:32:146:41 | key_to_key | | {EXTERNAL LOCATION} | HashMap | +| dereference.rs:146:32:146:41 | key_to_key | K | {EXTERNAL LOCATION} | & | +| dereference.rs:146:32:146:41 | key_to_key | K.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:146:32:146:41 | key_to_key | S | {EXTERNAL LOCATION} | RandomState | +| dereference.rs:146:32:146:41 | key_to_key | V | {EXTERNAL LOCATION} | & | +| dereference.rs:146:32:146:41 | key_to_key | V.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:146:47:146:49 | key | | {EXTERNAL LOCATION} | & | +| dereference.rs:146:52:149:9 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:148:13:148:15 | key | | {EXTERNAL LOCATION} | & | +| dereference.rs:150:9:150:18 | key_to_key | | {EXTERNAL LOCATION} | HashMap | +| dereference.rs:150:9:150:18 | key_to_key | K | {EXTERNAL LOCATION} | & | +| dereference.rs:150:9:150:18 | key_to_key | K.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:150:9:150:18 | key_to_key | S | {EXTERNAL LOCATION} | RandomState | +| dereference.rs:150:9:150:18 | key_to_key | V | {EXTERNAL LOCATION} | & | +| dereference.rs:150:9:150:18 | key_to_key | V.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:150:27:150:29 | key | | {EXTERNAL LOCATION} | & | +| dereference.rs:150:32:150:34 | key | | {EXTERNAL LOCATION} | & | +| dereference.rs:156:16:156:19 | SelfParam | | dereference.rs:155:5:157:5 | Self [trait MyTrait1] | +| dereference.rs:163:16:163:19 | SelfParam | | {EXTERNAL LOCATION} | & | +| dereference.rs:163:16:163:19 | SelfParam | TRef | dereference.rs:159:5:159:13 | S | +| dereference.rs:163:27:165:9 | { ... } | | dereference.rs:159:5:159:13 | S | +| dereference.rs:170:16:170:19 | SelfParam | | {EXTERNAL LOCATION} | &mut | +| dereference.rs:170:16:170:19 | SelfParam | TRefMut | dereference.rs:159:5:159:13 | S | +| dereference.rs:170:29:172:9 | { ... } | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:176:16:176:19 | SelfParam | | dereference.rs:175:5:177:5 | Self [trait MyTrait2] | +| dereference.rs:176:22:176:24 | arg | | dereference.rs:175:20:175:21 | T1 | +| dereference.rs:181:16:181:19 | SelfParam | | dereference.rs:159:5:159:13 | S | +| dereference.rs:181:22:181:24 | arg | | {EXTERNAL LOCATION} | & | +| dereference.rs:181:22:181:24 | arg | TRef | dereference.rs:159:5:159:13 | S | +| dereference.rs:181:36:183:9 | { ... } | | dereference.rs:159:5:159:13 | S | +| dereference.rs:188:16:188:19 | SelfParam | | dereference.rs:159:5:159:13 | S | +| dereference.rs:188:22:188:24 | arg | | {EXTERNAL LOCATION} | &mut | +| dereference.rs:188:22:188:24 | arg | TRefMut | dereference.rs:159:5:159:13 | S | +| dereference.rs:188:42:190:9 | { ... } | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:193:19:200:5 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:194:17:194:20 | (...) | | {EXTERNAL LOCATION} | & | +| dereference.rs:194:18:194:19 | &S | | {EXTERNAL LOCATION} | & | +| dereference.rs:196:17:196:24 | (...) | | {EXTERNAL LOCATION} | &mut | +| dereference.rs:196:18:196:23 | &mut S | | {EXTERNAL LOCATION} | &mut | +| dereference.rs:198:23:198:24 | &S | | {EXTERNAL LOCATION} | & | +| dereference.rs:199:23:199:28 | &mut S | | {EXTERNAL LOCATION} | &mut | | dereference.rs:208:16:208:20 | SelfParam | | {EXTERNAL LOCATION} | & | -| dereference.rs:208:16:208:20 | SelfParam | TRef | dereference.rs:193:5:193:17 | Foo | -| dereference.rs:208:23:210:9 | { ... } | | {EXTERNAL LOCATION} | () | -| dereference.rs:209:22:209:37 | "In trait impl!\\n" | | {EXTERNAL LOCATION} | & | -| dereference.rs:209:22:209:37 | "In trait impl!\\n" | TRef | {EXTERNAL LOCATION} | str | -| dereference.rs:209:22:209:37 | ...::_print(...) | | {EXTERNAL LOCATION} | () | -| dereference.rs:209:22:209:37 | { ... } | | {EXTERNAL LOCATION} | () | -| dereference.rs:213:19:216:5 | { ... } | | {EXTERNAL LOCATION} | () | -| dereference.rs:214:17:214:17 | f | | dereference.rs:193:5:193:17 | Foo | -| dereference.rs:214:21:214:26 | Foo {...} | | dereference.rs:193:5:193:17 | Foo | -| dereference.rs:215:9:215:9 | f | | dereference.rs:193:5:193:17 | Foo | -| dereference.rs:219:15:228:1 | { ... } | | {EXTERNAL LOCATION} | () | -| dereference.rs:220:5:220:38 | explicit_monomorphic_dereference(...) | | {EXTERNAL LOCATION} | () | -| dereference.rs:221:5:221:38 | explicit_polymorphic_dereference(...) | | {EXTERNAL LOCATION} | () | -| dereference.rs:222:5:222:30 | explicit_ref_dereference(...) | | {EXTERNAL LOCATION} | () | -| dereference.rs:223:5:223:30 | explicit_box_dereference(...) | | {EXTERNAL LOCATION} | () | -| dereference.rs:224:5:224:26 | implicit_dereference(...) | | {EXTERNAL LOCATION} | () | -| dereference.rs:225:5:225:41 | ...::test(...) | | {EXTERNAL LOCATION} | () | -| dereference.rs:226:5:226:26 | ...::test(...) | | {EXTERNAL LOCATION} | () | -| dereference.rs:227:5:227:34 | ...::main(...) | | {EXTERNAL LOCATION} | () | +| dereference.rs:208:16:208:20 | SelfParam | TRef | dereference.rs:207:5:209:5 | Self [trait Bar] | +| dereference.rs:213:16:213:24 | SelfParam | | {EXTERNAL LOCATION} | &mut | +| dereference.rs:213:16:213:24 | SelfParam | TRefMut | dereference.rs:205:5:205:17 | Foo | +| dereference.rs:213:27:215:9 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:214:22:214:38 | "In struct impl!\\n" | | {EXTERNAL LOCATION} | & | +| dereference.rs:214:22:214:38 | "In struct impl!\\n" | TRef | {EXTERNAL LOCATION} | str | +| dereference.rs:214:22:214:38 | ...::_print(...) | | {EXTERNAL LOCATION} | () | +| dereference.rs:214:22:214:38 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:220:16:220:20 | SelfParam | | {EXTERNAL LOCATION} | & | +| dereference.rs:220:16:220:20 | SelfParam | TRef | dereference.rs:205:5:205:17 | Foo | +| dereference.rs:220:23:222:9 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:221:22:221:37 | "In trait impl!\\n" | | {EXTERNAL LOCATION} | & | +| dereference.rs:221:22:221:37 | "In trait impl!\\n" | TRef | {EXTERNAL LOCATION} | str | +| dereference.rs:221:22:221:37 | ...::_print(...) | | {EXTERNAL LOCATION} | () | +| dereference.rs:221:22:221:37 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:225:19:228:5 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:226:17:226:17 | f | | dereference.rs:205:5:205:17 | Foo | +| dereference.rs:226:21:226:26 | Foo {...} | | dereference.rs:205:5:205:17 | Foo | +| dereference.rs:227:9:227:9 | f | | dereference.rs:205:5:205:17 | Foo | +| dereference.rs:231:15:240:1 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:232:5:232:38 | explicit_monomorphic_dereference(...) | | {EXTERNAL LOCATION} | () | +| dereference.rs:233:5:233:38 | explicit_polymorphic_dereference(...) | | {EXTERNAL LOCATION} | () | +| dereference.rs:234:5:234:30 | explicit_ref_dereference(...) | | {EXTERNAL LOCATION} | () | +| dereference.rs:235:5:235:30 | explicit_box_dereference(...) | | {EXTERNAL LOCATION} | () | +| dereference.rs:236:5:236:26 | implicit_dereference(...) | | {EXTERNAL LOCATION} | () | +| dereference.rs:237:5:237:41 | ...::test(...) | | {EXTERNAL LOCATION} | () | +| dereference.rs:238:5:238:26 | ...::test(...) | | {EXTERNAL LOCATION} | () | +| dereference.rs:239:5:239:34 | ...::main(...) | | {EXTERNAL LOCATION} | () | | dyn_type.rs:7:10:7:14 | SelfParam | | {EXTERNAL LOCATION} | & | | dyn_type.rs:7:10:7:14 | SelfParam | TRef | dyn_type.rs:5:1:8:1 | Self [trait MyTrait1] | | dyn_type.rs:12:12:12:16 | SelfParam | | {EXTERNAL LOCATION} | & | @@ -4590,13 +4608,18 @@ inferType | blanket_impl.rs:55:18:55:25 | ...::_print(...) | | {EXTERNAL LOCATION} | () | | blanket_impl.rs:55:18:55:25 | { ... } | | {EXTERNAL LOCATION} | () | | blanket_impl.rs:55:20:55:21 | x5 | | blanket_impl.rs:6:5:7:14 | S1 | +| blanket_impl.rs:56:13:56:14 | x6 | | blanket_impl.rs:6:5:7:14 | S1 | | blanket_impl.rs:56:18:56:19 | S2 | | blanket_impl.rs:9:5:10:14 | S2 | +| blanket_impl.rs:56:18:56:31 | S2.duplicate() | | blanket_impl.rs:6:5:7:14 | S1 | | blanket_impl.rs:57:18:57:25 | "{x6:?}\\n" | | {EXTERNAL LOCATION} | & | | blanket_impl.rs:57:18:57:25 | "{x6:?}\\n" | TRef | {EXTERNAL LOCATION} | str | | blanket_impl.rs:57:18:57:25 | ...::_print(...) | | {EXTERNAL LOCATION} | () | | blanket_impl.rs:57:18:57:25 | { ... } | | {EXTERNAL LOCATION} | () | +| blanket_impl.rs:57:20:57:21 | x6 | | blanket_impl.rs:6:5:7:14 | S1 | +| blanket_impl.rs:58:13:58:14 | x7 | | blanket_impl.rs:6:5:7:14 | S1 | | blanket_impl.rs:58:18:58:22 | (...) | | {EXTERNAL LOCATION} | & | | blanket_impl.rs:58:18:58:22 | (...) | TRef | blanket_impl.rs:9:5:10:14 | S2 | +| blanket_impl.rs:58:18:58:34 | ... .duplicate() | | blanket_impl.rs:6:5:7:14 | S1 | | blanket_impl.rs:58:19:58:21 | &S2 | | {EXTERNAL LOCATION} | & | | blanket_impl.rs:58:19:58:21 | &S2 | TRef | blanket_impl.rs:9:5:10:14 | S2 | | blanket_impl.rs:58:20:58:21 | S2 | | blanket_impl.rs:9:5:10:14 | S2 | @@ -4604,6 +4627,7 @@ inferType | blanket_impl.rs:59:18:59:25 | "{x7:?}\\n" | TRef | {EXTERNAL LOCATION} | str | | blanket_impl.rs:59:18:59:25 | ...::_print(...) | | {EXTERNAL LOCATION} | () | | blanket_impl.rs:59:18:59:25 | { ... } | | {EXTERNAL LOCATION} | () | +| blanket_impl.rs:59:20:59:21 | x7 | | blanket_impl.rs:6:5:7:14 | S1 | | blanket_impl.rs:68:24:68:24 | x | | {EXTERNAL LOCATION} | i64 | | blanket_impl.rs:68:32:68:32 | y | | blanket_impl.rs:67:5:69:5 | Self [trait Trait1] | | blanket_impl.rs:72:24:72:24 | x | | {EXTERNAL LOCATION} | i64 | @@ -5057,352 +5081,394 @@ inferType | closure.rs:74:41:74:41 | _ | | {EXTERNAL LOCATION} | i64 | | closure.rs:74:49:74:52 | true | | {EXTERNAL LOCATION} | bool | | closure.rs:74:56:74:56 | 3 | | {EXTERNAL LOCATION} | i32 | -| dereference.rs:12:14:12:18 | SelfParam | | {EXTERNAL LOCATION} | & | -| dereference.rs:12:14:12:18 | SelfParam | TRef | dereference.rs:4:1:6:1 | MyIntPointer | -| dereference.rs:12:29:14:5 | { ... } | | {EXTERNAL LOCATION} | & | -| dereference.rs:12:29:14:5 | { ... } | TRef | {EXTERNAL LOCATION} | i64 | -| dereference.rs:13:9:13:19 | &... | | {EXTERNAL LOCATION} | & | -| dereference.rs:13:9:13:19 | &... | TRef | {EXTERNAL LOCATION} | i64 | -| dereference.rs:13:10:13:13 | self | | {EXTERNAL LOCATION} | & | -| dereference.rs:13:10:13:13 | self | TRef | dereference.rs:4:1:6:1 | MyIntPointer | -| dereference.rs:13:10:13:19 | self.value | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:25:14:25:18 | SelfParam | | {EXTERNAL LOCATION} | & | -| dereference.rs:25:14:25:18 | SelfParam | TRef | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:25:14:25:18 | SelfParam | TRef.T | dereference.rs:21:6:21:6 | T | -| dereference.rs:25:27:27:5 | { ... } | | {EXTERNAL LOCATION} | & | -| dereference.rs:25:27:27:5 | { ... } | TRef | dereference.rs:21:6:21:6 | T | -| dereference.rs:26:9:26:19 | &... | | {EXTERNAL LOCATION} | & | -| dereference.rs:26:9:26:19 | &... | TRef | dereference.rs:21:6:21:6 | T | -| dereference.rs:26:10:26:13 | self | | {EXTERNAL LOCATION} | & | -| dereference.rs:26:10:26:13 | self | TRef | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:26:10:26:13 | self | TRef.T | dereference.rs:21:6:21:6 | T | -| dereference.rs:26:10:26:19 | self.value | | dereference.rs:21:6:21:6 | T | -| dereference.rs:33:12:33:16 | SelfParam | | {EXTERNAL LOCATION} | & | -| dereference.rs:33:12:33:16 | SelfParam | TRef | dereference.rs:30:1:30:15 | S | -| dereference.rs:33:12:33:16 | SelfParam | TRef.T | dereference.rs:32:6:32:6 | T | -| dereference.rs:33:25:35:5 | { ... } | | {EXTERNAL LOCATION} | & | -| dereference.rs:33:25:35:5 | { ... } | TRef | dereference.rs:32:6:32:6 | T | -| dereference.rs:34:9:34:15 | &... | | {EXTERNAL LOCATION} | & | -| dereference.rs:34:9:34:15 | &... | TRef | dereference.rs:32:6:32:6 | T | -| dereference.rs:34:10:34:13 | self | | {EXTERNAL LOCATION} | & | -| dereference.rs:34:10:34:13 | self | TRef | dereference.rs:30:1:30:15 | S | -| dereference.rs:34:10:34:13 | self | TRef.T | dereference.rs:32:6:32:6 | T | -| dereference.rs:34:10:34:15 | self.0 | | dereference.rs:32:6:32:6 | T | -| dereference.rs:38:39:50:1 | { ... } | | {EXTERNAL LOCATION} | () | -| dereference.rs:40:9:40:10 | a1 | | dereference.rs:4:1:6:1 | MyIntPointer | -| dereference.rs:40:14:40:42 | MyIntPointer {...} | | dereference.rs:4:1:6:1 | MyIntPointer | -| dereference.rs:40:36:40:40 | 34i64 | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:41:9:41:11 | _b1 | | {EXTERNAL LOCATION} | & | -| dereference.rs:41:9:41:11 | _b1 | TRef | {EXTERNAL LOCATION} | i64 | -| dereference.rs:41:15:41:16 | a1 | | dereference.rs:4:1:6:1 | MyIntPointer | -| dereference.rs:41:15:41:24 | a1.deref() | | {EXTERNAL LOCATION} | & | -| dereference.rs:41:15:41:24 | a1.deref() | TRef | {EXTERNAL LOCATION} | i64 | -| dereference.rs:44:9:44:10 | a2 | | dereference.rs:4:1:6:1 | MyIntPointer | -| dereference.rs:44:14:44:42 | MyIntPointer {...} | | dereference.rs:4:1:6:1 | MyIntPointer | -| dereference.rs:44:36:44:40 | 34i64 | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:45:9:45:11 | _b2 | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:45:15:45:17 | * ... | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:45:16:45:17 | a2 | | dereference.rs:4:1:6:1 | MyIntPointer | -| dereference.rs:48:9:48:10 | a3 | | dereference.rs:4:1:6:1 | MyIntPointer | -| dereference.rs:48:14:48:42 | MyIntPointer {...} | | dereference.rs:4:1:6:1 | MyIntPointer | +| dereference.rs:13:14:13:18 | SelfParam | | {EXTERNAL LOCATION} | & | +| dereference.rs:13:14:13:18 | SelfParam | TRef | dereference.rs:5:1:7:1 | MyIntPointer | +| dereference.rs:13:29:15:5 | { ... } | | {EXTERNAL LOCATION} | & | +| dereference.rs:13:29:15:5 | { ... } | TRef | {EXTERNAL LOCATION} | i64 | +| dereference.rs:14:9:14:19 | &... | | {EXTERNAL LOCATION} | & | +| dereference.rs:14:9:14:19 | &... | TRef | {EXTERNAL LOCATION} | i64 | +| dereference.rs:14:10:14:13 | self | | {EXTERNAL LOCATION} | & | +| dereference.rs:14:10:14:13 | self | TRef | dereference.rs:5:1:7:1 | MyIntPointer | +| dereference.rs:14:10:14:19 | self.value | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:26:14:26:18 | SelfParam | | {EXTERNAL LOCATION} | & | +| dereference.rs:26:14:26:18 | SelfParam | TRef | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:26:14:26:18 | SelfParam | TRef.T | dereference.rs:22:6:22:6 | T | +| dereference.rs:26:27:28:5 | { ... } | | {EXTERNAL LOCATION} | & | +| dereference.rs:26:27:28:5 | { ... } | TRef | dereference.rs:22:6:22:6 | T | +| dereference.rs:27:9:27:19 | &... | | {EXTERNAL LOCATION} | & | +| dereference.rs:27:9:27:19 | &... | TRef | dereference.rs:22:6:22:6 | T | +| dereference.rs:27:10:27:13 | self | | {EXTERNAL LOCATION} | & | +| dereference.rs:27:10:27:13 | self | TRef | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:27:10:27:13 | self | TRef.T | dereference.rs:22:6:22:6 | T | +| dereference.rs:27:10:27:19 | self.value | | dereference.rs:22:6:22:6 | T | +| dereference.rs:33:18:33:26 | SelfParam | | {EXTERNAL LOCATION} | &mut | +| dereference.rs:33:18:33:26 | SelfParam | TRefMut | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:33:18:33:26 | SelfParam | TRefMut.T | dereference.rs:31:6:31:6 | T | +| dereference.rs:33:39:35:5 | { ... } | | {EXTERNAL LOCATION} | &mut | +| dereference.rs:33:39:35:5 | { ... } | TRefMut | dereference.rs:31:6:31:6 | T | +| dereference.rs:34:9:34:23 | &mut ... | | {EXTERNAL LOCATION} | &mut | +| dereference.rs:34:9:34:23 | &mut ... | TRefMut | dereference.rs:31:6:31:6 | T | +| dereference.rs:34:14:34:17 | self | | {EXTERNAL LOCATION} | &mut | +| dereference.rs:34:14:34:17 | self | TRefMut | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:34:14:34:17 | self | TRefMut.T | dereference.rs:31:6:31:6 | T | +| dereference.rs:34:14:34:23 | self.value | | dereference.rs:31:6:31:6 | T | +| dereference.rs:41:12:41:16 | SelfParam | | {EXTERNAL LOCATION} | & | +| dereference.rs:41:12:41:16 | SelfParam | TRef | dereference.rs:38:1:38:15 | S | +| dereference.rs:41:12:41:16 | SelfParam | TRef.T | dereference.rs:40:6:40:6 | T | +| dereference.rs:41:25:43:5 | { ... } | | {EXTERNAL LOCATION} | & | +| dereference.rs:41:25:43:5 | { ... } | TRef | dereference.rs:40:6:40:6 | T | +| dereference.rs:42:9:42:15 | &... | | {EXTERNAL LOCATION} | & | +| dereference.rs:42:9:42:15 | &... | TRef | dereference.rs:40:6:40:6 | T | +| dereference.rs:42:10:42:13 | self | | {EXTERNAL LOCATION} | & | +| dereference.rs:42:10:42:13 | self | TRef | dereference.rs:38:1:38:15 | S | +| dereference.rs:42:10:42:13 | self | TRef.T | dereference.rs:40:6:40:6 | T | +| dereference.rs:42:10:42:15 | self.0 | | dereference.rs:40:6:40:6 | T | +| dereference.rs:46:39:58:1 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:48:9:48:10 | a1 | | dereference.rs:5:1:7:1 | MyIntPointer | +| dereference.rs:48:14:48:42 | MyIntPointer {...} | | dereference.rs:5:1:7:1 | MyIntPointer | | dereference.rs:48:36:48:40 | 34i64 | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:49:9:49:11 | _b3 | | {EXTERNAL LOCATION} | bool | -| dereference.rs:49:15:49:19 | (...) | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:49:15:49:33 | ... .is_positive() | | {EXTERNAL LOCATION} | bool | -| dereference.rs:49:16:49:18 | * ... | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:49:17:49:18 | a3 | | dereference.rs:4:1:6:1 | MyIntPointer | -| dereference.rs:52:39:64:1 | { ... } | | {EXTERNAL LOCATION} | () | -| dereference.rs:54:9:54:10 | c1 | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:54:9:54:10 | c1 | T | {EXTERNAL LOCATION} | char | -| dereference.rs:54:14:54:42 | MySmartPointer {...} | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:54:14:54:42 | MySmartPointer {...} | T | {EXTERNAL LOCATION} | char | -| dereference.rs:54:38:54:40 | 'a' | | {EXTERNAL LOCATION} | char | -| dereference.rs:55:9:55:11 | _d1 | | {EXTERNAL LOCATION} | & | -| dereference.rs:55:9:55:11 | _d1 | TRef | {EXTERNAL LOCATION} | char | -| dereference.rs:55:15:55:16 | c1 | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:55:15:55:16 | c1 | T | {EXTERNAL LOCATION} | char | -| dereference.rs:55:15:55:24 | c1.deref() | | {EXTERNAL LOCATION} | & | -| dereference.rs:55:15:55:24 | c1.deref() | TRef | {EXTERNAL LOCATION} | char | -| dereference.rs:58:9:58:10 | c2 | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:58:9:58:10 | c2 | T | {EXTERNAL LOCATION} | char | -| dereference.rs:58:14:58:42 | MySmartPointer {...} | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:58:14:58:42 | MySmartPointer {...} | T | {EXTERNAL LOCATION} | char | -| dereference.rs:58:38:58:40 | 'a' | | {EXTERNAL LOCATION} | char | -| dereference.rs:59:9:59:11 | _d2 | | {EXTERNAL LOCATION} | char | -| dereference.rs:59:15:59:17 | * ... | | {EXTERNAL LOCATION} | char | -| dereference.rs:59:16:59:17 | c2 | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:59:16:59:17 | c2 | T | {EXTERNAL LOCATION} | char | -| dereference.rs:62:9:62:10 | c3 | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:62:9:62:10 | c3 | T | {EXTERNAL LOCATION} | i64 | -| dereference.rs:62:14:62:44 | MySmartPointer {...} | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:62:14:62:44 | MySmartPointer {...} | T | {EXTERNAL LOCATION} | i64 | -| dereference.rs:62:38:62:42 | 34i64 | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:63:9:63:11 | _d3 | | {EXTERNAL LOCATION} | bool | -| dereference.rs:63:15:63:19 | (...) | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:63:15:63:33 | ... .is_positive() | | {EXTERNAL LOCATION} | bool | -| dereference.rs:63:16:63:18 | * ... | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:63:17:63:18 | c3 | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:63:17:63:18 | c3 | T | {EXTERNAL LOCATION} | i64 | -| dereference.rs:66:31:78:1 | { ... } | | {EXTERNAL LOCATION} | () | -| dereference.rs:68:9:68:10 | e1 | | {EXTERNAL LOCATION} | & | -| dereference.rs:68:9:68:10 | e1 | TRef | {EXTERNAL LOCATION} | char | -| dereference.rs:68:14:68:17 | &'a' | | {EXTERNAL LOCATION} | & | -| dereference.rs:68:14:68:17 | &'a' | TRef | {EXTERNAL LOCATION} | char | -| dereference.rs:68:15:68:17 | 'a' | | {EXTERNAL LOCATION} | char | -| dereference.rs:69:9:69:11 | _f1 | | {EXTERNAL LOCATION} | & | -| dereference.rs:69:9:69:11 | _f1 | TRef | {EXTERNAL LOCATION} | char | -| dereference.rs:69:15:69:16 | e1 | | {EXTERNAL LOCATION} | & | -| dereference.rs:69:15:69:16 | e1 | TRef | {EXTERNAL LOCATION} | char | -| dereference.rs:69:15:69:24 | e1.deref() | | {EXTERNAL LOCATION} | & | -| dereference.rs:69:15:69:24 | e1.deref() | TRef | {EXTERNAL LOCATION} | char | -| dereference.rs:72:9:72:10 | e2 | | {EXTERNAL LOCATION} | & | -| dereference.rs:72:9:72:10 | e2 | TRef | {EXTERNAL LOCATION} | char | -| dereference.rs:72:14:72:17 | &'a' | | {EXTERNAL LOCATION} | & | -| dereference.rs:72:14:72:17 | &'a' | TRef | {EXTERNAL LOCATION} | char | -| dereference.rs:72:15:72:17 | 'a' | | {EXTERNAL LOCATION} | char | -| dereference.rs:73:9:73:11 | _f2 | | {EXTERNAL LOCATION} | char | -| dereference.rs:73:15:73:17 | * ... | | {EXTERNAL LOCATION} | char | -| dereference.rs:73:16:73:17 | e2 | | {EXTERNAL LOCATION} | & | -| dereference.rs:73:16:73:17 | e2 | TRef | {EXTERNAL LOCATION} | char | -| dereference.rs:76:9:76:10 | e3 | | {EXTERNAL LOCATION} | & | -| dereference.rs:76:9:76:10 | e3 | TRef | {EXTERNAL LOCATION} | i64 | -| dereference.rs:76:14:76:19 | &34i64 | | {EXTERNAL LOCATION} | & | -| dereference.rs:76:14:76:19 | &34i64 | TRef | {EXTERNAL LOCATION} | i64 | -| dereference.rs:76:15:76:19 | 34i64 | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:77:9:77:11 | _f3 | | {EXTERNAL LOCATION} | bool | -| dereference.rs:77:15:77:19 | (...) | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:77:15:77:33 | ... .is_positive() | | {EXTERNAL LOCATION} | bool | -| dereference.rs:77:16:77:18 | * ... | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:77:17:77:18 | e3 | | {EXTERNAL LOCATION} | & | -| dereference.rs:77:17:77:18 | e3 | TRef | {EXTERNAL LOCATION} | i64 | -| dereference.rs:80:31:92:1 | { ... } | | {EXTERNAL LOCATION} | () | -| dereference.rs:82:9:82:10 | g1 | | {EXTERNAL LOCATION} | Box | -| dereference.rs:82:9:82:10 | g1 | A | {EXTERNAL LOCATION} | Global | -| dereference.rs:82:9:82:10 | g1 | T | {EXTERNAL LOCATION} | char | -| dereference.rs:82:25:82:37 | ...::new(...) | | {EXTERNAL LOCATION} | Box | -| dereference.rs:82:25:82:37 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | -| dereference.rs:82:25:82:37 | ...::new(...) | T | {EXTERNAL LOCATION} | char | -| dereference.rs:82:34:82:36 | 'a' | | {EXTERNAL LOCATION} | char | -| dereference.rs:83:9:83:11 | _h1 | | {EXTERNAL LOCATION} | & | -| dereference.rs:83:9:83:11 | _h1 | TRef | {EXTERNAL LOCATION} | char | -| dereference.rs:83:15:83:16 | g1 | | {EXTERNAL LOCATION} | Box | -| dereference.rs:83:15:83:16 | g1 | A | {EXTERNAL LOCATION} | Global | -| dereference.rs:83:15:83:16 | g1 | T | {EXTERNAL LOCATION} | char | -| dereference.rs:83:15:83:24 | g1.deref() | | {EXTERNAL LOCATION} | & | -| dereference.rs:83:15:83:24 | g1.deref() | TRef | {EXTERNAL LOCATION} | char | -| dereference.rs:86:9:86:10 | g2 | | {EXTERNAL LOCATION} | Box | -| dereference.rs:86:9:86:10 | g2 | A | {EXTERNAL LOCATION} | Global | -| dereference.rs:86:9:86:10 | g2 | T | {EXTERNAL LOCATION} | char | -| dereference.rs:86:25:86:37 | ...::new(...) | | {EXTERNAL LOCATION} | Box | -| dereference.rs:86:25:86:37 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | -| dereference.rs:86:25:86:37 | ...::new(...) | T | {EXTERNAL LOCATION} | char | -| dereference.rs:86:34:86:36 | 'a' | | {EXTERNAL LOCATION} | char | -| dereference.rs:87:9:87:11 | _h2 | | {EXTERNAL LOCATION} | char | -| dereference.rs:87:15:87:17 | * ... | | {EXTERNAL LOCATION} | char | -| dereference.rs:87:16:87:17 | g2 | | {EXTERNAL LOCATION} | Box | -| dereference.rs:87:16:87:17 | g2 | A | {EXTERNAL LOCATION} | Global | -| dereference.rs:87:16:87:17 | g2 | T | {EXTERNAL LOCATION} | char | -| dereference.rs:90:9:90:10 | g3 | | {EXTERNAL LOCATION} | Box | -| dereference.rs:90:9:90:10 | g3 | A | {EXTERNAL LOCATION} | Global | -| dereference.rs:90:9:90:10 | g3 | T | {EXTERNAL LOCATION} | i64 | -| dereference.rs:90:24:90:38 | ...::new(...) | | {EXTERNAL LOCATION} | Box | -| dereference.rs:90:24:90:38 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | -| dereference.rs:90:24:90:38 | ...::new(...) | T | {EXTERNAL LOCATION} | i64 | -| dereference.rs:90:33:90:37 | 34i64 | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:91:9:91:11 | _h3 | | {EXTERNAL LOCATION} | bool | -| dereference.rs:91:15:91:19 | (...) | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:91:15:91:33 | ... .is_positive() | | {EXTERNAL LOCATION} | bool | -| dereference.rs:91:16:91:18 | * ... | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:91:17:91:18 | g3 | | {EXTERNAL LOCATION} | Box | -| dereference.rs:91:17:91:18 | g3 | A | {EXTERNAL LOCATION} | Global | -| dereference.rs:91:17:91:18 | g3 | T | {EXTERNAL LOCATION} | i64 | -| dereference.rs:94:27:105:1 | { ... } | | {EXTERNAL LOCATION} | () | -| dereference.rs:96:9:96:9 | x | | dereference.rs:4:1:6:1 | MyIntPointer | -| dereference.rs:96:13:96:41 | MyIntPointer {...} | | dereference.rs:4:1:6:1 | MyIntPointer | -| dereference.rs:96:35:96:39 | 34i64 | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:97:14:97:14 | x | | dereference.rs:4:1:6:1 | MyIntPointer | -| dereference.rs:100:9:100:9 | x | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:100:9:100:9 | x | T | {EXTERNAL LOCATION} | i64 | -| dereference.rs:100:13:100:43 | MySmartPointer {...} | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:100:13:100:43 | MySmartPointer {...} | T | {EXTERNAL LOCATION} | i64 | -| dereference.rs:100:37:100:41 | 34i64 | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:101:14:101:14 | x | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:101:14:101:14 | x | T | {EXTERNAL LOCATION} | i64 | -| dereference.rs:103:9:103:9 | z | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:103:9:103:9 | z | T | dereference.rs:30:1:30:15 | S | -| dereference.rs:103:9:103:9 | z | T.T | {EXTERNAL LOCATION} | i64 | -| dereference.rs:103:13:103:45 | MySmartPointer {...} | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:103:13:103:45 | MySmartPointer {...} | T | dereference.rs:30:1:30:15 | S | -| dereference.rs:103:13:103:45 | MySmartPointer {...} | T.T | {EXTERNAL LOCATION} | i64 | -| dereference.rs:103:37:103:43 | S(...) | | dereference.rs:30:1:30:15 | S | -| dereference.rs:103:37:103:43 | S(...) | T | {EXTERNAL LOCATION} | i64 | -| dereference.rs:103:39:103:42 | 0i64 | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:104:14:104:14 | z | | dereference.rs:17:1:19:1 | MySmartPointer | -| dereference.rs:104:14:104:14 | z | T | dereference.rs:30:1:30:15 | S | -| dereference.rs:104:14:104:14 | z | T.T | {EXTERNAL LOCATION} | i64 | -| dereference.rs:131:19:139:5 | { ... } | | {EXTERNAL LOCATION} | () | -| dereference.rs:132:17:132:26 | key_to_key | | {EXTERNAL LOCATION} | HashMap | -| dereference.rs:132:17:132:26 | key_to_key | K | {EXTERNAL LOCATION} | & | -| dereference.rs:132:17:132:26 | key_to_key | K.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:132:17:132:26 | key_to_key | S | {EXTERNAL LOCATION} | RandomState | -| dereference.rs:132:17:132:26 | key_to_key | V | {EXTERNAL LOCATION} | & | -| dereference.rs:132:17:132:26 | key_to_key | V.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:132:30:132:57 | ...::new(...) | | {EXTERNAL LOCATION} | HashMap | -| dereference.rs:132:30:132:57 | ...::new(...) | K | {EXTERNAL LOCATION} | & | -| dereference.rs:132:30:132:57 | ...::new(...) | K.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:132:30:132:57 | ...::new(...) | S | {EXTERNAL LOCATION} | RandomState | -| dereference.rs:132:30:132:57 | ...::new(...) | V | {EXTERNAL LOCATION} | & | -| dereference.rs:132:30:132:57 | ...::new(...) | V.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:133:17:133:19 | key | | {EXTERNAL LOCATION} | & | -| dereference.rs:133:17:133:19 | key | TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:133:17:133:19 | key | TRef | {EXTERNAL LOCATION} | & | -| dereference.rs:133:17:133:19 | key | TRef.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:133:23:133:29 | &... | | {EXTERNAL LOCATION} | & | -| dereference.rs:133:23:133:29 | &... | TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:133:23:133:29 | &... | TRef | {EXTERNAL LOCATION} | & | -| dereference.rs:133:23:133:29 | &... | TRef.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:133:24:133:29 | Key {...} | | dereference.rs:110:5:111:21 | Key | -| dereference.rs:134:9:137:9 | if ... {...} | | {EXTERNAL LOCATION} | () | -| dereference.rs:134:16:134:28 | Some(...) | | {EXTERNAL LOCATION} | Option | -| dereference.rs:134:16:134:28 | Some(...) | T | {EXTERNAL LOCATION} | & | -| dereference.rs:134:16:134:28 | Some(...) | T.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:134:16:134:28 | Some(...) | T.TRef | {EXTERNAL LOCATION} | & | -| dereference.rs:134:16:134:28 | Some(...) | T.TRef.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:134:21:134:27 | ref_key | | {EXTERNAL LOCATION} | & | -| dereference.rs:134:21:134:27 | ref_key | TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:134:21:134:27 | ref_key | TRef | {EXTERNAL LOCATION} | & | -| dereference.rs:134:21:134:27 | ref_key | TRef.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:134:32:134:41 | key_to_key | | {EXTERNAL LOCATION} | HashMap | -| dereference.rs:134:32:134:41 | key_to_key | K | {EXTERNAL LOCATION} | & | -| dereference.rs:134:32:134:41 | key_to_key | K.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:134:32:134:41 | key_to_key | S | {EXTERNAL LOCATION} | RandomState | -| dereference.rs:134:32:134:41 | key_to_key | V | {EXTERNAL LOCATION} | & | -| dereference.rs:134:32:134:41 | key_to_key | V.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:134:32:134:50 | key_to_key.get(...) | | {EXTERNAL LOCATION} | Option | -| dereference.rs:134:32:134:50 | key_to_key.get(...) | T | {EXTERNAL LOCATION} | & | -| dereference.rs:134:32:134:50 | key_to_key.get(...) | T.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:134:32:134:50 | key_to_key.get(...) | T.TRef | {EXTERNAL LOCATION} | & | -| dereference.rs:134:32:134:50 | key_to_key.get(...) | T.TRef.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:134:47:134:49 | key | | {EXTERNAL LOCATION} | & | -| dereference.rs:134:47:134:49 | key | TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:134:47:134:49 | key | TRef | {EXTERNAL LOCATION} | & | -| dereference.rs:134:47:134:49 | key | TRef.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:134:52:137:9 | { ... } | | {EXTERNAL LOCATION} | () | -| dereference.rs:136:13:136:15 | key | | {EXTERNAL LOCATION} | & | -| dereference.rs:136:13:136:15 | key | TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:136:13:136:15 | key | TRef | {EXTERNAL LOCATION} | & | -| dereference.rs:136:13:136:15 | key | TRef.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:136:13:136:25 | ... = ... | | {EXTERNAL LOCATION} | () | -| dereference.rs:136:19:136:25 | ref_key | | {EXTERNAL LOCATION} | & | -| dereference.rs:136:19:136:25 | ref_key | TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:136:19:136:25 | ref_key | TRef | {EXTERNAL LOCATION} | & | -| dereference.rs:136:19:136:25 | ref_key | TRef.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:138:9:138:18 | key_to_key | | {EXTERNAL LOCATION} | HashMap | -| dereference.rs:138:9:138:18 | key_to_key | K | {EXTERNAL LOCATION} | & | -| dereference.rs:138:9:138:18 | key_to_key | K.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:138:9:138:18 | key_to_key | S | {EXTERNAL LOCATION} | RandomState | -| dereference.rs:138:9:138:18 | key_to_key | V | {EXTERNAL LOCATION} | & | -| dereference.rs:138:9:138:18 | key_to_key | V.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:138:9:138:35 | key_to_key.insert(...) | | {EXTERNAL LOCATION} | Option | -| dereference.rs:138:9:138:35 | key_to_key.insert(...) | T | {EXTERNAL LOCATION} | & | -| dereference.rs:138:9:138:35 | key_to_key.insert(...) | T.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:138:9:138:35 | key_to_key.insert(...) | T.TRef | {EXTERNAL LOCATION} | & | -| dereference.rs:138:9:138:35 | key_to_key.insert(...) | T.TRef.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:138:27:138:29 | key | | {EXTERNAL LOCATION} | & | -| dereference.rs:138:27:138:29 | key | TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:138:27:138:29 | key | TRef | {EXTERNAL LOCATION} | & | -| dereference.rs:138:27:138:29 | key | TRef.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:138:32:138:34 | key | | {EXTERNAL LOCATION} | & | -| dereference.rs:138:32:138:34 | key | TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:138:32:138:34 | key | TRef | {EXTERNAL LOCATION} | & | -| dereference.rs:138:32:138:34 | key | TRef.TRef | dereference.rs:110:5:111:21 | Key | -| dereference.rs:144:16:144:19 | SelfParam | | dereference.rs:143:5:145:5 | Self [trait MyTrait1] | -| dereference.rs:151:16:151:19 | SelfParam | | {EXTERNAL LOCATION} | & | -| dereference.rs:151:16:151:19 | SelfParam | TRef | dereference.rs:147:5:147:13 | S | -| dereference.rs:151:27:153:9 | { ... } | | dereference.rs:147:5:147:13 | S | -| dereference.rs:152:13:152:13 | S | | dereference.rs:147:5:147:13 | S | -| dereference.rs:158:16:158:19 | SelfParam | | {EXTERNAL LOCATION} | &mut | -| dereference.rs:158:16:158:19 | SelfParam | TRefMut | dereference.rs:147:5:147:13 | S | -| dereference.rs:158:29:160:9 | { ... } | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:159:13:159:14 | 42 | | {EXTERNAL LOCATION} | i32 | -| dereference.rs:159:13:159:14 | 42 | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:164:16:164:19 | SelfParam | | dereference.rs:163:5:165:5 | Self [trait MyTrait2] | -| dereference.rs:164:22:164:24 | arg | | dereference.rs:163:20:163:21 | T1 | -| dereference.rs:169:16:169:19 | SelfParam | | dereference.rs:147:5:147:13 | S | -| dereference.rs:169:22:169:24 | arg | | {EXTERNAL LOCATION} | & | -| dereference.rs:169:22:169:24 | arg | TRef | dereference.rs:147:5:147:13 | S | -| dereference.rs:169:36:171:9 | { ... } | | dereference.rs:147:5:147:13 | S | -| dereference.rs:170:13:170:13 | S | | dereference.rs:147:5:147:13 | S | -| dereference.rs:176:16:176:19 | SelfParam | | dereference.rs:147:5:147:13 | S | -| dereference.rs:176:22:176:24 | arg | | {EXTERNAL LOCATION} | &mut | -| dereference.rs:176:22:176:24 | arg | TRefMut | dereference.rs:147:5:147:13 | S | -| dereference.rs:176:42:178:9 | { ... } | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:177:13:177:14 | 42 | | {EXTERNAL LOCATION} | i32 | -| dereference.rs:177:13:177:14 | 42 | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:181:19:188:5 | { ... } | | {EXTERNAL LOCATION} | () | -| dereference.rs:182:13:182:13 | x | | dereference.rs:147:5:147:13 | S | -| dereference.rs:182:17:182:20 | (...) | | {EXTERNAL LOCATION} | & | -| dereference.rs:182:17:182:20 | (...) | TRef | dereference.rs:147:5:147:13 | S | -| dereference.rs:182:17:182:26 | ... .foo() | | dereference.rs:147:5:147:13 | S | -| dereference.rs:182:18:182:19 | &S | | {EXTERNAL LOCATION} | & | -| dereference.rs:182:18:182:19 | &S | TRef | dereference.rs:147:5:147:13 | S | -| dereference.rs:182:19:182:19 | S | | dereference.rs:147:5:147:13 | S | -| dereference.rs:183:13:183:13 | y | | dereference.rs:147:5:147:13 | S | -| dereference.rs:183:17:183:17 | S | | dereference.rs:147:5:147:13 | S | -| dereference.rs:183:17:183:23 | S.foo() | | dereference.rs:147:5:147:13 | S | -| dereference.rs:184:13:184:13 | z | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:184:17:184:24 | (...) | | {EXTERNAL LOCATION} | &mut | -| dereference.rs:184:17:184:24 | (...) | TRefMut | dereference.rs:147:5:147:13 | S | -| dereference.rs:184:17:184:30 | ... .foo() | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:184:18:184:23 | &mut S | | {EXTERNAL LOCATION} | &mut | -| dereference.rs:184:18:184:23 | &mut S | TRefMut | dereference.rs:147:5:147:13 | S | -| dereference.rs:184:23:184:23 | S | | dereference.rs:147:5:147:13 | S | -| dereference.rs:186:13:186:13 | x | | dereference.rs:147:5:147:13 | S | -| dereference.rs:186:17:186:17 | S | | dereference.rs:147:5:147:13 | S | -| dereference.rs:186:17:186:25 | S.bar(...) | | dereference.rs:147:5:147:13 | S | -| dereference.rs:186:23:186:24 | &S | | {EXTERNAL LOCATION} | & | -| dereference.rs:186:23:186:24 | &S | TRef | dereference.rs:147:5:147:13 | S | -| dereference.rs:186:24:186:24 | S | | dereference.rs:147:5:147:13 | S | -| dereference.rs:187:13:187:13 | y | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:187:17:187:17 | S | | dereference.rs:147:5:147:13 | S | -| dereference.rs:187:17:187:29 | S.bar(...) | | {EXTERNAL LOCATION} | i64 | -| dereference.rs:187:23:187:28 | &mut S | | {EXTERNAL LOCATION} | &mut | -| dereference.rs:187:23:187:28 | &mut S | TRefMut | dereference.rs:147:5:147:13 | S | -| dereference.rs:187:28:187:28 | S | | dereference.rs:147:5:147:13 | S | -| dereference.rs:196:16:196:20 | SelfParam | | {EXTERNAL LOCATION} | & | -| dereference.rs:196:16:196:20 | SelfParam | TRef | dereference.rs:195:5:197:5 | Self [trait Bar] | -| dereference.rs:201:16:201:24 | SelfParam | | {EXTERNAL LOCATION} | &mut | -| dereference.rs:201:16:201:24 | SelfParam | TRefMut | dereference.rs:193:5:193:17 | Foo | -| dereference.rs:201:27:203:9 | { ... } | | {EXTERNAL LOCATION} | () | -| dereference.rs:202:13:202:39 | MacroExpr | | {EXTERNAL LOCATION} | () | -| dereference.rs:202:22:202:38 | "In struct impl!\\n" | | {EXTERNAL LOCATION} | & | -| dereference.rs:202:22:202:38 | "In struct impl!\\n" | TRef | {EXTERNAL LOCATION} | str | -| dereference.rs:202:22:202:38 | ...::_print(...) | | {EXTERNAL LOCATION} | () | -| dereference.rs:202:22:202:38 | MacroBlockExpr | | {EXTERNAL LOCATION} | () | -| dereference.rs:202:22:202:38 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:49:9:49:11 | _b1 | | {EXTERNAL LOCATION} | & | +| dereference.rs:49:9:49:11 | _b1 | TRef | {EXTERNAL LOCATION} | i64 | +| dereference.rs:49:15:49:16 | a1 | | dereference.rs:5:1:7:1 | MyIntPointer | +| dereference.rs:49:15:49:24 | a1.deref() | | {EXTERNAL LOCATION} | & | +| dereference.rs:49:15:49:24 | a1.deref() | TRef | {EXTERNAL LOCATION} | i64 | +| dereference.rs:52:9:52:10 | a2 | | dereference.rs:5:1:7:1 | MyIntPointer | +| dereference.rs:52:14:52:42 | MyIntPointer {...} | | dereference.rs:5:1:7:1 | MyIntPointer | +| dereference.rs:52:36:52:40 | 34i64 | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:53:9:53:11 | _b2 | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:53:15:53:17 | * ... | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:53:16:53:17 | a2 | | dereference.rs:5:1:7:1 | MyIntPointer | +| dereference.rs:56:9:56:10 | a3 | | dereference.rs:5:1:7:1 | MyIntPointer | +| dereference.rs:56:14:56:42 | MyIntPointer {...} | | dereference.rs:5:1:7:1 | MyIntPointer | +| dereference.rs:56:36:56:40 | 34i64 | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:57:9:57:11 | _b3 | | {EXTERNAL LOCATION} | bool | +| dereference.rs:57:15:57:19 | (...) | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:57:15:57:33 | ... .is_positive() | | {EXTERNAL LOCATION} | bool | +| dereference.rs:57:16:57:18 | * ... | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:57:17:57:18 | a3 | | dereference.rs:5:1:7:1 | MyIntPointer | +| dereference.rs:60:39:72:1 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:62:9:62:10 | c1 | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:62:9:62:10 | c1 | T | {EXTERNAL LOCATION} | char | +| dereference.rs:62:14:62:42 | MySmartPointer {...} | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:62:14:62:42 | MySmartPointer {...} | T | {EXTERNAL LOCATION} | char | +| dereference.rs:62:38:62:40 | 'a' | | {EXTERNAL LOCATION} | char | +| dereference.rs:63:9:63:11 | _d1 | | {EXTERNAL LOCATION} | & | +| dereference.rs:63:9:63:11 | _d1 | TRef | {EXTERNAL LOCATION} | char | +| dereference.rs:63:15:63:16 | c1 | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:63:15:63:16 | c1 | T | {EXTERNAL LOCATION} | char | +| dereference.rs:63:15:63:24 | c1.deref() | | {EXTERNAL LOCATION} | & | +| dereference.rs:63:15:63:24 | c1.deref() | TRef | {EXTERNAL LOCATION} | char | +| dereference.rs:66:9:66:10 | c2 | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:66:9:66:10 | c2 | T | {EXTERNAL LOCATION} | char | +| dereference.rs:66:14:66:42 | MySmartPointer {...} | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:66:14:66:42 | MySmartPointer {...} | T | {EXTERNAL LOCATION} | char | +| dereference.rs:66:38:66:40 | 'a' | | {EXTERNAL LOCATION} | char | +| dereference.rs:67:9:67:11 | _d2 | | {EXTERNAL LOCATION} | char | +| dereference.rs:67:15:67:17 | * ... | | {EXTERNAL LOCATION} | char | +| dereference.rs:67:16:67:17 | c2 | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:67:16:67:17 | c2 | T | {EXTERNAL LOCATION} | char | +| dereference.rs:70:9:70:10 | c3 | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:70:9:70:10 | c3 | T | {EXTERNAL LOCATION} | i64 | +| dereference.rs:70:14:70:44 | MySmartPointer {...} | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:70:14:70:44 | MySmartPointer {...} | T | {EXTERNAL LOCATION} | i64 | +| dereference.rs:70:38:70:42 | 34i64 | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:71:9:71:11 | _d3 | | {EXTERNAL LOCATION} | bool | +| dereference.rs:71:15:71:19 | (...) | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:71:15:71:33 | ... .is_positive() | | {EXTERNAL LOCATION} | bool | +| dereference.rs:71:16:71:18 | * ... | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:71:17:71:18 | c3 | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:71:17:71:18 | c3 | T | {EXTERNAL LOCATION} | i64 | +| dereference.rs:74:31:86:1 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:76:9:76:10 | e1 | | {EXTERNAL LOCATION} | & | +| dereference.rs:76:9:76:10 | e1 | TRef | {EXTERNAL LOCATION} | char | +| dereference.rs:76:14:76:17 | &'a' | | {EXTERNAL LOCATION} | & | +| dereference.rs:76:14:76:17 | &'a' | TRef | {EXTERNAL LOCATION} | char | +| dereference.rs:76:15:76:17 | 'a' | | {EXTERNAL LOCATION} | char | +| dereference.rs:77:9:77:11 | _f1 | | {EXTERNAL LOCATION} | & | +| dereference.rs:77:9:77:11 | _f1 | TRef | {EXTERNAL LOCATION} | char | +| dereference.rs:77:15:77:16 | e1 | | {EXTERNAL LOCATION} | & | +| dereference.rs:77:15:77:16 | e1 | TRef | {EXTERNAL LOCATION} | char | +| dereference.rs:77:15:77:24 | e1.deref() | | {EXTERNAL LOCATION} | & | +| dereference.rs:77:15:77:24 | e1.deref() | TRef | {EXTERNAL LOCATION} | char | +| dereference.rs:80:9:80:10 | e2 | | {EXTERNAL LOCATION} | & | +| dereference.rs:80:9:80:10 | e2 | TRef | {EXTERNAL LOCATION} | char | +| dereference.rs:80:14:80:17 | &'a' | | {EXTERNAL LOCATION} | & | +| dereference.rs:80:14:80:17 | &'a' | TRef | {EXTERNAL LOCATION} | char | +| dereference.rs:80:15:80:17 | 'a' | | {EXTERNAL LOCATION} | char | +| dereference.rs:81:9:81:11 | _f2 | | {EXTERNAL LOCATION} | char | +| dereference.rs:81:15:81:17 | * ... | | {EXTERNAL LOCATION} | char | +| dereference.rs:81:16:81:17 | e2 | | {EXTERNAL LOCATION} | & | +| dereference.rs:81:16:81:17 | e2 | TRef | {EXTERNAL LOCATION} | char | +| dereference.rs:84:9:84:10 | e3 | | {EXTERNAL LOCATION} | & | +| dereference.rs:84:9:84:10 | e3 | TRef | {EXTERNAL LOCATION} | i64 | +| dereference.rs:84:14:84:19 | &34i64 | | {EXTERNAL LOCATION} | & | +| dereference.rs:84:14:84:19 | &34i64 | TRef | {EXTERNAL LOCATION} | i64 | +| dereference.rs:84:15:84:19 | 34i64 | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:85:9:85:11 | _f3 | | {EXTERNAL LOCATION} | bool | +| dereference.rs:85:15:85:19 | (...) | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:85:15:85:33 | ... .is_positive() | | {EXTERNAL LOCATION} | bool | +| dereference.rs:85:16:85:18 | * ... | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:85:17:85:18 | e3 | | {EXTERNAL LOCATION} | & | +| dereference.rs:85:17:85:18 | e3 | TRef | {EXTERNAL LOCATION} | i64 | +| dereference.rs:88:31:100:1 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:90:9:90:10 | g1 | | {EXTERNAL LOCATION} | Box | +| dereference.rs:90:9:90:10 | g1 | A | {EXTERNAL LOCATION} | Global | +| dereference.rs:90:9:90:10 | g1 | T | {EXTERNAL LOCATION} | char | +| dereference.rs:90:25:90:37 | ...::new(...) | | {EXTERNAL LOCATION} | Box | +| dereference.rs:90:25:90:37 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | +| dereference.rs:90:25:90:37 | ...::new(...) | T | {EXTERNAL LOCATION} | char | +| dereference.rs:90:34:90:36 | 'a' | | {EXTERNAL LOCATION} | char | +| dereference.rs:91:9:91:11 | _h1 | | {EXTERNAL LOCATION} | & | +| dereference.rs:91:9:91:11 | _h1 | TRef | {EXTERNAL LOCATION} | char | +| dereference.rs:91:15:91:16 | g1 | | {EXTERNAL LOCATION} | Box | +| dereference.rs:91:15:91:16 | g1 | A | {EXTERNAL LOCATION} | Global | +| dereference.rs:91:15:91:16 | g1 | T | {EXTERNAL LOCATION} | char | +| dereference.rs:91:15:91:24 | g1.deref() | | {EXTERNAL LOCATION} | & | +| dereference.rs:91:15:91:24 | g1.deref() | TRef | {EXTERNAL LOCATION} | char | +| dereference.rs:94:9:94:10 | g2 | | {EXTERNAL LOCATION} | Box | +| dereference.rs:94:9:94:10 | g2 | A | {EXTERNAL LOCATION} | Global | +| dereference.rs:94:9:94:10 | g2 | T | {EXTERNAL LOCATION} | char | +| dereference.rs:94:25:94:37 | ...::new(...) | | {EXTERNAL LOCATION} | Box | +| dereference.rs:94:25:94:37 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | +| dereference.rs:94:25:94:37 | ...::new(...) | T | {EXTERNAL LOCATION} | char | +| dereference.rs:94:34:94:36 | 'a' | | {EXTERNAL LOCATION} | char | +| dereference.rs:95:9:95:11 | _h2 | | {EXTERNAL LOCATION} | char | +| dereference.rs:95:15:95:17 | * ... | | {EXTERNAL LOCATION} | char | +| dereference.rs:95:16:95:17 | g2 | | {EXTERNAL LOCATION} | Box | +| dereference.rs:95:16:95:17 | g2 | A | {EXTERNAL LOCATION} | Global | +| dereference.rs:95:16:95:17 | g2 | T | {EXTERNAL LOCATION} | char | +| dereference.rs:98:9:98:10 | g3 | | {EXTERNAL LOCATION} | Box | +| dereference.rs:98:9:98:10 | g3 | A | {EXTERNAL LOCATION} | Global | +| dereference.rs:98:9:98:10 | g3 | T | {EXTERNAL LOCATION} | i64 | +| dereference.rs:98:24:98:38 | ...::new(...) | | {EXTERNAL LOCATION} | Box | +| dereference.rs:98:24:98:38 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | +| dereference.rs:98:24:98:38 | ...::new(...) | T | {EXTERNAL LOCATION} | i64 | +| dereference.rs:98:33:98:37 | 34i64 | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:99:9:99:11 | _h3 | | {EXTERNAL LOCATION} | bool | +| dereference.rs:99:15:99:19 | (...) | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:99:15:99:33 | ... .is_positive() | | {EXTERNAL LOCATION} | bool | +| dereference.rs:99:16:99:18 | * ... | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:99:17:99:18 | g3 | | {EXTERNAL LOCATION} | Box | +| dereference.rs:99:17:99:18 | g3 | A | {EXTERNAL LOCATION} | Global | +| dereference.rs:99:17:99:18 | g3 | T | {EXTERNAL LOCATION} | i64 | +| dereference.rs:102:27:117:1 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:104:9:104:9 | x | | dereference.rs:5:1:7:1 | MyIntPointer | +| dereference.rs:104:13:104:41 | MyIntPointer {...} | | dereference.rs:5:1:7:1 | MyIntPointer | +| dereference.rs:104:35:104:39 | 34i64 | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:105:9:105:10 | _y | | {EXTERNAL LOCATION} | bool | +| dereference.rs:105:14:105:14 | x | | dereference.rs:5:1:7:1 | MyIntPointer | +| dereference.rs:105:14:105:28 | x.is_positive() | | {EXTERNAL LOCATION} | bool | +| dereference.rs:108:9:108:9 | x | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:108:9:108:9 | x | T | {EXTERNAL LOCATION} | i64 | +| dereference.rs:108:13:108:43 | MySmartPointer {...} | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:108:13:108:43 | MySmartPointer {...} | T | {EXTERNAL LOCATION} | i64 | +| dereference.rs:108:37:108:41 | 34i64 | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:109:9:109:10 | _y | | {EXTERNAL LOCATION} | bool | +| dereference.rs:109:14:109:14 | x | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:109:14:109:14 | x | T | {EXTERNAL LOCATION} | i64 | +| dereference.rs:109:14:109:28 | x.is_positive() | | {EXTERNAL LOCATION} | bool | +| dereference.rs:111:9:111:9 | z | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:111:9:111:9 | z | T | dereference.rs:38:1:38:15 | S | +| dereference.rs:111:9:111:9 | z | T.T | {EXTERNAL LOCATION} | i64 | +| dereference.rs:111:13:111:45 | MySmartPointer {...} | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:111:13:111:45 | MySmartPointer {...} | T | dereference.rs:38:1:38:15 | S | +| dereference.rs:111:13:111:45 | MySmartPointer {...} | T.T | {EXTERNAL LOCATION} | i64 | +| dereference.rs:111:37:111:43 | S(...) | | dereference.rs:38:1:38:15 | S | +| dereference.rs:111:37:111:43 | S(...) | T | {EXTERNAL LOCATION} | i64 | +| dereference.rs:111:39:111:42 | 0i64 | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:112:9:112:10 | z_ | | {EXTERNAL LOCATION} | & | +| dereference.rs:112:9:112:10 | z_ | TRef | {EXTERNAL LOCATION} | i64 | +| dereference.rs:112:14:112:14 | z | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:112:14:112:14 | z | T | dereference.rs:38:1:38:15 | S | +| dereference.rs:112:14:112:14 | z | T.T | {EXTERNAL LOCATION} | i64 | +| dereference.rs:112:14:112:20 | z.foo() | | {EXTERNAL LOCATION} | & | +| dereference.rs:112:14:112:20 | z.foo() | TRef | {EXTERNAL LOCATION} | i64 | +| dereference.rs:114:9:114:9 | v | | {EXTERNAL LOCATION} | Vec | +| dereference.rs:114:9:114:9 | v | A | {EXTERNAL LOCATION} | Global | +| dereference.rs:114:9:114:9 | v | T | {EXTERNAL LOCATION} | i32 | +| dereference.rs:114:13:114:22 | ...::new(...) | | {EXTERNAL LOCATION} | Vec | +| dereference.rs:114:13:114:22 | ...::new(...) | A | {EXTERNAL LOCATION} | Global | +| dereference.rs:114:13:114:22 | ...::new(...) | T | {EXTERNAL LOCATION} | i32 | +| dereference.rs:115:13:115:13 | x | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:115:13:115:13 | x | T | {EXTERNAL LOCATION} | Vec | +| dereference.rs:115:13:115:13 | x | T.A | {EXTERNAL LOCATION} | Global | +| dereference.rs:115:13:115:13 | x | T.T | {EXTERNAL LOCATION} | i32 | +| dereference.rs:115:17:115:43 | MySmartPointer {...} | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:115:17:115:43 | MySmartPointer {...} | T | {EXTERNAL LOCATION} | Vec | +| dereference.rs:115:17:115:43 | MySmartPointer {...} | T.A | {EXTERNAL LOCATION} | Global | +| dereference.rs:115:17:115:43 | MySmartPointer {...} | T.T | {EXTERNAL LOCATION} | i32 | +| dereference.rs:115:41:115:41 | v | | {EXTERNAL LOCATION} | Vec | +| dereference.rs:115:41:115:41 | v | A | {EXTERNAL LOCATION} | Global | +| dereference.rs:115:41:115:41 | v | T | {EXTERNAL LOCATION} | i32 | +| dereference.rs:116:5:116:5 | x | | dereference.rs:18:1:20:1 | MySmartPointer | +| dereference.rs:116:5:116:5 | x | T | {EXTERNAL LOCATION} | Vec | +| dereference.rs:116:5:116:5 | x | T.A | {EXTERNAL LOCATION} | Global | +| dereference.rs:116:5:116:5 | x | T.T | {EXTERNAL LOCATION} | i32 | +| dereference.rs:116:5:116:13 | x.push(...) | | {EXTERNAL LOCATION} | () | +| dereference.rs:116:12:116:12 | 0 | | {EXTERNAL LOCATION} | i32 | +| dereference.rs:143:19:151:5 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:144:17:144:26 | key_to_key | | {EXTERNAL LOCATION} | HashMap | +| dereference.rs:144:17:144:26 | key_to_key | K | {EXTERNAL LOCATION} | & | +| dereference.rs:144:17:144:26 | key_to_key | K.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:144:17:144:26 | key_to_key | S | {EXTERNAL LOCATION} | RandomState | +| dereference.rs:144:17:144:26 | key_to_key | V | {EXTERNAL LOCATION} | & | +| dereference.rs:144:17:144:26 | key_to_key | V.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:144:30:144:57 | ...::new(...) | | {EXTERNAL LOCATION} | HashMap | +| dereference.rs:144:30:144:57 | ...::new(...) | K | {EXTERNAL LOCATION} | & | +| dereference.rs:144:30:144:57 | ...::new(...) | K.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:144:30:144:57 | ...::new(...) | S | {EXTERNAL LOCATION} | RandomState | +| dereference.rs:144:30:144:57 | ...::new(...) | V | {EXTERNAL LOCATION} | & | +| dereference.rs:144:30:144:57 | ...::new(...) | V.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:145:17:145:19 | key | | {EXTERNAL LOCATION} | & | +| dereference.rs:145:17:145:19 | key | TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:145:17:145:19 | key | TRef | {EXTERNAL LOCATION} | & | +| dereference.rs:145:17:145:19 | key | TRef.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:145:23:145:29 | &... | | {EXTERNAL LOCATION} | & | +| dereference.rs:145:23:145:29 | &... | TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:145:23:145:29 | &... | TRef | {EXTERNAL LOCATION} | & | +| dereference.rs:145:23:145:29 | &... | TRef.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:145:24:145:29 | Key {...} | | dereference.rs:122:5:123:21 | Key | +| dereference.rs:146:9:149:9 | if ... {...} | | {EXTERNAL LOCATION} | () | +| dereference.rs:146:16:146:28 | Some(...) | | {EXTERNAL LOCATION} | Option | +| dereference.rs:146:16:146:28 | Some(...) | T | {EXTERNAL LOCATION} | & | +| dereference.rs:146:16:146:28 | Some(...) | T.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:146:16:146:28 | Some(...) | T.TRef | {EXTERNAL LOCATION} | & | +| dereference.rs:146:16:146:28 | Some(...) | T.TRef.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:146:21:146:27 | ref_key | | {EXTERNAL LOCATION} | & | +| dereference.rs:146:21:146:27 | ref_key | TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:146:21:146:27 | ref_key | TRef | {EXTERNAL LOCATION} | & | +| dereference.rs:146:21:146:27 | ref_key | TRef.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:146:32:146:41 | key_to_key | | {EXTERNAL LOCATION} | HashMap | +| dereference.rs:146:32:146:41 | key_to_key | K | {EXTERNAL LOCATION} | & | +| dereference.rs:146:32:146:41 | key_to_key | K.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:146:32:146:41 | key_to_key | S | {EXTERNAL LOCATION} | RandomState | +| dereference.rs:146:32:146:41 | key_to_key | V | {EXTERNAL LOCATION} | & | +| dereference.rs:146:32:146:41 | key_to_key | V.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:146:32:146:50 | key_to_key.get(...) | | {EXTERNAL LOCATION} | Option | +| dereference.rs:146:32:146:50 | key_to_key.get(...) | T | {EXTERNAL LOCATION} | & | +| dereference.rs:146:32:146:50 | key_to_key.get(...) | T.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:146:32:146:50 | key_to_key.get(...) | T.TRef | {EXTERNAL LOCATION} | & | +| dereference.rs:146:32:146:50 | key_to_key.get(...) | T.TRef.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:146:47:146:49 | key | | {EXTERNAL LOCATION} | & | +| dereference.rs:146:47:146:49 | key | TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:146:47:146:49 | key | TRef | {EXTERNAL LOCATION} | & | +| dereference.rs:146:47:146:49 | key | TRef.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:146:52:149:9 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:148:13:148:15 | key | | {EXTERNAL LOCATION} | & | +| dereference.rs:148:13:148:15 | key | TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:148:13:148:15 | key | TRef | {EXTERNAL LOCATION} | & | +| dereference.rs:148:13:148:15 | key | TRef.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:148:13:148:25 | ... = ... | | {EXTERNAL LOCATION} | () | +| dereference.rs:148:19:148:25 | ref_key | | {EXTERNAL LOCATION} | & | +| dereference.rs:148:19:148:25 | ref_key | TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:148:19:148:25 | ref_key | TRef | {EXTERNAL LOCATION} | & | +| dereference.rs:148:19:148:25 | ref_key | TRef.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:150:9:150:18 | key_to_key | | {EXTERNAL LOCATION} | HashMap | +| dereference.rs:150:9:150:18 | key_to_key | K | {EXTERNAL LOCATION} | & | +| dereference.rs:150:9:150:18 | key_to_key | K.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:150:9:150:18 | key_to_key | S | {EXTERNAL LOCATION} | RandomState | +| dereference.rs:150:9:150:18 | key_to_key | V | {EXTERNAL LOCATION} | & | +| dereference.rs:150:9:150:18 | key_to_key | V.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:150:9:150:35 | key_to_key.insert(...) | | {EXTERNAL LOCATION} | Option | +| dereference.rs:150:9:150:35 | key_to_key.insert(...) | T | {EXTERNAL LOCATION} | & | +| dereference.rs:150:9:150:35 | key_to_key.insert(...) | T.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:150:9:150:35 | key_to_key.insert(...) | T.TRef | {EXTERNAL LOCATION} | & | +| dereference.rs:150:9:150:35 | key_to_key.insert(...) | T.TRef.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:150:27:150:29 | key | | {EXTERNAL LOCATION} | & | +| dereference.rs:150:27:150:29 | key | TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:150:27:150:29 | key | TRef | {EXTERNAL LOCATION} | & | +| dereference.rs:150:27:150:29 | key | TRef.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:150:32:150:34 | key | | {EXTERNAL LOCATION} | & | +| dereference.rs:150:32:150:34 | key | TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:150:32:150:34 | key | TRef | {EXTERNAL LOCATION} | & | +| dereference.rs:150:32:150:34 | key | TRef.TRef | dereference.rs:122:5:123:21 | Key | +| dereference.rs:156:16:156:19 | SelfParam | | dereference.rs:155:5:157:5 | Self [trait MyTrait1] | +| dereference.rs:163:16:163:19 | SelfParam | | {EXTERNAL LOCATION} | & | +| dereference.rs:163:16:163:19 | SelfParam | TRef | dereference.rs:159:5:159:13 | S | +| dereference.rs:163:27:165:9 | { ... } | | dereference.rs:159:5:159:13 | S | +| dereference.rs:164:13:164:13 | S | | dereference.rs:159:5:159:13 | S | +| dereference.rs:170:16:170:19 | SelfParam | | {EXTERNAL LOCATION} | &mut | +| dereference.rs:170:16:170:19 | SelfParam | TRefMut | dereference.rs:159:5:159:13 | S | +| dereference.rs:170:29:172:9 | { ... } | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:171:13:171:14 | 42 | | {EXTERNAL LOCATION} | i32 | +| dereference.rs:171:13:171:14 | 42 | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:176:16:176:19 | SelfParam | | dereference.rs:175:5:177:5 | Self [trait MyTrait2] | +| dereference.rs:176:22:176:24 | arg | | dereference.rs:175:20:175:21 | T1 | +| dereference.rs:181:16:181:19 | SelfParam | | dereference.rs:159:5:159:13 | S | +| dereference.rs:181:22:181:24 | arg | | {EXTERNAL LOCATION} | & | +| dereference.rs:181:22:181:24 | arg | TRef | dereference.rs:159:5:159:13 | S | +| dereference.rs:181:36:183:9 | { ... } | | dereference.rs:159:5:159:13 | S | +| dereference.rs:182:13:182:13 | S | | dereference.rs:159:5:159:13 | S | +| dereference.rs:188:16:188:19 | SelfParam | | dereference.rs:159:5:159:13 | S | +| dereference.rs:188:22:188:24 | arg | | {EXTERNAL LOCATION} | &mut | +| dereference.rs:188:22:188:24 | arg | TRefMut | dereference.rs:159:5:159:13 | S | +| dereference.rs:188:42:190:9 | { ... } | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:189:13:189:14 | 42 | | {EXTERNAL LOCATION} | i32 | +| dereference.rs:189:13:189:14 | 42 | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:193:19:200:5 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:194:13:194:13 | x | | dereference.rs:159:5:159:13 | S | +| dereference.rs:194:17:194:20 | (...) | | {EXTERNAL LOCATION} | & | +| dereference.rs:194:17:194:20 | (...) | TRef | dereference.rs:159:5:159:13 | S | +| dereference.rs:194:17:194:26 | ... .foo() | | dereference.rs:159:5:159:13 | S | +| dereference.rs:194:18:194:19 | &S | | {EXTERNAL LOCATION} | & | +| dereference.rs:194:18:194:19 | &S | TRef | dereference.rs:159:5:159:13 | S | +| dereference.rs:194:19:194:19 | S | | dereference.rs:159:5:159:13 | S | +| dereference.rs:195:13:195:13 | y | | dereference.rs:159:5:159:13 | S | +| dereference.rs:195:17:195:17 | S | | dereference.rs:159:5:159:13 | S | +| dereference.rs:195:17:195:23 | S.foo() | | dereference.rs:159:5:159:13 | S | +| dereference.rs:196:13:196:13 | z | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:196:17:196:24 | (...) | | {EXTERNAL LOCATION} | &mut | +| dereference.rs:196:17:196:24 | (...) | TRefMut | dereference.rs:159:5:159:13 | S | +| dereference.rs:196:17:196:30 | ... .foo() | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:196:18:196:23 | &mut S | | {EXTERNAL LOCATION} | &mut | +| dereference.rs:196:18:196:23 | &mut S | TRefMut | dereference.rs:159:5:159:13 | S | +| dereference.rs:196:23:196:23 | S | | dereference.rs:159:5:159:13 | S | +| dereference.rs:198:13:198:13 | x | | dereference.rs:159:5:159:13 | S | +| dereference.rs:198:17:198:17 | S | | dereference.rs:159:5:159:13 | S | +| dereference.rs:198:17:198:25 | S.bar(...) | | dereference.rs:159:5:159:13 | S | +| dereference.rs:198:23:198:24 | &S | | {EXTERNAL LOCATION} | & | +| dereference.rs:198:23:198:24 | &S | TRef | dereference.rs:159:5:159:13 | S | +| dereference.rs:198:24:198:24 | S | | dereference.rs:159:5:159:13 | S | +| dereference.rs:199:13:199:13 | y | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:199:17:199:17 | S | | dereference.rs:159:5:159:13 | S | +| dereference.rs:199:17:199:29 | S.bar(...) | | {EXTERNAL LOCATION} | i64 | +| dereference.rs:199:23:199:28 | &mut S | | {EXTERNAL LOCATION} | &mut | +| dereference.rs:199:23:199:28 | &mut S | TRefMut | dereference.rs:159:5:159:13 | S | +| dereference.rs:199:28:199:28 | S | | dereference.rs:159:5:159:13 | S | | dereference.rs:208:16:208:20 | SelfParam | | {EXTERNAL LOCATION} | & | -| dereference.rs:208:16:208:20 | SelfParam | TRef | dereference.rs:193:5:193:17 | Foo | -| dereference.rs:208:23:210:9 | { ... } | | {EXTERNAL LOCATION} | () | -| dereference.rs:209:13:209:38 | MacroExpr | | {EXTERNAL LOCATION} | () | -| dereference.rs:209:22:209:37 | "In trait impl!\\n" | | {EXTERNAL LOCATION} | & | -| dereference.rs:209:22:209:37 | "In trait impl!\\n" | TRef | {EXTERNAL LOCATION} | str | -| dereference.rs:209:22:209:37 | ...::_print(...) | | {EXTERNAL LOCATION} | () | -| dereference.rs:209:22:209:37 | MacroBlockExpr | | {EXTERNAL LOCATION} | () | -| dereference.rs:209:22:209:37 | { ... } | | {EXTERNAL LOCATION} | () | -| dereference.rs:213:19:216:5 | { ... } | | {EXTERNAL LOCATION} | () | -| dereference.rs:214:17:214:17 | f | | dereference.rs:193:5:193:17 | Foo | -| dereference.rs:214:21:214:26 | Foo {...} | | dereference.rs:193:5:193:17 | Foo | -| dereference.rs:215:9:215:9 | f | | dereference.rs:193:5:193:17 | Foo | -| dereference.rs:215:9:215:15 | f.bar() | | {EXTERNAL LOCATION} | () | -| dereference.rs:219:15:228:1 | { ... } | | {EXTERNAL LOCATION} | () | -| dereference.rs:220:5:220:38 | explicit_monomorphic_dereference(...) | | {EXTERNAL LOCATION} | () | -| dereference.rs:221:5:221:38 | explicit_polymorphic_dereference(...) | | {EXTERNAL LOCATION} | () | -| dereference.rs:222:5:222:30 | explicit_ref_dereference(...) | | {EXTERNAL LOCATION} | () | -| dereference.rs:223:5:223:30 | explicit_box_dereference(...) | | {EXTERNAL LOCATION} | () | -| dereference.rs:224:5:224:26 | implicit_dereference(...) | | {EXTERNAL LOCATION} | () | -| dereference.rs:225:5:225:41 | ...::test(...) | | {EXTERNAL LOCATION} | () | -| dereference.rs:226:5:226:26 | ...::test(...) | | {EXTERNAL LOCATION} | () | -| dereference.rs:227:5:227:34 | ...::main(...) | | {EXTERNAL LOCATION} | () | +| dereference.rs:208:16:208:20 | SelfParam | TRef | dereference.rs:207:5:209:5 | Self [trait Bar] | +| dereference.rs:213:16:213:24 | SelfParam | | {EXTERNAL LOCATION} | &mut | +| dereference.rs:213:16:213:24 | SelfParam | TRefMut | dereference.rs:205:5:205:17 | Foo | +| dereference.rs:213:27:215:9 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:214:13:214:39 | MacroExpr | | {EXTERNAL LOCATION} | () | +| dereference.rs:214:22:214:38 | "In struct impl!\\n" | | {EXTERNAL LOCATION} | & | +| dereference.rs:214:22:214:38 | "In struct impl!\\n" | TRef | {EXTERNAL LOCATION} | str | +| dereference.rs:214:22:214:38 | ...::_print(...) | | {EXTERNAL LOCATION} | () | +| dereference.rs:214:22:214:38 | MacroBlockExpr | | {EXTERNAL LOCATION} | () | +| dereference.rs:214:22:214:38 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:220:16:220:20 | SelfParam | | {EXTERNAL LOCATION} | & | +| dereference.rs:220:16:220:20 | SelfParam | TRef | dereference.rs:205:5:205:17 | Foo | +| dereference.rs:220:23:222:9 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:221:13:221:38 | MacroExpr | | {EXTERNAL LOCATION} | () | +| dereference.rs:221:22:221:37 | "In trait impl!\\n" | | {EXTERNAL LOCATION} | & | +| dereference.rs:221:22:221:37 | "In trait impl!\\n" | TRef | {EXTERNAL LOCATION} | str | +| dereference.rs:221:22:221:37 | ...::_print(...) | | {EXTERNAL LOCATION} | () | +| dereference.rs:221:22:221:37 | MacroBlockExpr | | {EXTERNAL LOCATION} | () | +| dereference.rs:221:22:221:37 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:225:19:228:5 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:226:17:226:17 | f | | dereference.rs:205:5:205:17 | Foo | +| dereference.rs:226:21:226:26 | Foo {...} | | dereference.rs:205:5:205:17 | Foo | +| dereference.rs:227:9:227:9 | f | | dereference.rs:205:5:205:17 | Foo | +| dereference.rs:227:9:227:15 | f.bar() | | {EXTERNAL LOCATION} | () | +| dereference.rs:231:15:240:1 | { ... } | | {EXTERNAL LOCATION} | () | +| dereference.rs:232:5:232:38 | explicit_monomorphic_dereference(...) | | {EXTERNAL LOCATION} | () | +| dereference.rs:233:5:233:38 | explicit_polymorphic_dereference(...) | | {EXTERNAL LOCATION} | () | +| dereference.rs:234:5:234:30 | explicit_ref_dereference(...) | | {EXTERNAL LOCATION} | () | +| dereference.rs:235:5:235:30 | explicit_box_dereference(...) | | {EXTERNAL LOCATION} | () | +| dereference.rs:236:5:236:26 | implicit_dereference(...) | | {EXTERNAL LOCATION} | () | +| dereference.rs:237:5:237:41 | ...::test(...) | | {EXTERNAL LOCATION} | () | +| dereference.rs:238:5:238:26 | ...::test(...) | | {EXTERNAL LOCATION} | () | +| dereference.rs:239:5:239:34 | ...::main(...) | | {EXTERNAL LOCATION} | () | | dyn_type.rs:7:10:7:14 | SelfParam | | {EXTERNAL LOCATION} | & | | dyn_type.rs:7:10:7:14 | SelfParam | TRef | dyn_type.rs:5:1:8:1 | Self [trait MyTrait1] | | dyn_type.rs:12:12:12:16 | SelfParam | | {EXTERNAL LOCATION} | & | @@ -10736,7 +10802,18 @@ inferType | main.rs:2902:21:2902:34 | path2.unwrap() | | main.rs:2879:5:2879:25 | PathBuf | | main.rs:2904:13:2904:20 | pathbuf1 | | main.rs:2879:5:2879:25 | PathBuf | | main.rs:2904:24:2904:37 | ...::new(...) | | main.rs:2879:5:2879:25 | PathBuf | +| main.rs:2905:13:2905:20 | pathbuf2 | | {EXTERNAL LOCATION} | Result | +| main.rs:2905:13:2905:20 | pathbuf2 | E | {EXTERNAL LOCATION} | () | +| main.rs:2905:13:2905:20 | pathbuf2 | T | main.rs:2879:5:2879:25 | PathBuf | | main.rs:2905:24:2905:31 | pathbuf1 | | main.rs:2879:5:2879:25 | PathBuf | +| main.rs:2905:24:2905:46 | pathbuf1.canonicalize() | | {EXTERNAL LOCATION} | Result | +| main.rs:2905:24:2905:46 | pathbuf1.canonicalize() | E | {EXTERNAL LOCATION} | () | +| main.rs:2905:24:2905:46 | pathbuf1.canonicalize() | T | main.rs:2879:5:2879:25 | PathBuf | +| main.rs:2906:13:2906:20 | pathbuf3 | | main.rs:2879:5:2879:25 | PathBuf | +| main.rs:2906:24:2906:31 | pathbuf2 | | {EXTERNAL LOCATION} | Result | +| main.rs:2906:24:2906:31 | pathbuf2 | E | {EXTERNAL LOCATION} | () | +| main.rs:2906:24:2906:31 | pathbuf2 | T | main.rs:2879:5:2879:25 | PathBuf | +| main.rs:2906:24:2906:40 | pathbuf2.unwrap() | | main.rs:2879:5:2879:25 | PathBuf | | main.rs:2912:14:2912:18 | SelfParam | | {EXTERNAL LOCATION} | & | | main.rs:2912:14:2912:18 | SelfParam | TRef | main.rs:2911:5:2913:5 | Self [trait MyTrait] | | main.rs:2919:14:2919:18 | SelfParam | | {EXTERNAL LOCATION} | & | diff --git a/rust/ql/test/query-tests/security/CWE-022/TaintedPath.expected b/rust/ql/test/query-tests/security/CWE-022/TaintedPath.expected index df7070c966a7..5f0589021b5d 100644 --- a/rust/ql/test/query-tests/security/CWE-022/TaintedPath.expected +++ b/rust/ql/test/query-tests/security/CWE-022/TaintedPath.expected @@ -1,7 +1,8 @@ #select | src/main.rs:11:5:11:22 | ...::read_to_string | src/main.rs:7:11:7:19 | file_name | src/main.rs:11:5:11:22 | ...::read_to_string | This path depends on a $@. | src/main.rs:7:11:7:19 | file_name | user-provided value | -| src/main.rs:58:5:58:22 | ...::read_to_string | src/main.rs:50:51:50:59 | file_path | src/main.rs:58:5:58:22 | ...::read_to_string | This path depends on a $@. | src/main.rs:50:51:50:59 | file_path | user-provided value | +| src/main.rs:46:5:46:22 | ...::read_to_string | src/main.rs:38:11:38:19 | file_path | src/main.rs:46:5:46:22 | ...::read_to_string | This path depends on a $@. | src/main.rs:38:11:38:19 | file_path | user-provided value | | src/main.rs:71:5:71:22 | ...::read_to_string | src/main.rs:63:11:63:19 | file_path | src/main.rs:71:5:71:22 | ...::read_to_string | This path depends on a $@. | src/main.rs:63:11:63:19 | file_path | user-provided value | +| src/main.rs:85:5:85:22 | ...::read_to_string | src/main.rs:76:11:76:19 | file_path | src/main.rs:85:5:85:22 | ...::read_to_string | This path depends on a $@. | src/main.rs:76:11:76:19 | file_path | user-provided value | | src/main.rs:99:5:99:22 | ...::read_to_string | src/main.rs:90:11:90:19 | file_path | src/main.rs:99:5:99:22 | ...::read_to_string | This path depends on a $@. | src/main.rs:90:11:90:19 | file_path | user-provided value | | src/main.rs:104:13:104:31 | ...::open | src/main.rs:103:17:103:30 | ...::args | src/main.rs:104:13:104:31 | ...::open | This path depends on a $@. | src/main.rs:103:17:103:30 | ...::args | user-provided value | | src/main.rs:107:13:107:31 | ...::open | src/main.rs:103:17:103:30 | ...::args | src/main.rs:107:13:107:31 | ...::open | This path depends on a $@. | src/main.rs:103:17:103:30 | ...::args | user-provided value | @@ -19,28 +20,36 @@ edges | src/main.rs:9:9:9:17 | file_path | src/main.rs:11:24:11:32 | file_path | provenance | | | src/main.rs:9:21:9:44 | ...::from(...) | src/main.rs:9:9:9:17 | file_path | provenance | | | src/main.rs:9:35:9:43 | file_name | src/main.rs:9:21:9:44 | ...::from(...) | provenance | MaD:9 | -| src/main.rs:9:35:9:43 | file_name | src/main.rs:9:21:9:44 | ...::from(...) | provenance | MaD:14 | +| src/main.rs:9:35:9:43 | file_name | src/main.rs:9:21:9:44 | ...::from(...) | provenance | MaD:15 | | src/main.rs:11:24:11:32 | file_path | src/main.rs:11:5:11:22 | ...::read_to_string | provenance | MaD:6 Sink:MaD:6 | -| src/main.rs:50:51:50:59 | file_path | src/main.rs:52:32:52:40 | file_path | provenance | | -| src/main.rs:52:9:52:17 | file_path [&ref] | src/main.rs:53:21:53:29 | file_path [&ref] | provenance | | -| src/main.rs:52:21:52:41 | ...::new(...) [&ref] | src/main.rs:52:9:52:17 | file_path [&ref] | provenance | | -| src/main.rs:52:31:52:40 | &file_path [&ref] | src/main.rs:52:21:52:41 | ...::new(...) [&ref] | provenance | MaD:13 | -| src/main.rs:52:32:52:40 | file_path | src/main.rs:52:31:52:40 | &file_path [&ref] | provenance | | -| src/main.rs:53:9:53:17 | file_path | src/main.rs:58:24:58:32 | file_path | provenance | | -| src/main.rs:53:21:53:29 | file_path [&ref] | src/main.rs:53:21:53:44 | file_path.canonicalize() [Ok] | provenance | Config | -| src/main.rs:53:21:53:44 | file_path.canonicalize() [Ok] | src/main.rs:53:21:53:53 | ... .unwrap() | provenance | MaD:12 | -| src/main.rs:53:21:53:53 | ... .unwrap() | src/main.rs:53:9:53:17 | file_path | provenance | | -| src/main.rs:58:24:58:32 | file_path | src/main.rs:58:5:58:22 | ...::read_to_string | provenance | MaD:6 Sink:MaD:6 | +| src/main.rs:38:11:38:19 | file_path | src/main.rs:41:52:41:60 | file_path | provenance | | +| src/main.rs:41:9:41:17 | file_path | src/main.rs:46:24:46:32 | file_path | provenance | | +| src/main.rs:41:21:41:62 | public_path.join(...) | src/main.rs:41:9:41:17 | file_path | provenance | | +| src/main.rs:41:38:41:61 | ...::from(...) | src/main.rs:41:21:41:62 | public_path.join(...) | provenance | MaD:13 | +| src/main.rs:41:52:41:60 | file_path | src/main.rs:41:38:41:61 | ...::from(...) | provenance | MaD:9 | +| src/main.rs:41:52:41:60 | file_path | src/main.rs:41:38:41:61 | ...::from(...) | provenance | MaD:15 | +| src/main.rs:46:24:46:32 | file_path | src/main.rs:46:5:46:22 | ...::read_to_string | provenance | MaD:6 Sink:MaD:6 | | src/main.rs:63:11:63:19 | file_path | src/main.rs:66:32:66:40 | file_path | provenance | | | src/main.rs:66:9:66:17 | file_path [&ref] | src/main.rs:71:24:71:32 | file_path [&ref] | provenance | | | src/main.rs:66:21:66:41 | ...::new(...) [&ref] | src/main.rs:66:9:66:17 | file_path [&ref] | provenance | | -| src/main.rs:66:31:66:40 | &file_path [&ref] | src/main.rs:66:21:66:41 | ...::new(...) [&ref] | provenance | MaD:13 | +| src/main.rs:66:31:66:40 | &file_path [&ref] | src/main.rs:66:21:66:41 | ...::new(...) [&ref] | provenance | MaD:14 | | src/main.rs:66:32:66:40 | file_path | src/main.rs:66:31:66:40 | &file_path [&ref] | provenance | | | src/main.rs:71:24:71:32 | file_path [&ref] | src/main.rs:71:5:71:22 | ...::read_to_string | provenance | MaD:6 Sink:MaD:6 | +| src/main.rs:76:11:76:19 | file_path | src/main.rs:79:52:79:60 | file_path | provenance | | +| src/main.rs:79:9:79:17 | file_path | src/main.rs:80:21:80:29 | file_path | provenance | | +| src/main.rs:79:21:79:62 | public_path.join(...) | src/main.rs:79:9:79:17 | file_path | provenance | | +| src/main.rs:79:38:79:61 | ...::from(...) | src/main.rs:79:21:79:62 | public_path.join(...) | provenance | MaD:13 | +| src/main.rs:79:52:79:60 | file_path | src/main.rs:79:38:79:61 | ...::from(...) | provenance | MaD:9 | +| src/main.rs:79:52:79:60 | file_path | src/main.rs:79:38:79:61 | ...::from(...) | provenance | MaD:15 | +| src/main.rs:80:9:80:17 | file_path | src/main.rs:85:24:85:32 | file_path | provenance | | +| src/main.rs:80:21:80:29 | file_path | src/main.rs:80:21:80:44 | file_path.canonicalize() [Ok] | provenance | MaD:16 | +| src/main.rs:80:21:80:44 | file_path.canonicalize() [Ok] | src/main.rs:80:21:80:53 | ... .unwrap() | provenance | MaD:12 | +| src/main.rs:80:21:80:53 | ... .unwrap() | src/main.rs:80:9:80:17 | file_path | provenance | | +| src/main.rs:85:24:85:32 | file_path | src/main.rs:85:5:85:22 | ...::read_to_string | provenance | MaD:6 Sink:MaD:6 | | src/main.rs:90:11:90:19 | file_path | src/main.rs:93:32:93:40 | file_path | provenance | | | src/main.rs:93:9:93:17 | file_path [&ref] | src/main.rs:98:21:98:29 | file_path [&ref] | provenance | | | src/main.rs:93:21:93:41 | ...::new(...) [&ref] | src/main.rs:93:9:93:17 | file_path [&ref] | provenance | | -| src/main.rs:93:31:93:40 | &file_path [&ref] | src/main.rs:93:21:93:41 | ...::new(...) [&ref] | provenance | MaD:13 | +| src/main.rs:93:31:93:40 | &file_path [&ref] | src/main.rs:93:21:93:41 | ...::new(...) [&ref] | provenance | MaD:14 | | src/main.rs:93:32:93:40 | file_path | src/main.rs:93:31:93:40 | &file_path [&ref] | provenance | | | src/main.rs:98:9:98:17 | file_path | src/main.rs:99:24:99:32 | file_path | provenance | | | src/main.rs:98:21:98:29 | file_path [&ref] | src/main.rs:98:21:98:44 | file_path.canonicalize() [Ok] | provenance | Config | @@ -82,7 +91,7 @@ edges | src/main.rs:113:39:113:43 | path4 | src/main.rs:113:13:113:37 | ...::open | provenance | MaD:1 Sink:MaD:1 | | src/main.rs:115:9:115:13 | path5 [&ref] | src/main.rs:116:33:116:37 | path5 [&ref] | provenance | | | src/main.rs:115:17:115:44 | ...::new(...) [&ref] | src/main.rs:115:9:115:13 | path5 [&ref] | provenance | | -| src/main.rs:115:38:115:43 | &path1 [&ref] | src/main.rs:115:17:115:44 | ...::new(...) [&ref] | provenance | MaD:13 | +| src/main.rs:115:38:115:43 | &path1 [&ref] | src/main.rs:115:17:115:44 | ...::new(...) [&ref] | provenance | MaD:14 | | src/main.rs:115:39:115:43 | path1 | src/main.rs:115:38:115:43 | &path1 [&ref] | provenance | | | src/main.rs:116:33:116:37 | path5 [&ref] | src/main.rs:116:13:116:31 | ...::open | provenance | MaD:2 Sink:MaD:2 | | src/main.rs:116:33:116:37 | path5 [&ref] | src/main.rs:118:17:118:21 | path5 [&ref] | provenance | | @@ -99,7 +108,7 @@ edges | src/main.rs:170:16:170:29 | ...: ... [&ref] | src/main.rs:174:36:174:43 | path_str [&ref] | provenance | | | src/main.rs:172:9:172:12 | path [&ref] | src/main.rs:173:8:173:11 | path [&ref] | provenance | | | src/main.rs:172:16:172:34 | ...::new(...) [&ref] | src/main.rs:172:9:172:12 | path [&ref] | provenance | | -| src/main.rs:172:26:172:33 | path_str [&ref] | src/main.rs:172:16:172:34 | ...::new(...) [&ref] | provenance | MaD:13 | +| src/main.rs:172:26:172:33 | path_str [&ref] | src/main.rs:172:16:172:34 | ...::new(...) [&ref] | provenance | MaD:14 | | src/main.rs:173:8:173:11 | path [&ref] | src/main.rs:173:13:173:18 | exists | provenance | MaD:3 Sink:MaD:3 | | src/main.rs:173:8:173:11 | path [&ref] | src/main.rs:177:36:177:39 | path [&ref] | provenance | | | src/main.rs:174:36:174:43 | path_str [&ref] | src/main.rs:174:25:174:34 | ...::open | provenance | MaD:2 Sink:MaD:2 | @@ -124,8 +133,10 @@ models | 10 | Summary: <_ as core::iter::traits::iterator::Iterator>::nth; Argument[self].Reference.Element; ReturnValue.Field[core::option::Option::Some(0)]; value | | 11 | Summary: ::unwrap; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | | 12 | Summary: ::unwrap; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | -| 13 | Summary: ::new; Argument[0].Reference; ReturnValue.Reference; value | -| 14 | Summary: ::from; Argument[0]; ReturnValue; taint | +| 13 | Summary: ::join; Argument[0]; ReturnValue; taint | +| 14 | Summary: ::new; Argument[0].Reference; ReturnValue.Reference; value | +| 15 | Summary: ::from; Argument[0]; ReturnValue; taint | +| 16 | Summary: ::deref; Argument[self].Reference; ReturnValue.Reference; taint | nodes | src/main.rs:7:11:7:19 | file_name | semmle.label | file_name | | src/main.rs:9:9:9:17 | file_path | semmle.label | file_path | @@ -133,17 +144,13 @@ nodes | src/main.rs:9:35:9:43 | file_name | semmle.label | file_name | | src/main.rs:11:5:11:22 | ...::read_to_string | semmle.label | ...::read_to_string | | src/main.rs:11:24:11:32 | file_path | semmle.label | file_path | -| src/main.rs:50:51:50:59 | file_path | semmle.label | file_path | -| src/main.rs:52:9:52:17 | file_path [&ref] | semmle.label | file_path [&ref] | -| src/main.rs:52:21:52:41 | ...::new(...) [&ref] | semmle.label | ...::new(...) [&ref] | -| src/main.rs:52:31:52:40 | &file_path [&ref] | semmle.label | &file_path [&ref] | -| src/main.rs:52:32:52:40 | file_path | semmle.label | file_path | -| src/main.rs:53:9:53:17 | file_path | semmle.label | file_path | -| src/main.rs:53:21:53:29 | file_path [&ref] | semmle.label | file_path [&ref] | -| src/main.rs:53:21:53:44 | file_path.canonicalize() [Ok] | semmle.label | file_path.canonicalize() [Ok] | -| src/main.rs:53:21:53:53 | ... .unwrap() | semmle.label | ... .unwrap() | -| src/main.rs:58:5:58:22 | ...::read_to_string | semmle.label | ...::read_to_string | -| src/main.rs:58:24:58:32 | file_path | semmle.label | file_path | +| src/main.rs:38:11:38:19 | file_path | semmle.label | file_path | +| src/main.rs:41:9:41:17 | file_path | semmle.label | file_path | +| src/main.rs:41:21:41:62 | public_path.join(...) | semmle.label | public_path.join(...) | +| src/main.rs:41:38:41:61 | ...::from(...) | semmle.label | ...::from(...) | +| src/main.rs:41:52:41:60 | file_path | semmle.label | file_path | +| src/main.rs:46:5:46:22 | ...::read_to_string | semmle.label | ...::read_to_string | +| src/main.rs:46:24:46:32 | file_path | semmle.label | file_path | | src/main.rs:63:11:63:19 | file_path | semmle.label | file_path | | src/main.rs:66:9:66:17 | file_path [&ref] | semmle.label | file_path [&ref] | | src/main.rs:66:21:66:41 | ...::new(...) [&ref] | semmle.label | ...::new(...) [&ref] | @@ -151,6 +158,17 @@ nodes | src/main.rs:66:32:66:40 | file_path | semmle.label | file_path | | src/main.rs:71:5:71:22 | ...::read_to_string | semmle.label | ...::read_to_string | | src/main.rs:71:24:71:32 | file_path [&ref] | semmle.label | file_path [&ref] | +| src/main.rs:76:11:76:19 | file_path | semmle.label | file_path | +| src/main.rs:79:9:79:17 | file_path | semmle.label | file_path | +| src/main.rs:79:21:79:62 | public_path.join(...) | semmle.label | public_path.join(...) | +| src/main.rs:79:38:79:61 | ...::from(...) | semmle.label | ...::from(...) | +| src/main.rs:79:52:79:60 | file_path | semmle.label | file_path | +| src/main.rs:80:9:80:17 | file_path | semmle.label | file_path | +| src/main.rs:80:21:80:29 | file_path | semmle.label | file_path | +| src/main.rs:80:21:80:44 | file_path.canonicalize() [Ok] | semmle.label | file_path.canonicalize() [Ok] | +| src/main.rs:80:21:80:53 | ... .unwrap() | semmle.label | ... .unwrap() | +| src/main.rs:85:5:85:22 | ...::read_to_string | semmle.label | ...::read_to_string | +| src/main.rs:85:24:85:32 | file_path | semmle.label | file_path | | src/main.rs:90:11:90:19 | file_path | semmle.label | file_path | | src/main.rs:93:9:93:17 | file_path [&ref] | semmle.label | file_path [&ref] | | src/main.rs:93:21:93:41 | ...::new(...) [&ref] | semmle.label | ...::new(...) [&ref] | diff --git a/rust/ql/test/query-tests/security/CWE-022/src/main.rs b/rust/ql/test/query-tests/security/CWE-022/src/main.rs index 7acf036bb6bf..f686fdf1d95b 100644 --- a/rust/ql/test/query-tests/security/CWE-022/src/main.rs +++ b/rust/ql/test/query-tests/security/CWE-022/src/main.rs @@ -30,12 +30,12 @@ fn tainted_path_handler_folder_good(Query(file_path): Query) -> Result, // $ MISSING: Source=remote2 + Query(file_path): Query, // $ Source=remote2 ) -> Result { let public_path = PathBuf::from("/var/www/public_html"); let file_path = public_path.join(PathBuf::from(file_path)); @@ -43,11 +43,11 @@ fn tainted_path_handler_folder_almost_good1( if !file_path.starts_with(public_path) { return Err(Error::from_status(StatusCode::BAD_REQUEST)); } - fs::read_to_string(file_path).map_err(InternalServerError) // $ path-injection-sink MISSING: path-injection-checked Alert[rust/path-injection]=remote2 -- we cannot resolve the `join` call above, because it needs a `PathBuf -> Path` `Deref` + fs::read_to_string(file_path).map_err(InternalServerError) // $ path-injection-sink path-injection-checked Alert[rust/path-injection]=remote2 } //#[handler] -fn tainted_path_handler_folder_good_simpler(Query(file_path): Query) -> Result { // $ Source=remote6 +fn tainted_path_handler_folder_good_simpler(Query(file_path): Query) -> Result { let public_path = "/var/www/public_html"; let file_path = Path::new(&file_path); let file_path = file_path.canonicalize().unwrap(); @@ -55,7 +55,7 @@ fn tainted_path_handler_folder_good_simpler(Query(file_path): Query) -> if !file_path.starts_with(public_path) { return Err(Error::from_status(StatusCode::BAD_REQUEST)); } - fs::read_to_string(file_path).map_err(InternalServerError) // $ path-injection-sink MISSING: path-injection-checked SPURIOUS: Alert[rust/path-injection]=remote6 + fs::read_to_string(file_path).map_err(InternalServerError) // $ path-injection-sink path-injection-checked } //#[handler] @@ -73,7 +73,7 @@ fn tainted_path_handler_folder_almost_good1_simpler( //#[handler] fn tainted_path_handler_folder_almost_good2( - Query(file_path): Query, // $ MISSING: Source=remote4 + Query(file_path): Query, // $ Source=remote4 ) -> Result { let public_path = PathBuf::from("/var/www/public_html"); let file_path = public_path.join(PathBuf::from(file_path)); @@ -82,7 +82,7 @@ fn tainted_path_handler_folder_almost_good2( if file_path.starts_with(public_path) { return Err(Error::from_status(StatusCode::BAD_REQUEST)); } - fs::read_to_string(file_path).map_err(InternalServerError) // $ path-injection-sink MISSING: path-injection-checked Alert[rust/path-injection]=remote4 -- we cannot resolve the `join` call above, because it needs a `PathBuf -> Path` `Deref` + fs::read_to_string(file_path).map_err(InternalServerError) // $ path-injection-sink Alert[rust/path-injection]=remote4 $ MISSING: path-injection-checked } //#[handler] diff --git a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected index 24edd2ff7f50..27edaf8dde2d 100644 --- a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected +++ b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected @@ -59,30 +59,30 @@ edges | main.rs:18:41:18:41 | v | main.rs:32:60:32:60 | v | provenance | | | main.rs:18:41:18:41 | v | main.rs:35:49:35:49 | v | provenance | | | main.rs:20:9:20:10 | l2 | main.rs:21:31:21:32 | l2 | provenance | | -| main.rs:20:14:20:54 | ...::from_size_align(...) [Ok] | main.rs:20:14:20:63 | ... .unwrap() | provenance | MaD:42 | +| main.rs:20:14:20:54 | ...::from_size_align(...) [Ok] | main.rs:20:14:20:63 | ... .unwrap() | provenance | MaD:43 | | main.rs:20:14:20:63 | ... .unwrap() | main.rs:20:9:20:10 | l2 | provenance | | -| main.rs:20:50:20:50 | v | main.rs:20:14:20:54 | ...::from_size_align(...) [Ok] | provenance | MaD:34 | +| main.rs:20:50:20:50 | v | main.rs:20:14:20:54 | ...::from_size_align(...) [Ok] | provenance | MaD:35 | | main.rs:21:31:21:32 | l2 | main.rs:21:13:21:29 | ...::alloc | provenance | MaD:15 Sink:MaD:15 | | main.rs:21:31:21:32 | l2 | main.rs:22:31:22:32 | l2 | provenance | | | main.rs:21:31:21:32 | l2 | main.rs:23:31:23:32 | l2 | provenance | | | main.rs:21:31:21:32 | l2 | main.rs:24:38:24:39 | l2 | provenance | | -| main.rs:22:31:22:32 | l2 | main.rs:22:31:22:44 | l2.align_to(...) [Ok] | provenance | MaD:28 | -| main.rs:22:31:22:44 | l2.align_to(...) [Ok] | main.rs:22:31:22:53 | ... .unwrap() | provenance | MaD:42 | +| main.rs:22:31:22:32 | l2 | main.rs:22:31:22:44 | l2.align_to(...) [Ok] | provenance | MaD:29 | +| main.rs:22:31:22:44 | l2.align_to(...) [Ok] | main.rs:22:31:22:53 | ... .unwrap() | provenance | MaD:43 | | main.rs:22:31:22:53 | ... .unwrap() | main.rs:22:13:22:29 | ...::alloc | provenance | MaD:15 Sink:MaD:15 | -| main.rs:23:31:23:32 | l2 | main.rs:23:31:23:44 | l2.align_to(...) [Ok] | provenance | MaD:28 | -| main.rs:23:31:23:44 | l2.align_to(...) [Ok] | main.rs:23:31:23:53 | ... .unwrap() | provenance | MaD:42 | -| main.rs:23:31:23:53 | ... .unwrap() | main.rs:23:31:23:68 | ... .pad_to_align() | provenance | MaD:36 | +| main.rs:23:31:23:32 | l2 | main.rs:23:31:23:44 | l2.align_to(...) [Ok] | provenance | MaD:29 | +| main.rs:23:31:23:44 | l2.align_to(...) [Ok] | main.rs:23:31:23:53 | ... .unwrap() | provenance | MaD:43 | +| main.rs:23:31:23:53 | ... .unwrap() | main.rs:23:31:23:68 | ... .pad_to_align() | provenance | MaD:37 | | main.rs:23:31:23:68 | ... .pad_to_align() | main.rs:23:13:23:29 | ...::alloc | provenance | MaD:15 Sink:MaD:15 | | main.rs:24:38:24:39 | l2 | main.rs:24:13:24:36 | ...::alloc_zeroed | provenance | MaD:16 Sink:MaD:16 | | main.rs:29:9:29:10 | l4 | main.rs:30:31:30:32 | l4 | provenance | | | main.rs:29:14:29:64 | ...::from_size_align_unchecked(...) | main.rs:29:9:29:10 | l4 | provenance | | -| main.rs:29:60:29:60 | v | main.rs:29:14:29:64 | ...::from_size_align_unchecked(...) | provenance | MaD:35 | +| main.rs:29:60:29:60 | v | main.rs:29:14:29:64 | ...::from_size_align_unchecked(...) | provenance | MaD:36 | | main.rs:30:31:30:32 | l4 | main.rs:30:13:30:29 | ...::alloc | provenance | MaD:15 Sink:MaD:15 | | main.rs:32:9:32:10 | l5 | main.rs:33:31:33:32 | l5 | provenance | | | main.rs:32:14:32:118 | ...::from_size_align_unchecked(...) | main.rs:32:9:32:10 | l5 | provenance | | | main.rs:32:60:32:60 | v | main.rs:32:60:32:89 | ... * ... | provenance | MaD:27 | | main.rs:32:60:32:60 | v | main.rs:32:60:32:89 | ... * ... | provenance | MaD:45 | -| main.rs:32:60:32:89 | ... * ... | main.rs:32:14:32:118 | ...::from_size_align_unchecked(...) | provenance | MaD:35 | +| main.rs:32:60:32:89 | ... * ... | main.rs:32:14:32:118 | ...::from_size_align_unchecked(...) | provenance | MaD:36 | | main.rs:33:31:33:32 | l5 | main.rs:33:13:33:29 | ...::alloc | provenance | MaD:15 Sink:MaD:15 | | main.rs:35:9:35:10 | s6 | main.rs:36:60:36:61 | s6 | provenance | | | main.rs:35:14:35:54 | ... + ... | main.rs:35:9:35:10 | s6 | provenance | | @@ -92,13 +92,13 @@ edges | main.rs:35:49:35:49 | v | main.rs:35:15:35:49 | ... * ... | provenance | MaD:44 | | main.rs:36:9:36:10 | l6 | main.rs:37:31:37:32 | l6 | provenance | | | main.rs:36:14:36:65 | ...::from_size_align_unchecked(...) | main.rs:36:9:36:10 | l6 | provenance | | -| main.rs:36:60:36:61 | s6 | main.rs:36:14:36:65 | ...::from_size_align_unchecked(...) | provenance | MaD:35 | +| main.rs:36:60:36:61 | s6 | main.rs:36:14:36:65 | ...::from_size_align_unchecked(...) | provenance | MaD:36 | | main.rs:37:31:37:32 | l6 | main.rs:37:13:37:29 | ...::alloc | provenance | MaD:15 Sink:MaD:15 | | main.rs:37:31:37:32 | l6 | main.rs:39:60:39:61 | l6 | provenance | | | main.rs:39:9:39:10 | l7 | main.rs:40:31:40:32 | l7 | provenance | | | main.rs:39:14:39:72 | ...::from_size_align_unchecked(...) | main.rs:39:9:39:10 | l7 | provenance | | -| main.rs:39:60:39:61 | l6 | main.rs:39:60:39:68 | l6.size() | provenance | MaD:39 | -| main.rs:39:60:39:68 | l6.size() | main.rs:39:14:39:72 | ...::from_size_align_unchecked(...) | provenance | MaD:35 | +| main.rs:39:60:39:61 | l6 | main.rs:39:60:39:68 | l6.size() | provenance | MaD:40 | +| main.rs:39:60:39:68 | l6.size() | main.rs:39:14:39:72 | ...::from_size_align_unchecked(...) | provenance | MaD:36 | | main.rs:40:31:40:32 | l7 | main.rs:40:13:40:29 | ...::alloc | provenance | MaD:15 Sink:MaD:15 | | main.rs:43:44:43:51 | ...: usize | main.rs:50:41:50:41 | v | provenance | | | main.rs:43:44:43:51 | ...: usize | main.rs:51:41:51:41 | v | provenance | | @@ -106,27 +106,27 @@ edges | main.rs:43:44:43:51 | ...: usize | main.rs:54:48:54:48 | v | provenance | | | main.rs:43:44:43:51 | ...: usize | main.rs:58:34:58:34 | v | provenance | | | main.rs:43:44:43:51 | ...: usize | main.rs:67:46:67:46 | v | provenance | | -| main.rs:50:31:50:42 | l2.repeat(...) [Ok, tuple.0] | main.rs:50:31:50:51 | ... .unwrap() [tuple.0] | provenance | MaD:42 | +| main.rs:50:31:50:42 | l2.repeat(...) [Ok, tuple.0] | main.rs:50:31:50:51 | ... .unwrap() [tuple.0] | provenance | MaD:43 | | main.rs:50:31:50:51 | ... .unwrap() [tuple.0] | main.rs:50:31:50:53 | ... .0 | provenance | | | main.rs:50:31:50:53 | ... .0 | main.rs:50:13:50:29 | ...::alloc | provenance | MaD:15 Sink:MaD:15 | -| main.rs:50:41:50:41 | v | main.rs:50:31:50:42 | l2.repeat(...) [Ok, tuple.0] | provenance | MaD:37 | -| main.rs:51:31:51:46 | l2.repeat(...) [Ok, tuple.0] | main.rs:51:31:51:55 | ... .unwrap() [tuple.0] | provenance | MaD:42 | +| main.rs:50:41:50:41 | v | main.rs:50:31:50:42 | l2.repeat(...) [Ok, tuple.0] | provenance | MaD:38 | +| main.rs:51:31:51:46 | l2.repeat(...) [Ok, tuple.0] | main.rs:51:31:51:55 | ... .unwrap() [tuple.0] | provenance | MaD:43 | | main.rs:51:31:51:55 | ... .unwrap() [tuple.0] | main.rs:51:31:51:57 | ... .0 | provenance | | | main.rs:51:31:51:57 | ... .0 | main.rs:51:13:51:29 | ...::alloc | provenance | MaD:15 Sink:MaD:15 | | main.rs:51:41:51:41 | v | main.rs:51:41:51:45 | ... + ... | provenance | MaD:24 | -| main.rs:51:41:51:45 | ... + ... | main.rs:51:31:51:46 | l2.repeat(...) [Ok, tuple.0] | provenance | MaD:37 | -| main.rs:53:31:53:49 | l2.repeat_packed(...) [Ok] | main.rs:53:31:53:58 | ... .unwrap() | provenance | MaD:42 | +| main.rs:51:41:51:45 | ... + ... | main.rs:51:31:51:46 | l2.repeat(...) [Ok, tuple.0] | provenance | MaD:38 | +| main.rs:53:31:53:49 | l2.repeat_packed(...) [Ok] | main.rs:53:31:53:58 | ... .unwrap() | provenance | MaD:43 | | main.rs:53:31:53:58 | ... .unwrap() | main.rs:53:13:53:29 | ...::alloc | provenance | MaD:15 Sink:MaD:15 | -| main.rs:53:48:53:48 | v | main.rs:53:31:53:49 | l2.repeat_packed(...) [Ok] | provenance | MaD:38 | -| main.rs:54:31:54:54 | l2.repeat_packed(...) [Ok] | main.rs:54:31:54:63 | ... .unwrap() | provenance | MaD:42 | +| main.rs:53:48:53:48 | v | main.rs:53:31:53:49 | l2.repeat_packed(...) [Ok] | provenance | MaD:39 | +| main.rs:54:31:54:54 | l2.repeat_packed(...) [Ok] | main.rs:54:31:54:63 | ... .unwrap() | provenance | MaD:43 | | main.rs:54:31:54:63 | ... .unwrap() | main.rs:54:13:54:29 | ...::alloc | provenance | MaD:15 Sink:MaD:15 | | main.rs:54:48:54:48 | v | main.rs:54:48:54:53 | ... * ... | provenance | MaD:27 | -| main.rs:54:48:54:53 | ... * ... | main.rs:54:31:54:54 | l2.repeat_packed(...) [Ok] | provenance | MaD:38 | +| main.rs:54:48:54:53 | ... * ... | main.rs:54:31:54:54 | l2.repeat_packed(...) [Ok] | provenance | MaD:39 | | main.rs:58:9:58:20 | TuplePat [tuple.0] | main.rs:58:10:58:11 | k1 | provenance | | | main.rs:58:10:58:11 | k1 | main.rs:59:31:59:32 | k1 | provenance | | -| main.rs:58:24:58:35 | l3.repeat(...) [Ok, tuple.0] | main.rs:58:24:58:66 | ... .expect(...) [tuple.0] | provenance | MaD:41 | +| main.rs:58:24:58:35 | l3.repeat(...) [Ok, tuple.0] | main.rs:58:24:58:66 | ... .expect(...) [tuple.0] | provenance | MaD:42 | | main.rs:58:24:58:66 | ... .expect(...) [tuple.0] | main.rs:58:9:58:20 | TuplePat [tuple.0] | provenance | | -| main.rs:58:34:58:34 | v | main.rs:58:24:58:35 | l3.repeat(...) [Ok, tuple.0] | provenance | MaD:37 | +| main.rs:58:34:58:34 | v | main.rs:58:24:58:35 | l3.repeat(...) [Ok, tuple.0] | provenance | MaD:38 | | main.rs:59:31:59:32 | k1 | main.rs:59:13:59:29 | ...::alloc | provenance | MaD:15 Sink:MaD:15 | | main.rs:59:31:59:32 | k1 | main.rs:60:34:60:35 | k1 | provenance | | | main.rs:59:31:59:32 | k1 | main.rs:62:24:62:25 | k1 | provenance | | @@ -134,32 +134,32 @@ edges | main.rs:59:31:59:32 | k1 | main.rs:65:31:65:32 | k1 | provenance | | | main.rs:60:9:60:20 | TuplePat [tuple.0] | main.rs:60:10:60:11 | k2 | provenance | | | main.rs:60:10:60:11 | k2 | main.rs:61:31:61:32 | k2 | provenance | | -| main.rs:60:24:60:36 | l3.extend(...) [Ok, tuple.0] | main.rs:60:24:60:45 | ... .unwrap() [tuple.0] | provenance | MaD:42 | +| main.rs:60:24:60:36 | l3.extend(...) [Ok, tuple.0] | main.rs:60:24:60:45 | ... .unwrap() [tuple.0] | provenance | MaD:43 | | main.rs:60:24:60:45 | ... .unwrap() [tuple.0] | main.rs:60:9:60:20 | TuplePat [tuple.0] | provenance | | -| main.rs:60:34:60:35 | k1 | main.rs:60:24:60:36 | l3.extend(...) [Ok, tuple.0] | provenance | MaD:30 | +| main.rs:60:34:60:35 | k1 | main.rs:60:24:60:36 | l3.extend(...) [Ok, tuple.0] | provenance | MaD:31 | | main.rs:61:31:61:32 | k2 | main.rs:61:13:61:29 | ...::alloc | provenance | MaD:15 Sink:MaD:15 | | main.rs:62:9:62:20 | TuplePat [tuple.0] | main.rs:62:10:62:11 | k3 | provenance | | | main.rs:62:10:62:11 | k3 | main.rs:63:31:63:32 | k3 | provenance | | -| main.rs:62:24:62:25 | k1 | main.rs:62:24:62:36 | k1.extend(...) [Ok, tuple.0] | provenance | MaD:31 | -| main.rs:62:24:62:36 | k1.extend(...) [Ok, tuple.0] | main.rs:62:24:62:45 | ... .unwrap() [tuple.0] | provenance | MaD:42 | +| main.rs:62:24:62:25 | k1 | main.rs:62:24:62:36 | k1.extend(...) [Ok, tuple.0] | provenance | MaD:32 | +| main.rs:62:24:62:36 | k1.extend(...) [Ok, tuple.0] | main.rs:62:24:62:45 | ... .unwrap() [tuple.0] | provenance | MaD:43 | | main.rs:62:24:62:45 | ... .unwrap() [tuple.0] | main.rs:62:9:62:20 | TuplePat [tuple.0] | provenance | | | main.rs:63:31:63:32 | k3 | main.rs:63:13:63:29 | ...::alloc | provenance | MaD:15 Sink:MaD:15 | -| main.rs:64:31:64:50 | l3.extend_packed(...) [Ok] | main.rs:64:31:64:59 | ... .unwrap() | provenance | MaD:42 | +| main.rs:64:31:64:50 | l3.extend_packed(...) [Ok] | main.rs:64:31:64:59 | ... .unwrap() | provenance | MaD:43 | | main.rs:64:31:64:59 | ... .unwrap() | main.rs:64:13:64:29 | ...::alloc | provenance | MaD:15 Sink:MaD:15 | -| main.rs:64:48:64:49 | k1 | main.rs:64:31:64:50 | l3.extend_packed(...) [Ok] | provenance | MaD:32 | -| main.rs:65:31:65:32 | k1 | main.rs:65:31:65:50 | k1.extend_packed(...) [Ok] | provenance | MaD:33 | -| main.rs:65:31:65:50 | k1.extend_packed(...) [Ok] | main.rs:65:31:65:59 | ... .unwrap() | provenance | MaD:42 | +| main.rs:64:48:64:49 | k1 | main.rs:64:31:64:50 | l3.extend_packed(...) [Ok] | provenance | MaD:33 | +| main.rs:65:31:65:32 | k1 | main.rs:65:31:65:50 | k1.extend_packed(...) [Ok] | provenance | MaD:34 | +| main.rs:65:31:65:50 | k1.extend_packed(...) [Ok] | main.rs:65:31:65:59 | ... .unwrap() | provenance | MaD:43 | | main.rs:65:31:65:59 | ... .unwrap() | main.rs:65:13:65:29 | ...::alloc | provenance | MaD:15 Sink:MaD:15 | | main.rs:67:9:67:10 | l4 | main.rs:68:31:68:32 | l4 | provenance | | -| main.rs:67:14:67:47 | ...::array::<...>(...) [Ok] | main.rs:67:14:67:56 | ... .unwrap() | provenance | MaD:42 | +| main.rs:67:14:67:47 | ...::array::<...>(...) [Ok] | main.rs:67:14:67:56 | ... .unwrap() | provenance | MaD:43 | | main.rs:67:14:67:56 | ... .unwrap() | main.rs:67:9:67:10 | l4 | provenance | | -| main.rs:67:46:67:46 | v | main.rs:67:14:67:47 | ...::array::<...>(...) [Ok] | provenance | MaD:29 | +| main.rs:67:46:67:46 | v | main.rs:67:14:67:47 | ...::array::<...>(...) [Ok] | provenance | MaD:30 | | main.rs:68:31:68:32 | l4 | main.rs:68:13:68:29 | ...::alloc | provenance | MaD:15 Sink:MaD:15 | | main.rs:86:35:86:42 | ...: usize | main.rs:87:54:87:54 | v | provenance | | | main.rs:87:9:87:14 | layout | main.rs:88:31:88:36 | layout | provenance | | -| main.rs:87:18:87:58 | ...::from_size_align(...) [Ok] | main.rs:87:18:87:67 | ... .unwrap() | provenance | MaD:42 | +| main.rs:87:18:87:58 | ...::from_size_align(...) [Ok] | main.rs:87:18:87:67 | ... .unwrap() | provenance | MaD:43 | | main.rs:87:18:87:67 | ... .unwrap() | main.rs:87:9:87:14 | layout | provenance | | -| main.rs:87:54:87:54 | v | main.rs:87:18:87:58 | ...::from_size_align(...) [Ok] | provenance | MaD:34 | +| main.rs:87:54:87:54 | v | main.rs:87:18:87:58 | ...::from_size_align(...) [Ok] | provenance | MaD:35 | | main.rs:88:31:88:36 | layout | main.rs:88:13:88:29 | ...::alloc | provenance | MaD:15 Sink:MaD:15 | | main.rs:91:38:91:45 | ...: usize | main.rs:92:47:92:47 | v | provenance | | | main.rs:91:38:91:45 | ...: usize | main.rs:101:51:101:51 | v | provenance | | @@ -170,16 +170,16 @@ edges | main.rs:91:38:91:45 | ...: usize | main.rs:161:55:161:55 | v | provenance | | | main.rs:92:9:92:10 | l1 | main.rs:96:35:96:36 | l1 | provenance | | | main.rs:92:9:92:10 | l1 | main.rs:102:35:102:36 | l1 | provenance | | -| main.rs:92:14:92:48 | ...::array::<...>(...) [Ok] | main.rs:92:14:92:57 | ... .unwrap() | provenance | MaD:42 | +| main.rs:92:14:92:48 | ...::array::<...>(...) [Ok] | main.rs:92:14:92:57 | ... .unwrap() | provenance | MaD:43 | | main.rs:92:14:92:57 | ... .unwrap() | main.rs:92:9:92:10 | l1 | provenance | | -| main.rs:92:47:92:47 | v | main.rs:92:14:92:48 | ...::array::<...>(...) [Ok] | provenance | MaD:29 | +| main.rs:92:47:92:47 | v | main.rs:92:14:92:48 | ...::array::<...>(...) [Ok] | provenance | MaD:30 | | main.rs:96:35:96:36 | l1 | main.rs:96:17:96:33 | ...::alloc | provenance | MaD:15 Sink:MaD:15 | | main.rs:96:35:96:36 | l1 | main.rs:109:35:109:36 | l1 | provenance | | | main.rs:96:35:96:36 | l1 | main.rs:111:35:111:36 | l1 | provenance | | | main.rs:101:13:101:14 | l3 | main.rs:103:35:103:36 | l3 | provenance | | -| main.rs:101:18:101:52 | ...::array::<...>(...) [Ok] | main.rs:101:18:101:61 | ... .unwrap() | provenance | MaD:42 | +| main.rs:101:18:101:52 | ...::array::<...>(...) [Ok] | main.rs:101:18:101:61 | ... .unwrap() | provenance | MaD:43 | | main.rs:101:18:101:61 | ... .unwrap() | main.rs:101:13:101:14 | l3 | provenance | | -| main.rs:101:51:101:51 | v | main.rs:101:18:101:52 | ...::array::<...>(...) [Ok] | provenance | MaD:29 | +| main.rs:101:51:101:51 | v | main.rs:101:18:101:52 | ...::array::<...>(...) [Ok] | provenance | MaD:30 | | main.rs:102:35:102:36 | l1 | main.rs:102:17:102:33 | ...::alloc | provenance | MaD:15 Sink:MaD:15 | | main.rs:102:35:102:36 | l1 | main.rs:109:35:109:36 | l1 | provenance | | | main.rs:102:35:102:36 | l1 | main.rs:111:35:111:36 | l1 | provenance | | @@ -190,28 +190,28 @@ edges | main.rs:111:35:111:36 | l1 | main.rs:111:17:111:33 | ...::alloc | provenance | MaD:15 Sink:MaD:15 | | main.rs:111:35:111:36 | l1 | main.rs:146:35:146:36 | l1 | provenance | | | main.rs:145:13:145:14 | l9 | main.rs:148:35:148:36 | l9 | provenance | | -| main.rs:145:18:145:52 | ...::array::<...>(...) [Ok] | main.rs:145:18:145:61 | ... .unwrap() | provenance | MaD:42 | +| main.rs:145:18:145:52 | ...::array::<...>(...) [Ok] | main.rs:145:18:145:61 | ... .unwrap() | provenance | MaD:43 | | main.rs:145:18:145:61 | ... .unwrap() | main.rs:145:13:145:14 | l9 | provenance | | -| main.rs:145:51:145:51 | v | main.rs:145:18:145:52 | ...::array::<...>(...) [Ok] | provenance | MaD:29 | +| main.rs:145:51:145:51 | v | main.rs:145:18:145:52 | ...::array::<...>(...) [Ok] | provenance | MaD:30 | | main.rs:146:35:146:36 | l1 | main.rs:146:17:146:33 | ...::alloc | provenance | MaD:15 Sink:MaD:15 | | main.rs:146:35:146:36 | l1 | main.rs:177:31:177:32 | l1 | provenance | | | main.rs:148:35:148:36 | l9 | main.rs:148:17:148:33 | ...::alloc | provenance | MaD:15 Sink:MaD:15 | | main.rs:151:9:151:11 | l10 | main.rs:152:31:152:33 | l10 | provenance | | -| main.rs:151:15:151:69 | ...::array::<...>(...) [Ok] | main.rs:151:15:151:78 | ... .unwrap() | provenance | MaD:42 | +| main.rs:151:15:151:69 | ...::array::<...>(...) [Ok] | main.rs:151:15:151:78 | ... .unwrap() | provenance | MaD:43 | | main.rs:151:15:151:78 | ... .unwrap() | main.rs:151:9:151:11 | l10 | provenance | | -| main.rs:151:48:151:68 | ...::min(...) | main.rs:151:15:151:69 | ...::array::<...>(...) [Ok] | provenance | MaD:29 | +| main.rs:151:48:151:68 | ...::min(...) | main.rs:151:15:151:69 | ...::array::<...>(...) [Ok] | provenance | MaD:30 | | main.rs:151:62:151:62 | v | main.rs:151:48:151:68 | ...::min(...) | provenance | MaD:47 | | main.rs:152:31:152:33 | l10 | main.rs:152:13:152:29 | ...::alloc | provenance | MaD:15 Sink:MaD:15 | | main.rs:154:9:154:11 | l11 | main.rs:155:31:155:33 | l11 | provenance | | -| main.rs:154:15:154:69 | ...::array::<...>(...) [Ok] | main.rs:154:15:154:78 | ... .unwrap() | provenance | MaD:42 | +| main.rs:154:15:154:69 | ...::array::<...>(...) [Ok] | main.rs:154:15:154:78 | ... .unwrap() | provenance | MaD:43 | | main.rs:154:15:154:78 | ... .unwrap() | main.rs:154:9:154:11 | l11 | provenance | | -| main.rs:154:48:154:68 | ...::max(...) | main.rs:154:15:154:69 | ...::array::<...>(...) [Ok] | provenance | MaD:29 | +| main.rs:154:48:154:68 | ...::max(...) | main.rs:154:15:154:69 | ...::array::<...>(...) [Ok] | provenance | MaD:30 | | main.rs:154:62:154:62 | v | main.rs:154:48:154:68 | ...::max(...) | provenance | MaD:46 | | main.rs:155:31:155:33 | l11 | main.rs:155:13:155:29 | ...::alloc | provenance | MaD:15 Sink:MaD:15 | | main.rs:161:13:161:15 | l13 | main.rs:162:35:162:37 | l13 | provenance | | -| main.rs:161:19:161:59 | ...::from_size_align(...) [Ok] | main.rs:161:19:161:68 | ... .unwrap() | provenance | MaD:42 | +| main.rs:161:19:161:59 | ...::from_size_align(...) [Ok] | main.rs:161:19:161:68 | ... .unwrap() | provenance | MaD:43 | | main.rs:161:19:161:68 | ... .unwrap() | main.rs:161:13:161:15 | l13 | provenance | | -| main.rs:161:55:161:55 | v | main.rs:161:19:161:59 | ...::from_size_align(...) [Ok] | provenance | MaD:34 | +| main.rs:161:55:161:55 | v | main.rs:161:19:161:59 | ...::from_size_align(...) [Ok] | provenance | MaD:35 | | main.rs:162:35:162:37 | l13 | main.rs:162:17:162:33 | ...::alloc | provenance | MaD:15 Sink:MaD:15 | | main.rs:162:35:162:37 | l13 | main.rs:169:35:169:37 | l13 | provenance | | | main.rs:169:35:169:37 | l13 | main.rs:169:17:169:33 | ...::alloc | provenance | MaD:15 Sink:MaD:15 | @@ -219,9 +219,9 @@ edges | main.rs:183:29:183:36 | ...: usize | main.rs:192:46:192:46 | v | provenance | | | main.rs:183:29:183:36 | ...: usize | main.rs:202:48:202:48 | v | provenance | | | main.rs:192:9:192:10 | l2 | main.rs:193:38:193:39 | l2 | provenance | | -| main.rs:192:14:192:47 | ...::array::<...>(...) [Ok] | main.rs:192:14:192:56 | ... .unwrap() | provenance | MaD:42 | +| main.rs:192:14:192:47 | ...::array::<...>(...) [Ok] | main.rs:192:14:192:56 | ... .unwrap() | provenance | MaD:43 | | main.rs:192:14:192:56 | ... .unwrap() | main.rs:192:9:192:10 | l2 | provenance | | -| main.rs:192:46:192:46 | v | main.rs:192:14:192:47 | ...::array::<...>(...) [Ok] | provenance | MaD:29 | +| main.rs:192:46:192:46 | v | main.rs:192:14:192:47 | ...::array::<...>(...) [Ok] | provenance | MaD:30 | | main.rs:193:38:193:39 | l2 | main.rs:193:32:193:36 | alloc | provenance | MaD:10 Sink:MaD:10 | | main.rs:193:38:193:39 | l2 | main.rs:194:45:194:46 | l2 | provenance | | | main.rs:194:45:194:46 | l2 | main.rs:194:32:194:43 | alloc_zeroed | provenance | MaD:11 Sink:MaD:11 | @@ -258,19 +258,19 @@ edges | main.rs:231:42:231:42 | v | main.rs:231:13:231:40 | ...::with_capacity_in | provenance | MaD:4 Sink:MaD:4 | | main.rs:279:24:279:41 | ...: String | main.rs:280:21:280:30 | user_input | provenance | | | main.rs:280:9:280:17 | num_bytes | main.rs:282:54:282:62 | num_bytes | provenance | | -| main.rs:280:21:280:30 | user_input | main.rs:280:21:280:47 | user_input.parse() [Ok] | provenance | MaD:43 | +| main.rs:280:21:280:30 | user_input | main.rs:280:21:280:47 | user_input.parse() [Ok] | provenance | MaD:28 | | main.rs:280:21:280:47 | user_input.parse() [Ok] | main.rs:280:21:280:48 | TryExpr | provenance | | | main.rs:280:21:280:48 | TryExpr | main.rs:280:21:280:77 | ... * ... | provenance | MaD:27 | | main.rs:280:21:280:48 | TryExpr | main.rs:280:21:280:77 | ... * ... | provenance | MaD:45 | | main.rs:280:21:280:77 | ... * ... | main.rs:280:9:280:17 | num_bytes | provenance | | | main.rs:282:9:282:14 | layout | main.rs:284:40:284:45 | layout | provenance | | -| main.rs:282:18:282:66 | ...::from_size_align(...) [Ok] | main.rs:282:18:282:75 | ... .unwrap() | provenance | MaD:42 | +| main.rs:282:18:282:66 | ...::from_size_align(...) [Ok] | main.rs:282:18:282:75 | ... .unwrap() | provenance | MaD:43 | | main.rs:282:18:282:75 | ... .unwrap() | main.rs:282:9:282:14 | layout | provenance | | -| main.rs:282:54:282:62 | num_bytes | main.rs:282:18:282:66 | ...::from_size_align(...) [Ok] | provenance | MaD:34 | +| main.rs:282:54:282:62 | num_bytes | main.rs:282:18:282:66 | ...::from_size_align(...) [Ok] | provenance | MaD:35 | | main.rs:284:40:284:45 | layout | main.rs:284:22:284:38 | ...::alloc | provenance | MaD:15 Sink:MaD:15 | | main.rs:308:25:308:38 | ...::args | main.rs:308:25:308:40 | ...::args(...) [element] | provenance | Src:MaD:22 | | main.rs:308:25:308:40 | ...::args(...) [element] | main.rs:308:25:308:47 | ... .nth(...) [Some] | provenance | MaD:23 | -| main.rs:308:25:308:47 | ... .nth(...) [Some] | main.rs:308:25:308:74 | ... .unwrap_or(...) | provenance | MaD:40 | +| main.rs:308:25:308:47 | ... .nth(...) [Some] | main.rs:308:25:308:74 | ... .unwrap_or(...) | provenance | MaD:41 | | main.rs:308:25:308:74 | ... .unwrap_or(...) | main.rs:279:24:279:41 | ...: String | provenance | | | main.rs:317:9:317:9 | v | main.rs:320:34:320:34 | v | provenance | | | main.rs:317:9:317:9 | v | main.rs:321:42:321:42 | v | provenance | | @@ -280,9 +280,9 @@ edges | main.rs:317:9:317:9 | v | main.rs:325:22:325:22 | v | provenance | | | main.rs:317:13:317:26 | ...::args | main.rs:317:13:317:28 | ...::args(...) [element] | provenance | Src:MaD:22 | | main.rs:317:13:317:28 | ...::args(...) [element] | main.rs:317:13:317:35 | ... .nth(...) [Some] | provenance | MaD:23 | -| main.rs:317:13:317:35 | ... .nth(...) [Some] | main.rs:317:13:317:65 | ... .unwrap_or(...) | provenance | MaD:40 | -| main.rs:317:13:317:65 | ... .unwrap_or(...) | main.rs:317:13:317:82 | ... .parse() [Ok] | provenance | MaD:43 | -| main.rs:317:13:317:82 | ... .parse() [Ok] | main.rs:317:13:317:91 | ... .unwrap() | provenance | MaD:42 | +| main.rs:317:13:317:35 | ... .nth(...) [Some] | main.rs:317:13:317:65 | ... .unwrap_or(...) | provenance | MaD:41 | +| main.rs:317:13:317:65 | ... .unwrap_or(...) | main.rs:317:13:317:82 | ... .parse() [Ok] | provenance | MaD:28 | +| main.rs:317:13:317:82 | ... .parse() [Ok] | main.rs:317:13:317:91 | ... .unwrap() | provenance | MaD:43 | | main.rs:317:13:317:91 | ... .unwrap() | main.rs:317:9:317:9 | v | provenance | | | main.rs:320:34:320:34 | v | main.rs:12:36:12:43 | ...: usize | provenance | | | main.rs:321:42:321:42 | v | main.rs:43:44:43:51 | ...: usize | provenance | | @@ -318,22 +318,22 @@ models | 25 | Summary: <_ as core::ops::arith::Mul>::mul; Argument[0].Reference; ReturnValue; taint | | 26 | Summary: <_ as core::ops::arith::Mul>::mul; Argument[0]; ReturnValue; taint | | 27 | Summary: <_ as core::ops::arith::Mul>::mul; Argument[self]; ReturnValue; taint | -| 28 | Summary: ::align_to; Argument[self].Reference; ReturnValue.Field[core::result::Result::Ok(0)]; taint | -| 29 | Summary: ::array; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | -| 30 | Summary: ::extend; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)].Field[0]; taint | -| 31 | Summary: ::extend; Argument[self].Reference; ReturnValue.Field[core::result::Result::Ok(0)].Field[0]; taint | -| 32 | Summary: ::extend_packed; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | -| 33 | Summary: ::extend_packed; Argument[self].Reference; ReturnValue.Field[core::result::Result::Ok(0)]; taint | -| 34 | Summary: ::from_size_align; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | -| 35 | Summary: ::from_size_align_unchecked; Argument[0]; ReturnValue; taint | -| 36 | Summary: ::pad_to_align; Argument[self].Reference; ReturnValue; taint | -| 37 | Summary: ::repeat; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)].Field[0]; taint | -| 38 | Summary: ::repeat_packed; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | -| 39 | Summary: ::size; Argument[self].Reference; ReturnValue; taint | -| 40 | Summary: ::unwrap_or; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | -| 41 | Summary: ::expect; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | -| 42 | Summary: ::unwrap; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | -| 43 | Summary: ::parse; Argument[self]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | +| 28 | Summary: ::deref; Argument[self].Reference; ReturnValue.Reference; taint | +| 29 | Summary: ::align_to; Argument[self].Reference; ReturnValue.Field[core::result::Result::Ok(0)]; taint | +| 30 | Summary: ::array; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | +| 31 | Summary: ::extend; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)].Field[0]; taint | +| 32 | Summary: ::extend; Argument[self].Reference; ReturnValue.Field[core::result::Result::Ok(0)].Field[0]; taint | +| 33 | Summary: ::extend_packed; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | +| 34 | Summary: ::extend_packed; Argument[self].Reference; ReturnValue.Field[core::result::Result::Ok(0)]; taint | +| 35 | Summary: ::from_size_align; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | +| 36 | Summary: ::from_size_align_unchecked; Argument[0]; ReturnValue; taint | +| 37 | Summary: ::pad_to_align; Argument[self].Reference; ReturnValue; taint | +| 38 | Summary: ::repeat; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)].Field[0]; taint | +| 39 | Summary: ::repeat_packed; Argument[0]; ReturnValue.Field[core::result::Result::Ok(0)]; taint | +| 40 | Summary: ::size; Argument[self].Reference; ReturnValue; taint | +| 41 | Summary: ::unwrap_or; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value | +| 42 | Summary: ::expect; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | +| 43 | Summary: ::unwrap; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value | | 44 | Summary: ::mul; Argument[0]; ReturnValue; taint | | 45 | Summary: ::mul; Argument[self]; ReturnValue; taint | | 46 | Summary: core::cmp::max; Argument[0]; ReturnValue; value | diff --git a/shared/typeinference/codeql/typeinference/internal/TypeInference.qll b/shared/typeinference/codeql/typeinference/internal/TypeInference.qll index f53f15b5a6ab..d76f8b87c51b 100644 --- a/shared/typeinference/codeql/typeinference/internal/TypeInference.qll +++ b/shared/typeinference/codeql/typeinference/internal/TypeInference.qll @@ -969,9 +969,10 @@ module Make1 Input1> { pragma[nomagic] private predicate satisfiesConstraintTypeMention1( - HasTypeTree tt, Type constraint, TypePath path, TypePath pathToTypeParamInSub + HasTypeTree tt, TypeAbstraction abs, Type constraint, TypePath path, + TypePath pathToTypeParamInSub ) { - exists(TypeAbstraction abs, TypeMention sub, TypeParameter tp | + exists(TypeMention sub, TypeParameter tp | satisfiesConstraintTypeMention0(tt, constraint, abs, sub, path, tp) and tp = abs.getATypeParameter() and sub.resolveTypeAt(pathToTypeParamInSub) = tp @@ -983,17 +984,26 @@ module Make1 Input1> { * with the type `t` at `path`. */ pragma[nomagic] - predicate satisfiesConstraintType(HasTypeTree tt, Type constraint, TypePath path, Type t) { - exists(TypeAbstraction abs | - satisfiesConstraintTypeMention0(tt, constraint, abs, _, path, t) and - not t = abs.getATypeParameter() - ) + predicate satisfiesConstraintType( + HasTypeTree tt, TypeAbstraction abs, Type constraint, TypePath path, Type t + ) { + satisfiesConstraintTypeMention0(tt, constraint, abs, _, path, t) and + not t = abs.getATypeParameter() or exists(TypePath prefix0, TypePath pathToTypeParamInSub, TypePath suffix | - satisfiesConstraintTypeMention1(tt, constraint, prefix0, pathToTypeParamInSub) and + satisfiesConstraintTypeMention1(tt, abs, constraint, prefix0, pathToTypeParamInSub) and tt.getTypeAt(pathToTypeParamInSub.appendInverse(suffix)) = t and path = prefix0.append(suffix) ) + } + + /** + * Holds if the type tree at `tt` satisfies the constraint `constraint` + * with the type `t` at `path`. + */ + pragma[nomagic] + predicate satisfiesConstraintType(HasTypeTree tt, Type constraint, TypePath path, Type t) { + satisfiesConstraintType(tt, _, constraint, path, t) or hasTypeConstraint(tt, constraint, constraint) and t = tt.getTypeAt(path) diff --git a/shared/util/codeql/util/UnboundList.qll b/shared/util/codeql/util/UnboundList.qll index d9a8b905a135..4ee447c5cfe3 100644 --- a/shared/util/codeql/util/UnboundList.qll +++ b/shared/util/codeql/util/UnboundList.qll @@ -66,7 +66,7 @@ module Make Input> { /** Gets the `i`th element in this list. */ bindingset[this] - private Element getElement(int i) { result = decode(this.splitAt(".", i)) } + Element getElement(int i) { result = decode(this.splitAt(".", i)) } /** Gets a textual representation of this list. */ bindingset[this]