File tree 3 files changed +18
-10
lines changed
3 files changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -579,9 +579,21 @@ private class BlockExprItemNode extends ItemNode instanceof BlockExpr {
579
579
}
580
580
581
581
private class TypeParamItemNode extends ItemNode instanceof TypeParam {
582
+ private WherePred getAWherePred ( ) {
583
+ exists ( ItemNode declaringItem |
584
+ this = resolveTypeParamPathTypeRepr ( result .getTypeRepr ( ) ) and
585
+ result = declaringItem .getADescendant ( ) and
586
+ this = declaringItem .getADescendant ( )
587
+ )
588
+ }
589
+
582
590
pragma [ nomagic]
583
591
Path getABoundPath ( ) {
584
- result = super .getTypeBoundList ( ) .getABound ( ) .getTypeRepr ( ) .( PathTypeRepr ) .getPath ( )
592
+ exists ( TypeBoundList tbl | result = tbl .getABound ( ) .getTypeRepr ( ) .( PathTypeRepr ) .getPath ( ) |
593
+ tbl = super .getTypeBoundList ( )
594
+ or
595
+ tbl = this .getAWherePred ( ) .getTypeBoundList ( )
596
+ )
585
597
}
586
598
587
599
pragma [ nomagic]
@@ -602,11 +614,7 @@ private class TypeParamItemNode extends ItemNode instanceof TypeParam {
602
614
predicate hasTraitBound ( ) {
603
615
exists ( this .getABoundPath ( ) )
604
616
or
605
- exists ( ItemNode declaringItem , WherePred wp |
606
- this = resolveTypeParamPathTypeRepr ( wp .getTypeRepr ( ) ) and
607
- wp = declaringItem .getADescendant ( ) and
608
- this = declaringItem .getADescendant ( )
609
- )
617
+ exists ( this .getAWherePred ( ) )
610
618
}
611
619
612
620
/**
Original file line number Diff line number Diff line change @@ -568,7 +568,7 @@ mod m24 {
568
568
T : TraitA // $ item=I111 item=I1151
569
569
{
570
570
fn call_trait_a ( & self ) {
571
- self . data . trait_a_method ( ) ; // $ MISSING: item=I110
571
+ self . data . trait_a_method ( ) ; // $ item=I110
572
572
} // I116
573
573
}
574
574
@@ -580,8 +580,8 @@ mod m24 {
580
580
T : TraitA , // $ item=I111 item=I1161
581
581
{
582
582
fn call_both ( & self ) {
583
- self . data . trait_a_method ( ) ; // $ MISSING: item=I110
584
- self . data . trait_b_method ( ) ; // $ MISSING: item=I112
583
+ self . data . trait_a_method ( ) ; // $ item=I110
584
+ self . data . trait_b_method ( ) ; // $ item=I112
585
585
} // I117
586
586
}
587
587
Original file line number Diff line number Diff line change @@ -623,7 +623,7 @@ mod function_trait_bounds_2 {
623
623
where
624
624
T1 : Into < T2 > ,
625
625
{
626
- x. into ( )
626
+ x. into ( ) // $ method=into
627
627
}
628
628
629
629
pub fn f ( ) {
You can’t perform that action at this time.
0 commit comments