Refactor a bit

This commit is contained in:
Florian Diebold 2019-12-02 18:12:49 +01:00
parent 456d52fdfa
commit cfa50df33e
3 changed files with 74 additions and 77 deletions

View file

@ -3493,6 +3493,21 @@ fn test() { S.foo()<|>; }
assert_eq!(t, "i8");
}
#[test]
fn method_resolution_impl_ref_before_trait() {
let t = type_at(
r#"
//- /main.rs
trait Trait { fn foo(self) -> u128; }
struct S;
impl S { fn foo(&self) -> i8 { 0 } }
impl Trait for &S { fn foo(self) -> u128 { 0 } }
fn test() { S.foo()<|>; }
"#,
);
assert_eq!(t, "i8");
}
#[test]
fn method_resolution_trait_autoderef() {
let t = type_at(