File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
rust/ql/lib/codeql/rust/elements/internal Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -23,14 +23,18 @@ module Impl {
2323 * ```
2424 */
2525 class ImplTraitTypeRepr extends Generated:: ImplTraitTypeRepr {
26- /** Gets the function for which this impl trait type occurs, if any. */
27- Function getFunction ( ) {
28- this .getParentNode * ( ) = [ result .getRetType ( ) .getTypeRepr ( ) , result .getAParam ( ) .getTypeRepr ( ) ]
26+ pragma [ nomagic]
27+ private TypeRepr getFunctionTypeRepr ( Function f ) {
28+ this .getParentNode * ( ) = result and
29+ result = [ f .getRetType ( ) .getTypeRepr ( ) , f .getAParam ( ) .getTypeRepr ( ) ]
2930 }
3031
32+ /** Gets the function for which this impl trait type occurs, if any. */
33+ Function getFunction ( ) { exists ( this .getFunctionTypeRepr ( result ) ) }
34+
3135 /** Holds if this impl trait type occurs in the return type of a function. */
3236 predicate isInReturnPos ( ) {
33- this . getParentNode * ( ) = this . getFunction ( ) .getRetType ( ) . getTypeRepr ( )
37+ exists ( Function f | f . getRetType ( ) .getTypeRepr ( ) = this . getFunctionTypeRepr ( f ) )
3438 }
3539 }
3640}
You can’t perform that action at this time.
0 commit comments