diff options
Diffstat (limited to 'crates/ra_hir_ty/src/tests')
-rw-r--r-- | crates/ra_hir_ty/src/tests/traits.rs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/crates/ra_hir_ty/src/tests/traits.rs b/crates/ra_hir_ty/src/tests/traits.rs index 85bcd0050..511ed8fe3 100644 --- a/crates/ra_hir_ty/src/tests/traits.rs +++ b/crates/ra_hir_ty/src/tests/traits.rs | |||
@@ -3042,7 +3042,7 @@ fn foo() { | |||
3042 | } | 3042 | } |
3043 | 3043 | ||
3044 | #[test] | 3044 | #[test] |
3045 | fn variable_kinds() { | 3045 | fn variable_kinds_1() { |
3046 | check_types( | 3046 | check_types( |
3047 | r#" | 3047 | r#" |
3048 | trait Trait<T> { fn get(self, t: T) -> T; } | 3048 | trait Trait<T> { fn get(self, t: T) -> T; } |
@@ -3058,3 +3058,20 @@ fn test() { | |||
3058 | "#, | 3058 | "#, |
3059 | ); | 3059 | ); |
3060 | } | 3060 | } |
3061 | |||
3062 | #[test] | ||
3063 | fn variable_kinds_2() { | ||
3064 | check_types( | ||
3065 | r#" | ||
3066 | trait Trait { fn get(self) -> Self; } | ||
3067 | impl Trait for u128 {} | ||
3068 | impl Trait for f32 {} | ||
3069 | fn test() { | ||
3070 | 1.get(); | ||
3071 | //^^^^^^^ u128 | ||
3072 | (1.).get(); | ||
3073 | //^^^^^^^^^^ f32 | ||
3074 | } | ||
3075 | "#, | ||
3076 | ); | ||
3077 | } | ||