@@ -45,10 +45,12 @@ final class DataFlowCallable extends TDataFlowCallable {
4545 /**
4646 * Gets the underlying library callable, if any.
4747 */
48- LibraryCallable asLibraryCallable ( ) { this = TLibraryCallable ( result ) }
48+ SummarizedCallable asSummarizedCallable ( ) { this = TSummarizedCallable ( result ) }
4949
5050 /** Gets a textual representation of this callable. */
51- string toString ( ) { result = [ this .asCfgScope ( ) .toString ( ) , this .asLibraryCallable ( ) .toString ( ) ] }
51+ string toString ( ) {
52+ result = [ this .asCfgScope ( ) .toString ( ) , this .asSummarizedCallable ( ) .toString ( ) ]
53+ }
5254
5355 /** Gets the location of this callable. */
5456 Location getLocation ( ) { result = this .asCfgScope ( ) .getLocation ( ) }
@@ -65,12 +67,9 @@ final class DataFlowCall extends TDataFlowCall {
6567 }
6668
6769 DataFlowCallable getEnclosingCallable ( ) {
68- result = TCfgScope ( this .asCallCfgNode ( ) .getExpr ( ) .getEnclosingCfgScope ( ) )
70+ result . asCfgScope ( ) = this .asCallCfgNode ( ) .getExpr ( ) .getEnclosingCfgScope ( )
6971 or
70- exists ( FlowSummaryImpl:: Public:: SummarizedCallable c |
71- this .isSummaryCall ( c , _) and
72- result = TLibraryCallable ( c )
73- )
72+ this .isSummaryCall ( result .asSummarizedCallable ( ) , _)
7473 }
7574
7675 string toString ( ) {
@@ -401,9 +400,11 @@ module RustDataFlow implements InputSig<Location> {
401400
402401 /** Gets a viable implementation of the target of the given `Call`. */
403402 DataFlowCallable viableCallable ( DataFlowCall call ) {
404- result .asCfgScope ( ) = call .asCallCfgNode ( ) .getCall ( ) .getStaticTarget ( )
405- or
406- result .asLibraryCallable ( ) .getACall ( ) = call .asCallCfgNode ( ) .getCall ( )
403+ exists ( Callable target | target = call .asCallCfgNode ( ) .getCall ( ) .getStaticTarget ( ) |
404+ target = result .asCfgScope ( )
405+ or
406+ target = result .asSummarizedCallable ( )
407+ )
407408 }
408409
409410 /**
@@ -757,7 +758,7 @@ module RustDataFlow implements InputSig<Location> {
757758 predicate allowParameterReturnInSelf ( ParameterNode p ) {
758759 exists ( DataFlowCallable c , ParameterPosition pos |
759760 p .isParameterOf ( c , pos ) and
760- FlowSummaryImpl:: Private:: summaryAllowParameterReturnInSelf ( c .asLibraryCallable ( ) , pos )
761+ FlowSummaryImpl:: Private:: summaryAllowParameterReturnInSelf ( c .asSummarizedCallable ( ) , pos )
761762 )
762763 or
763764 VariableCapture:: Flow:: heuristicAllowInstanceParameterReturnInSelf ( p .( ClosureParameterNode )
@@ -968,7 +969,7 @@ private module Cached {
968969 cached
969970 newtype TDataFlowCallable =
970971 TCfgScope ( CfgScope scope ) or
971- TLibraryCallable ( LibraryCallable c )
972+ TSummarizedCallable ( SummarizedCallable c )
972973
973974 /** This is the local flow predicate that is exposed. */
974975 cached
0 commit comments