]> git.proxmox.com Git - rustc.git/blob - src/test/ui/resolve/resolve-speculative-adjustment.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / resolve / resolve-speculative-adjustment.rs
1 // Make sure speculative path resolution works properly when resolution
2 // adjustment happens and no extra errors is reported.
3
4 struct S {
5 field: u8,
6 }
7
8 trait Tr {
9 fn method(&self);
10 }
11
12 impl Tr for S {
13 fn method(&self) {
14 fn g() {
15 // Speculative resolution of `Self` and `self` silently fails,
16 // "did you mean" messages are not printed.
17 field;
18 //~^ ERROR cannot find value `field`
19 method();
20 //~^ ERROR cannot find function `method`
21 }
22
23 field;
24 //~^ ERROR cannot find value `field`
25 method();
26 //~^ ERROR cannot find function `method`
27 }
28 }
29
30 fn main() {}