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 {
23
23
* ```
24
24
*/
25
25
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 ( ) ]
29
30
}
30
31
32
+ /** Gets the function for which this impl trait type occurs, if any. */
33
+ Function getFunction ( ) { exists ( this .getFunctionTypeRepr ( result ) ) }
34
+
31
35
/** Holds if this impl trait type occurs in the return type of a function. */
32
36
predicate isInReturnPos ( ) {
33
- this . getParentNode * ( ) = this . getFunction ( ) .getRetType ( ) . getTypeRepr ( )
37
+ exists ( Function f | f . getRetType ( ) .getTypeRepr ( ) = this . getFunctionTypeRepr ( f ) )
34
38
}
35
39
}
36
40
}
You can’t perform that action at this time.
0 commit comments