diff options
Diffstat (limited to 'crates/ra_hir_ty/src/tests')
-rw-r--r-- | crates/ra_hir_ty/src/tests/traits.rs | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/crates/ra_hir_ty/src/tests/traits.rs b/crates/ra_hir_ty/src/tests/traits.rs index e6f697fa3..bae5eae07 100644 --- a/crates/ra_hir_ty/src/tests/traits.rs +++ b/crates/ra_hir_ty/src/tests/traits.rs | |||
@@ -856,11 +856,11 @@ trait Trait<T> { | |||
856 | fn foo(&self) -> T; | 856 | fn foo(&self) -> T; |
857 | fn foo2(&self) -> i64; | 857 | fn foo2(&self) -> i64; |
858 | } | 858 | } |
859 | fn bar(impl Trait<u64>) {} | 859 | fn bar(x: impl Trait<u16>) {} |
860 | struct S<T>(T); | 860 | struct S<T>(T); |
861 | impl<T> Trait<T> for S<T> {} | 861 | impl<T> Trait<T> for S<T> {} |
862 | 862 | ||
863 | fn test(x: impl Trait<u64>, y: &impl Trait<u64>) { | 863 | fn test(x: impl Trait<u64>, y: &impl Trait<u32>) { |
864 | x; | 864 | x; |
865 | y; | 865 | y; |
866 | let z = S(1); | 866 | let z = S(1); |
@@ -876,27 +876,32 @@ fn test(x: impl Trait<u64>, y: &impl Trait<u64>) { | |||
876 | @r###" | 876 | @r###" |
877 | [30; 34) 'self': &Self | 877 | [30; 34) 'self': &Self |
878 | [55; 59) 'self': &Self | 878 | [55; 59) 'self': &Self |
879 | [99; 101) '{}': () | 879 | [78; 79) 'x': impl Trait<u16> |
880 | [111; 112) 'x': impl Trait<u64> | 880 | [98; 100) '{}': () |
881 | [131; 132) 'y': &impl Trait<u64> | 881 | [155; 156) 'x': impl Trait<u64> |
882 | [152; 269) '{ ...2(); }': () | 882 | [175; 176) 'y': &impl Trait<u32> |
883 | [158; 159) 'x': impl Trait<u64> | 883 | [196; 324) '{ ...2(); }': () |
884 | [165; 166) 'y': &impl Trait<u64> | 884 | [202; 203) 'x': impl Trait<u64> |
885 | [176; 177) 'z': impl Trait<u64> | 885 | [209; 210) 'y': &impl Trait<u32> |
886 | [180; 183) 'bar': fn bar() -> impl Trait<u64> | 886 | [220; 221) 'z': S<u16> |
887 | [180; 185) 'bar()': impl Trait<u64> | 887 | [224; 225) 'S': S<u16>(u16) -> S<u16> |
888 | [191; 192) 'x': impl Trait<u64> | 888 | [224; 228) 'S(1)': S<u16> |
889 | [191; 198) 'x.foo()': u64 | 889 | [226; 227) '1': u16 |
890 | [204; 205) 'y': &impl Trait<u64> | 890 | [234; 237) 'bar': fn bar<S<u16>>(S<u16>) -> () |
891 | [204; 211) 'y.foo()': u64 | 891 | [234; 240) 'bar(z)': () |
892 | [217; 218) 'z': impl Trait<u64> | 892 | [238; 239) 'z': S<u16> |
893 | [217; 224) 'z.foo()': u64 | 893 | [246; 247) 'x': impl Trait<u64> |
894 | [230; 231) 'x': impl Trait<u64> | 894 | [246; 253) 'x.foo()': u64 |
895 | [230; 238) 'x.foo2()': i64 | 895 | [259; 260) 'y': &impl Trait<u32> |
896 | [244; 245) 'y': &impl Trait<u64> | 896 | [259; 266) 'y.foo()': u32 |
897 | [244; 252) 'y.foo2()': i64 | 897 | [272; 273) 'z': S<u16> |
898 | [258; 259) 'z': impl Trait<u64> | 898 | [272; 279) 'z.foo()': u16 |
899 | [258; 266) 'z.foo2()': i64 | 899 | [285; 286) 'x': impl Trait<u64> |
900 | [285; 293) 'x.foo2()': i64 | ||
901 | [299; 300) 'y': &impl Trait<u32> | ||
902 | [299; 307) 'y.foo2()': i64 | ||
903 | [313; 314) 'z': S<u16> | ||
904 | [313; 321) 'z.foo2()': i64 | ||
900 | "### | 905 | "### |
901 | ); | 906 | ); |
902 | } | 907 | } |