File tree Expand file tree Collapse file tree 2 files changed +677
-640
lines changed
rust/ql/test/library-tests/type-inference Expand file tree Collapse file tree 2 files changed +677
-640
lines changed Original file line number Diff line number Diff line change @@ -1844,8 +1844,10 @@ mod async_ {
1844
1844
}
1845
1845
1846
1846
mod impl_trait {
1847
+ #[ derive( Clone ) ]
1847
1848
struct S1 ;
1848
1849
struct S2 ;
1850
+ struct S3 < T3 > ( T3 ) ;
1849
1851
1850
1852
trait Trait1 {
1851
1853
fn f1 ( & self ) { } // Trait1f1
@@ -1877,10 +1879,21 @@ mod impl_trait {
1877
1879
}
1878
1880
}
1879
1881
1882
+ impl < T : Clone > MyTrait < T > for S3 < T > {
1883
+ fn get_a ( & self ) -> T {
1884
+ let S3 ( t) = self ;
1885
+ t. clone ( )
1886
+ }
1887
+ }
1888
+
1880
1889
fn get_a_my_trait ( ) -> impl MyTrait < S2 > {
1881
1890
S1
1882
1891
}
1883
1892
1893
+ fn get_a_my_trait2 < T : Clone > ( x : T ) -> impl MyTrait < T > {
1894
+ S3 ( x)
1895
+ }
1896
+
1884
1897
fn uses_my_trait1 < A , B : MyTrait < A > > ( t : B ) -> A {
1885
1898
t. get_a ( ) // $ method=MyTrait::get_a
1886
1899
}
@@ -1898,6 +1911,7 @@ mod impl_trait {
1898
1911
let a = get_a_my_trait ( ) ;
1899
1912
let c = uses_my_trait2 ( a) ; // $ type=c:S2
1900
1913
let d = uses_my_trait2 ( S1 ) ; // $ type=d:S2
1914
+ let e = get_a_my_trait2 ( S1 ) . get_a ( ) ; // $ method=MyTrait::get_a $ MISSING: type=e:S1
1901
1915
}
1902
1916
}
1903
1917
You can’t perform that action at this time.
0 commit comments