@@ -1605,7 +1605,7 @@ private module MethodResolution {
16051605 pos .isPositional ( ) and
16061606 FunctionOverloading:: functionResolutionDependsOnArgument ( i , f , pos , path , t0 ) and
16071607 t .appliesTo ( f , pos , i ) and
1608- not t0 instanceof TypeParameter
1608+ not t0 instanceof TypeParameter // skip parametric types, as we ought to check type bounds
16091609 )
16101610 }
16111611
@@ -1817,12 +1817,9 @@ private module NonMethodResolution {
18171817 TraitItemNode trait , NonMethodFunction traitFunction , FunctionTypePosition pos ,
18181818 NonMethodFunction implFunction
18191819 ) {
1820- exists ( TypePath path , Type type |
1821- functionTypeAtPath ( implFunction , pos , path , type ) and
1822- implFunction .implements ( traitFunction ) and
1823- traitTypeParameterOccurrence ( trait , traitFunction , _, pos , _, _) and
1824- not type instanceof TypeParameter
1825- |
1820+ implFunction .implements ( traitFunction ) and
1821+ traitTypeParameterOccurrence ( trait , traitFunction , _, pos , _, _) and
1822+ (
18261823 not pos .isReturn ( )
18271824 or
18281825 // We only check that the context of the call provides relevant type information
@@ -1975,7 +1972,7 @@ private module NonMethodResolution {
19751972 }
19761973
19771974 pragma [ nomagic]
1978- NonMethodFunction resolveAssocCallTargetCand ( ImplOrTraitItemNode i ) {
1975+ NonMethodFunction resolveAssocCallTargetCand ( ImplItemNode i ) {
19791976 not this .( Call ) .hasTrait ( ) and
19801977 result = this .getPathResolutionResolved ( ) and
19811978 result = i .getASuccessor ( _)
@@ -2033,10 +2030,17 @@ private module NonMethodResolution {
20332030 exists ( Type t0 |
20342031 FunctionOverloading:: functionResolutionDependsOnArgument ( i , f , pos , _, t0 ) and
20352032 t .appliesTo ( f , pos , i ) and
2036- not t0 instanceof TypeParameter
2033+ not t0 instanceof TypeParameter // skip parametric types, as we ought to check type bounds
20372034 )
20382035 or
2039- traitFunctionDependsOnArgument ( _, _, pos , f ) and
2036+ (
2037+ traitFunctionDependsOnArgument ( _, _, pos , f )
2038+ or
2039+ exists ( Trait trait |
2040+ traitFunctionDependsOnArgument ( trait , f , pos , _) and
2041+ t .getTypeAt ( _) = TTrait ( trait )
2042+ )
2043+ ) and
20402044 t .appliesTo ( f , pos , i )
20412045 }
20422046
@@ -2048,10 +2052,14 @@ private module NonMethodResolution {
20482052 predicate hasTargetCand ( ImplOrTraitItemNode i , Function f ) {
20492053 f = this .resolveAssocCallTargetCand ( i )
20502054 or
2051- exists ( TraitItemNode trait , NonMethodFunction resolved |
2055+ exists ( TraitItemNode trait , NonMethodFunction resolved , Function f1 |
20522056 this .hasTraitResolved ( trait , resolved ) and
2053- traitFunctionDependsOnArgument ( trait , resolved , _, f ) and
2057+ traitFunctionDependsOnArgument ( trait , resolved , _, f1 ) and
20542058 f = i .getASuccessor ( _)
2059+ |
2060+ f = f1
2061+ or
2062+ f = resolved
20552063 )
20562064 }
20572065 }
@@ -3055,8 +3063,8 @@ private module Debug {
30553063 Locatable getRelevantLocatable ( ) {
30563064 exists ( string filepath , int startline , int startcolumn , int endline , int endcolumn |
30573065 result .getLocation ( ) .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn ) and
3058- filepath .matches ( "%/sqlx .rs" ) and
3059- startline = [ 56 .. 60 ]
3066+ filepath .matches ( "%/main .rs" ) and
3067+ startline = 701
30603068 )
30613069 }
30623070
0 commit comments