mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +00:00
Merge #741
741: Test more Self inference r=flodiebold a=kjeremy These cases didn't look covered. Co-authored-by: kjeremy <kjeremy@gmail.com>
This commit is contained in:
commit
77a824c6a0
2 changed files with 13 additions and 3 deletions
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
created: "2019-01-22T14:45:00.052694700+00:00"
|
||||
creator: insta@0.4.0
|
||||
created: "2019-02-04T19:40:48.826936500+00:00"
|
||||
creator: insta@0.5.3
|
||||
expression: "&result"
|
||||
source: "crates\\ra_hir\\src\\ty\\tests.rs"
|
||||
source: crates/ra_hir/src/ty/tests.rs
|
||||
---
|
||||
[34; 38) 'self': &S
|
||||
[40; 61) '{ ... }': ()
|
||||
|
@ -10,4 +10,8 @@ source: "crates\\ra_hir\\src\\ty\\tests.rs"
|
|||
[75; 79) 'self': &S
|
||||
[88; 109) '{ ... }': ()
|
||||
[98; 102) 'self': &S
|
||||
[133; 153) '{ ... }': S
|
||||
[143; 147) 'S {}': S
|
||||
[177; 200) '{ ... }': S
|
||||
[187; 194) 'Self {}': S
|
||||
|
||||
|
|
|
@ -215,6 +215,12 @@ impl S {
|
|||
fn test2(self: &Self) {
|
||||
self;
|
||||
}
|
||||
fn test3() -> Self {
|
||||
S {}
|
||||
}
|
||||
fn test4() -> Self {
|
||||
Self {}
|
||||
}
|
||||
}
|
||||
"#,
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue