@@ -102,18 +102,18 @@ final class ParameterPosition extends TParameterPosition {
102102 predicate isSelf ( ) { this = TSelfParameterPosition ( ) }
103103
104104 /**
105- * Holds if this position represents a reference to a lambda itself. Only
105+ * Holds if this position represents a reference to a closure itself. Only
106106 * used for tracking flow through captured variables.
107107 */
108- predicate isLambdaSelf ( ) { this = TLambdaSelfParameterPosition ( ) }
108+ predicate isClosureSelf ( ) { this = TClosureSelfParameterPosition ( ) }
109109
110110 /** Gets a textual representation of this position. */
111111 string toString ( ) {
112112 result = this .getPosition ( ) .toString ( )
113113 or
114114 result = "self" and this .isSelf ( )
115115 or
116- result = "lambda self" and this .isLambdaSelf ( )
116+ result = "closure self" and this .isClosureSelf ( )
117117 }
118118
119119 ParamBase getParameterIn ( ParamList ps ) {
@@ -276,15 +276,15 @@ module Node {
276276 * The run-time representation of a closure itself at function entry, viewed
277277 * as a node in a data flow graph.
278278 */
279- final class ClosureParameterNode extends ParameterNode , TLambdaSelfReferenceNode {
279+ final class ClosureParameterNode extends ParameterNode , TClosureSelfReferenceNode {
280280 private CfgScope cfgScope ;
281281
282- ClosureParameterNode ( ) { this = TLambdaSelfReferenceNode ( cfgScope ) }
282+ ClosureParameterNode ( ) { this = TClosureSelfReferenceNode ( cfgScope ) }
283283
284284 final override CfgScope getCfgScope ( ) { result = cfgScope }
285285
286286 override predicate isParameterOf ( DataFlowCallable c , ParameterPosition pos ) {
287- cfgScope = c .asCfgScope ( ) and pos .isLambdaSelf ( )
287+ cfgScope = c .asCfgScope ( ) and pos .isClosureSelf ( )
288288 }
289289
290290 override Location getLocation ( ) { result = cfgScope .getLocation ( ) }
@@ -331,7 +331,7 @@ module Node {
331331
332332 override predicate isArgumentOf ( DataFlowCall call , RustDataFlow:: ArgumentPosition pos ) {
333333 call .asCallExprCfgNode ( ) = call_ and
334- pos .isLambdaSelf ( )
334+ pos .isClosureSelf ( )
335335 }
336336 }
337337
@@ -403,6 +403,24 @@ module Node {
403403 override DataFlowCall getCall ( ReturnKind kind ) { result = call and kind = kind_ }
404404 }
405405
406+ /**
407+ * A synthesized data flow node representing a closure object that tracks
408+ * captured variables.
409+ */
410+ class CaptureNode extends Node , TCaptureNode {
411+ private VariableCapture:: Flow:: SynthesizedCaptureNode cn ;
412+
413+ CaptureNode ( ) { this = TCaptureNode ( cn ) }
414+
415+ VariableCapture:: Flow:: SynthesizedCaptureNode getSynthesizedCaptureNode ( ) { result = cn }
416+
417+ override CfgScope getCfgScope ( ) { result = cn .getEnclosingCallable ( ) }
418+
419+ override Location getLocation ( ) { result = cn .getLocation ( ) }
420+
421+ override string toString ( ) { result = cn .toString ( ) }
422+ }
423+
406424 /**
407425 * A node associated with an object after an operation that might have
408426 * changed its state.
@@ -458,24 +476,6 @@ module Node {
458476 final override string toString ( ) { result = PostUpdateNode .super .toString ( ) }
459477 }
460478
461- /**
462- * A synthesized data flow node representing a closure object that tracks
463- * captured variables.
464- */
465- class CaptureNode extends Node , TCaptureNode {
466- private VariableCapture:: Flow:: SynthesizedCaptureNode cn ;
467-
468- CaptureNode ( ) { this = TCaptureNode ( cn ) }
469-
470- VariableCapture:: Flow:: SynthesizedCaptureNode getSynthesizedCaptureNode ( ) { result = cn }
471-
472- override CfgScope getCfgScope ( ) { result = cn .getEnclosingCallable ( ) }
473-
474- override Location getLocation ( ) { result = cn .getLocation ( ) }
475-
476- override string toString ( ) { result = cn .toString ( ) }
477- }
478-
479479 final class CastNode = NaNode ;
480480}
481481
@@ -847,8 +847,6 @@ module RustDataFlow implements InputSig<Location> {
847847 node instanceof Node:: CaptureNode
848848 or
849849 node instanceof Node:: ClosureParameterNode
850- or
851- node instanceof Node:: ClosureArgumentNode
852850 }
853851
854852 class DataFlowExpr = ExprCfgNode ;
@@ -1383,7 +1381,7 @@ private module Cached {
13831381 } or
13841382 TSsaNode ( SsaImpl:: DataFlowIntegration:: SsaNode node ) or
13851383 TFlowSummaryNode ( FlowSummaryImpl:: Private:: SummaryNode sn ) or
1386- TLambdaSelfReferenceNode ( CfgScope c ) { lambdaCreationExpr ( c , _) } or
1384+ TClosureSelfReferenceNode ( CfgScope c ) { lambdaCreationExpr ( c , _) } or
13871385 TCaptureNode ( VariableCapture:: Flow:: SynthesizedCaptureNode cn )
13881386
13891387 cached
@@ -1421,7 +1419,7 @@ private module Cached {
14211419 or
14221420 FlowSummaryImpl:: ParsePositions:: isParsedParameterPosition ( _, i )
14231421 } or
1424- TLambdaSelfParameterPosition ( ) or
1422+ TClosureSelfParameterPosition ( ) or
14251423 TSelfParameterPosition ( )
14261424
14271425 cached
0 commit comments