summaryrefslogtreecommitdiffstats
path: root/src/test/ui/suggestions/suggest-trait-items.rs
blob: 9d42a734260962ef97a0b5bcee150b79ad9e53c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
trait Foo {
    type Type;

    fn foo();
    fn bar();
    fn qux();
}

struct A;

impl Foo for A {
//~^ ERROR not all trait items implemented
    type Typ = ();
    //~^ ERROR type `Typ` is not a member of trait
    //~| HELP there is an associated type with a similar name

    fn fooo() {}
    //~^ ERROR method `fooo` is not a member of trait
    //~| HELP there is an associated function with a similar name

    fn barr() {}
    //~^ ERROR method `barr` is not a member of trait
    //~| HELP there is an associated function with a similar name

    fn quux() {}
    //~^ ERROR method `quux` is not a member of trait
    //~| HELP there is an associated function with a similar name
}
//~^ HELP implement the missing item
//~| HELP implement the missing item
//~| HELP implement the missing item
//~| HELP implement the missing item

trait Bar {
    const Const: i32;
}

struct B;

impl Bar for B {
//~^ ERROR not all trait items implemented
    const Cnst: i32 = 0;
    //~^ ERROR const `Cnst` is not a member of trait
    //~| HELP there is an associated constant with a similar name
}
//~^ HELP implement the missing item

fn main() {}