mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Refactor a bit
This commit is contained in:
parent
456d52fdfa
commit
cfa50df33e
3 changed files with 74 additions and 77 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue