@@ -15,10 +15,11 @@ private import TypeInference
1515 * Holds if `traitBound` is the first non-trivial trait bound of `tp`.
1616 */
1717pragma [ nomagic]
18- private predicate hasFirstNonTrivialTraitBound ( TypeParamItemNode tp , Trait traitBound ) {
18+ private predicate hasFirstNonTrivialTraitBound ( TypeParamItemNode tp , Path traitBound ) {
1919 traitBound =
20- min ( Trait trait , int i |
21- trait = tp .resolveBound ( i ) and
20+ min ( Trait trait , Path path , int i |
21+ path = tp .getBoundPath ( i ) and
22+ trait = resolvePath ( path ) and
2223 // Exclude traits that are known to not narrow things down very much.
2324 not trait .getName ( ) .getText ( ) =
2425 [
@@ -27,7 +28,7 @@ private predicate hasFirstNonTrivialTraitBound(TypeParamItemNode tp, Trait trait
2728 "Send" , "Sync" , "Unpin" , "UnwindSafe" , "RefUnwindSafe"
2829 ]
2930 |
30- trait order by i
31+ path order by i
3132 )
3233}
3334
@@ -103,11 +104,11 @@ module SatisfiesBlanketConstraint<
103104 }
104105
105106 private module SatisfiesBlanketConstraintInput implements
106- SatisfiesTypeInputSig < ArgumentTypeAndBlanketOffset >
107+ SatisfiesConstraintInputSig < ArgumentTypeAndBlanketOffset , TypeMention >
107108 {
108109 pragma [ nomagic]
109110 additional predicate relevantConstraint (
110- ArgumentTypeAndBlanketOffset ato , ImplItemNode impl , Trait traitBound
111+ ArgumentTypeAndBlanketOffset ato , ImplItemNode impl , Path traitBound
111112 ) {
112113 exists ( ArgumentType at , TypePath blanketPath , TypeParam blanketTypeParam |
113114 ato = MkArgumentTypeAndBlanketOffset ( at , blanketPath ) and
@@ -117,24 +118,24 @@ module SatisfiesBlanketConstraint<
117118 }
118119
119120 pragma [ nomagic]
120- predicate relevantConstraint ( ArgumentTypeAndBlanketOffset ato , Type constraint ) {
121- relevantConstraint ( ato , _, constraint . ( TraitType ) . getTrait ( ) )
121+ predicate relevantConstraint ( ArgumentTypeAndBlanketOffset ato , TypeMention constraint ) {
122+ relevantConstraint ( ato , _, constraint )
122123 }
123124 }
124125
125126 private module SatisfiesBlanketConstraint =
126- SatisfiesType < ArgumentTypeAndBlanketOffset , SatisfiesBlanketConstraintInput > ;
127+ SatisfiesConstraint < ArgumentTypeAndBlanketOffset , TypeMention , SatisfiesBlanketConstraintInput > ;
127128
128129 /**
129130 * Holds if the argument type `at` satisfies the first non-trivial blanket
130131 * constraint of `impl`, or if there are no non-trivial constraints of `impl`.
131132 */
132133 pragma [ nomagic]
133134 predicate satisfiesBlanketConstraint ( ArgumentType at , ImplItemNode impl ) {
134- exists ( ArgumentTypeAndBlanketOffset ato , Trait traitBound |
135+ exists ( ArgumentTypeAndBlanketOffset ato , Path traitBound |
135136 ato = MkArgumentTypeAndBlanketOffset ( at , _) and
136137 SatisfiesBlanketConstraintInput:: relevantConstraint ( ato , impl , traitBound ) and
137- SatisfiesBlanketConstraint:: satisfiesConstraint ( ato , TTrait ( traitBound ) , _, _)
138+ SatisfiesBlanketConstraint:: satisfiesConstraint ( ato , traitBound , _, _)
138139 )
139140 or
140141 exists ( TypeParam blanketTypeParam |
@@ -149,10 +150,10 @@ module SatisfiesBlanketConstraint<
149150 */
150151 pragma [ nomagic]
151152 predicate dissatisfiesBlanketConstraint ( ArgumentType at , ImplItemNode impl ) {
152- exists ( ArgumentTypeAndBlanketOffset ato , Trait traitBound |
153+ exists ( ArgumentTypeAndBlanketOffset ato , Path traitBound |
153154 ato = MkArgumentTypeAndBlanketOffset ( at , _) and
154155 SatisfiesBlanketConstraintInput:: relevantConstraint ( ato , impl , traitBound ) and
155- SatisfiesBlanketConstraint:: dissatisfiesConstraint ( ato , TTrait ( traitBound ) )
156+ SatisfiesBlanketConstraint:: dissatisfiesConstraint ( ato , traitBound )
156157 )
157158 }
158159}
0 commit comments