]> git.lizzy.rs Git - rust.git/blob - tests/ui/resolve/resolve-assoc-suggestions.rs
Rollup merge of #106692 - eggyal:mv-binary_heap.rs-binary_heap/mod.rs, r=Mark-Simulacrum
[rust.git] / tests / ui / resolve / resolve-assoc-suggestions.rs
1 // Make sure associated items are recommended only in appropriate contexts.
2
3 struct S {
4     field: u8,
5 }
6
7 trait Tr {
8     fn method(&self);
9     type Type;
10 }
11
12 impl Tr for S {
13     type Type = u8;
14
15     fn method(&self) {
16         let _: field;
17         //~^ ERROR cannot find type `field`
18         let field(..);
19         //~^ ERROR cannot find tuple struct or tuple variant `field`
20         field;
21         //~^ ERROR cannot find value `field`
22
23         let _: Type;
24         //~^ ERROR cannot find type `Type`
25         let Type(..);
26         //~^ ERROR cannot find tuple struct or tuple variant `Type`
27         Type;
28         //~^ ERROR cannot find value `Type`
29
30         let _: method;
31         //~^ ERROR cannot find type `method`
32         let method(..);
33         //~^ ERROR cannot find tuple struct or tuple variant `method`
34         method;
35         //~^ ERROR cannot find value `method`
36     }
37 }
38
39 fn main() {}