33 */
44
55private import codeql.util.Void
6+ private import codeql.util.Unit
67private import codeql.dataflow.DataFlow
78private import codeql.dataflow.internal.DataFlowImpl
89private import rust
@@ -26,11 +27,6 @@ module Node {
2627 */
2728 Expr asExpr ( ) { none ( ) }
2829
29- /**
30- * Gets this node's underlying pattern, if any.
31- */
32- Pat asPattern ( ) { none ( ) }
33-
3430 /**
3531 * Gets the control flow node that corresponds to this data flow node.
3632 */
@@ -73,7 +69,7 @@ module Node {
7369 final class ArgumentNode = NaNode ;
7470
7571 final class ReturnNode extends NaNode {
76- ReturnKind getKind ( ) { none ( ) }
72+ RustDataFlow :: ReturnKind getKind ( ) { none ( ) }
7773 }
7874
7975 final class OutNode = NaNode ;
@@ -152,7 +148,7 @@ module RustDataFlow implements InputSig<Location> {
152148
153149 OutNode getAnOutNode ( DataFlowCall call , ReturnKind kind ) { none ( ) }
154150
155- final class DataFlowType = Void ;
151+ final class DataFlowType = Unit ;
156152
157153 predicate compatibleTypes ( DataFlowType t1 , DataFlowType t2 ) { any ( ) }
158154
@@ -281,21 +277,16 @@ module RustDataFlow implements InputSig<Location> {
281277 class DataFlowSecondLevelScope = Void ;
282278}
283279
284- import RustDataFlow
285- import MakeImpl< Location , RustDataFlow >
280+ final class ContentSet = RustDataFlow:: ContentSet ;
286281
287- /**
288- * Holds if data flows from `nodeFrom` to `nodeTo` in exactly one local
289- * (intra-procedural) step.
290- */
291- predicate localFlowStep = localFlowStepImpl / 2 ;
282+ import MakeImpl< Location , RustDataFlow >
292283
293284/** A collection of cached types and predicates to be evaluated in the same stage. */
294285cached
295286private module Cached {
296287 cached
297288 newtype TNode =
298- TExprNode ( CfgNode n , Expr e ) or
289+ TExprNode ( CfgNode n , Expr e ) { n . getAstNode ( ) = e } or
299290 TSourceParameterNode ( Param param )
300291
301292 cached
@@ -311,14 +302,7 @@ private module Cached {
311302
312303 /** This is the local flow predicate that is exposed. */
313304 cached
314- predicate localFlowStepImpl ( Node nodeFrom , Node nodeTo ) { none ( ) }
305+ predicate localFlowStepImpl ( Node:: Node nodeFrom , Node :: Node nodeTo ) { none ( ) }
315306}
316307
317308import Cached
318-
319- /**
320- * Holds if data flows from `source` to `sink` in zero or more local
321- * (intra-procedural) steps.
322- */
323- pragma [ inline]
324- predicate localFlow ( Node source , Node sink ) { localFlowStep * ( source , sink ) }
0 commit comments