diff options
author | Florian Diebold <[email protected]> | 2020-07-11 18:12:10 +0100 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2020-07-12 19:20:31 +0100 |
commit | 7e9c4d58f189d4ac3c390a6ea345f2578dd5f661 (patch) | |
tree | 737fafc82905fdda3b52d682ff2ab04bc59b93fa /crates/ra_hir_ty/src/tests | |
parent | 00bda1cafb1086b9669000aed5703f9e6324fbd7 (diff) |
Search more efficiently for int/float impls
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 | } | ||