diff options
Diffstat (limited to 'crates/ra_hir_ty/src/tests.rs')
-rw-r--r-- | crates/ra_hir_ty/src/tests.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/tests.rs b/crates/ra_hir_ty/src/tests.rs index be8768c62..d28e835c7 100644 --- a/crates/ra_hir_ty/src/tests.rs +++ b/crates/ra_hir_ty/src/tests.rs | |||
@@ -3494,6 +3494,21 @@ fn test() { S.foo()<|>; } | |||
3494 | } | 3494 | } |
3495 | 3495 | ||
3496 | #[test] | 3496 | #[test] |
3497 | fn method_resolution_impl_ref_before_trait() { | ||
3498 | let t = type_at( | ||
3499 | r#" | ||
3500 | //- /main.rs | ||
3501 | trait Trait { fn foo(self) -> u128; } | ||
3502 | struct S; | ||
3503 | impl S { fn foo(&self) -> i8 { 0 } } | ||
3504 | impl Trait for &S { fn foo(self) -> u128 { 0 } } | ||
3505 | fn test() { S.foo()<|>; } | ||
3506 | "#, | ||
3507 | ); | ||
3508 | assert_eq!(t, "i8"); | ||
3509 | } | ||
3510 | |||
3511 | #[test] | ||
3497 | fn method_resolution_trait_autoderef() { | 3512 | fn method_resolution_trait_autoderef() { |
3498 | let t = type_at( | 3513 | let t = type_at( |
3499 | r#" | 3514 | r#" |