mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-27 10:17:15 +00:00
feat: Implement arbitrary-self-types
This commit is contained in:
parent
84d44d0a57
commit
f4dfbc38c8
9 changed files with 129 additions and 26 deletions
|
|
@ -1466,4 +1466,34 @@ async fn bar() {
|
|||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn receiver_without_deref_impl_completion() {
|
||||
check_no_kw(
|
||||
r#"
|
||||
//- minicore: receiver
|
||||
use core::ops::Receiver;
|
||||
|
||||
struct Foo;
|
||||
|
||||
impl Foo {
|
||||
fn foo(self: Bar) {}
|
||||
}
|
||||
|
||||
struct Bar;
|
||||
|
||||
impl Receiver for Bar {
|
||||
type Target = Foo;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let bar = Bar;
|
||||
bar.$0
|
||||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
me foo() fn(self: Bar)
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue