aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_ty/src/tests.rs')
-rw-r--r--crates/ra_hir_ty/src/tests.rs15
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]
3497fn method_resolution_impl_ref_before_trait() {
3498 let t = type_at(
3499 r#"
3500//- /main.rs
3501trait Trait { fn foo(self) -> u128; }
3502struct S;
3503impl S { fn foo(&self) -> i8 { 0 } }
3504impl Trait for &S { fn foo(self) -> u128 { 0 } }
3505fn test() { S.foo()<|>; }
3506"#,
3507 );
3508 assert_eq!(t, "i8");
3509}
3510
3511#[test]
3497fn method_resolution_trait_autoderef() { 3512fn method_resolution_trait_autoderef() {
3498 let t = type_at( 3513 let t = type_at(
3499 r#" 3514 r#"