File tree Expand file tree Collapse file tree 2 files changed +46
-4
lines changed
rust/ql/test/library-tests/type-inference Expand file tree Collapse file tree 2 files changed +46
-4
lines changed Original file line number Diff line number Diff line change @@ -1670,6 +1670,37 @@ mod async_ {
1670
1670
}
1671
1671
}
1672
1672
1673
+
1674
+ mod impl_trait {
1675
+ struct S1 ;
1676
+
1677
+ trait Trait1 {
1678
+ fn f1 ( & self ) { } // Trait1f1
1679
+ }
1680
+
1681
+ trait Trait2 {
1682
+ fn f2 ( & self ) { } // Trait2f2
1683
+ }
1684
+
1685
+ impl Trait1 for S1 {
1686
+ fn f1 ( & self ) { } // S1f1
1687
+ }
1688
+
1689
+ impl Trait2 for S1 {
1690
+ fn f2 ( & self ) { } // S1f2
1691
+ }
1692
+
1693
+ fn f1 ( ) -> impl Trait1 + Trait2 {
1694
+ S1
1695
+ }
1696
+
1697
+ pub fn f ( ) {
1698
+ let x = f1 ( ) ;
1699
+ x. f1 ( ) ; // $ MISSING: method=Trait1f1
1700
+ x. f2 ( ) ; // $ MISSING: method=Trait2f2
1701
+ }
1702
+ }
1703
+
1673
1704
fn main ( ) {
1674
1705
field_access:: f ( ) ;
1675
1706
method_impl:: f ( ) ;
@@ -1690,4 +1721,5 @@ fn main() {
1690
1721
builtins:: f ( ) ;
1691
1722
operators:: f ( ) ;
1692
1723
async_:: f ( ) ;
1724
+ impl_trait:: f ( ) ;
1693
1725
}
Original file line number Diff line number Diff line change @@ -2393,8 +2393,18 @@ inferType
2393
2393
| main.rs:1662:41:1664:5 | { ... } | | main.rs:1652:5:1652:14 | S2 |
2394
2394
| main.rs:1663:9:1663:10 | S2 | | main.rs:1652:5:1652:14 | S2 |
2395
2395
| main.rs:1667:9:1667:12 | f1(...) | | main.rs:1636:5:1636:14 | S1 |
2396
- | main.rs:1675:5:1675:20 | ...::f(...) | | main.rs:67:5:67:21 | Foo |
2397
- | main.rs:1676:5:1676:60 | ...::g(...) | | main.rs:67:5:67:21 | Foo |
2398
- | main.rs:1676:20:1676:38 | ...::Foo {...} | | main.rs:67:5:67:21 | Foo |
2399
- | main.rs:1676:41:1676:59 | ...::Foo {...} | | main.rs:67:5:67:21 | Foo |
2396
+ | main.rs:1678:15:1678:19 | SelfParam | | file://:0:0:0:0 | & |
2397
+ | main.rs:1678:15:1678:19 | SelfParam | &T | main.rs:1677:5:1679:5 | Self [trait Trait1] |
2398
+ | main.rs:1682:15:1682:19 | SelfParam | | file://:0:0:0:0 | & |
2399
+ | main.rs:1682:15:1682:19 | SelfParam | &T | main.rs:1681:5:1683:5 | Self [trait Trait2] |
2400
+ | main.rs:1686:15:1686:19 | SelfParam | | file://:0:0:0:0 | & |
2401
+ | main.rs:1686:15:1686:19 | SelfParam | &T | main.rs:1675:5:1675:14 | S1 |
2402
+ | main.rs:1690:15:1690:19 | SelfParam | | file://:0:0:0:0 | & |
2403
+ | main.rs:1690:15:1690:19 | SelfParam | &T | main.rs:1675:5:1675:14 | S1 |
2404
+ | main.rs:1693:37:1695:5 | { ... } | | main.rs:1675:5:1675:14 | S1 |
2405
+ | main.rs:1694:9:1694:10 | S1 | | main.rs:1675:5:1675:14 | S1 |
2406
+ | main.rs:1706:5:1706:20 | ...::f(...) | | main.rs:67:5:67:21 | Foo |
2407
+ | main.rs:1707:5:1707:60 | ...::g(...) | | main.rs:67:5:67:21 | Foo |
2408
+ | main.rs:1707:20:1707:38 | ...::Foo {...} | | main.rs:67:5:67:21 | Foo |
2409
+ | main.rs:1707:41:1707:59 | ...::Foo {...} | | main.rs:67:5:67:21 | Foo |
2400
2410
testFailures
You can’t perform that action at this time.
0 commit comments