@@ -1765,7 +1765,14 @@ private module BlanketImplementation {
1765
1765
t =
1766
1766
rank [ 1 ] ( Trait trait , int i |
1767
1767
trait = getBlanketImplementationTypeParam ( impl ) .resolveBound ( i ) and
1768
- not trait .getName ( ) .getText ( ) = [ "Sized" , "Fn" , "FnOnce" , "FnMut" ]
1768
+ // Exclude traits that are "trivial" in the sense that they are known to
1769
+ // not narrow things down very much.
1770
+ not trait .getName ( ) .getText ( ) =
1771
+ [
1772
+ "Sized" , "Clone" , "Fn" , "FnOnce" , "FnMut" ,
1773
+ // The auto traits
1774
+ "Send" , "Sync" , "Unpin" , "UnwindSafe" , "RefUnwindSafe"
1775
+ ]
1769
1776
|
1770
1777
trait order by i
1771
1778
)
@@ -1793,12 +1800,18 @@ private module BlanketImplementation {
1793
1800
Impl impl , Trait trait , string name , int arity , Function f
1794
1801
) {
1795
1802
isCanonicalBlanketImplementation ( impl ) and
1796
- f = impl .( ImplItemNode ) .getASuccessor ( name ) and
1797
1803
blanketImplementationTraitBound ( impl , trait ) and
1798
1804
f .getParamList ( ) .hasSelfParam ( ) and
1799
1805
arity = f .getParamList ( ) .getNumberOfParams ( ) and
1800
1806
// Make this stronger and document
1801
- not trait .( TraitItemNode ) .getASuccessor ( name ) = f
1807
+ (
1808
+ f = impl .( ImplItemNode ) .getAssocItem ( name )
1809
+ or
1810
+ f = impl .( ImplItemNode ) .resolveTraitTy ( ) .getAssocItem ( name ) and
1811
+ not f = impl .( ImplItemNode ) .getAssocItem ( name )
1812
+ ) and
1813
+ not getBlanketImplementationTypeParam ( impl ) .resolveABound ( ) .( TraitItemNode ) .getASuccessor ( name ) =
1814
+ f
1802
1815
}
1803
1816
1804
1817
predicate methodCallMatchesBlanketImpl ( MethodCall mc , Type t , Impl impl , Trait trait , Function f ) {
@@ -1821,13 +1834,6 @@ private module BlanketImplementation {
1821
1834
predicate useUniversalConditions ( ) { none ( ) }
1822
1835
}
1823
1836
1824
- predicate debugSatisfiesConstraintType ( MethodCall mc , Trait trait , TypePath path , Type ty ) {
1825
- SatisfiesConstraint< MethodCall , SatisfiesConstraintInput > :: satisfiesConstraintType ( mc ,
1826
- TTrait ( trait ) , path , ty ) and
1827
- // 521 results
1828
- trait .getName ( ) .getText ( ) = "TryFuture"
1829
- }
1830
-
1831
1837
predicate getBlanketImpl ( MethodCall mc , Type t , Impl impl , Trait trait , Function f ) {
1832
1838
SatisfiesConstraint< MethodCall , SatisfiesConstraintInput > :: satisfiesConstraintType ( mc ,
1833
1839
TTrait ( trait ) , _, _) and
0 commit comments