mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 05:38:46 +00:00
Test more Self inference
This commit is contained in:
parent
88702a758f
commit
5227102c12
2 changed files with 13 additions and 3 deletions
|
@ -1,8 +1,8 @@
|
||||||
---
|
---
|
||||||
created: "2019-01-22T14:45:00.052694700+00:00"
|
created: "2019-02-04T19:40:48.826936500+00:00"
|
||||||
creator: insta@0.4.0
|
creator: insta@0.5.3
|
||||||
expression: "&result"
|
expression: "&result"
|
||||||
source: "crates\\ra_hir\\src\\ty\\tests.rs"
|
source: crates/ra_hir/src/ty/tests.rs
|
||||||
---
|
---
|
||||||
[34; 38) 'self': &S
|
[34; 38) 'self': &S
|
||||||
[40; 61) '{ ... }': ()
|
[40; 61) '{ ... }': ()
|
||||||
|
@ -10,4 +10,8 @@ source: "crates\\ra_hir\\src\\ty\\tests.rs"
|
||||||
[75; 79) 'self': &S
|
[75; 79) 'self': &S
|
||||||
[88; 109) '{ ... }': ()
|
[88; 109) '{ ... }': ()
|
||||||
[98; 102) 'self': &S
|
[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) {
|
fn test2(self: &Self) {
|
||||||
self;
|
self;
|
||||||
}
|
}
|
||||||
|
fn test3() -> Self {
|
||||||
|
S {}
|
||||||
|
}
|
||||||
|
fn test4() -> Self {
|
||||||
|
Self {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
"#,
|
"#,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue