]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/suggest-trait-items.rs
Rollup merge of #107264 - ferrocene:pa-private-items, r=Mark-Simulacrum
[rust.git] / tests / ui / suggestions / suggest-trait-items.rs
1 trait Foo {
2     type Type;
3
4     fn foo();
5     fn bar();
6     fn qux();
7 }
8
9 struct A;
10
11 impl Foo for A {
12 //~^ ERROR not all trait items implemented
13     type Typ = ();
14     //~^ ERROR type `Typ` is not a member of trait
15     //~| HELP there is an associated type with a similar name
16
17     fn fooo() {}
18     //~^ ERROR method `fooo` is not a member of trait
19     //~| HELP there is an associated function with a similar name
20
21     fn barr() {}
22     //~^ ERROR method `barr` is not a member of trait
23     //~| HELP there is an associated function with a similar name
24
25     fn quux() {}
26     //~^ ERROR method `quux` is not a member of trait
27     //~| HELP there is an associated function with a similar name
28 }
29 //~^ HELP implement the missing item
30 //~| HELP implement the missing item
31 //~| HELP implement the missing item
32 //~| HELP implement the missing item
33
34 trait Bar {
35     const Const: i32;
36 }
37
38 struct B;
39
40 impl Bar for B {
41 //~^ ERROR not all trait items implemented
42     const Cnst: i32 = 0;
43     //~^ ERROR const `Cnst` is not a member of trait
44     //~| HELP there is an associated constant with a similar name
45 }
46 //~^ HELP implement the missing item
47
48 fn main() {}