]> git.lizzy.rs Git - rust.git/blob - src/test/ui/span/impl-wrong-item-for-trait.rs
Rollup merge of #87922 - Manishearth:c-enum-target-spec, r=nagisa,eddyb
[rust.git] / src / test / ui / span / impl-wrong-item-for-trait.rs
1 use std::fmt::Debug;
2
3 trait Foo {
4     fn bar(&self);
5     const MY_CONST: u32;
6 }
7
8 pub struct FooConstForMethod;
9
10 impl Foo for FooConstForMethod {
11     //~^ ERROR E0046
12     const bar: u64 = 1;
13     //~^ ERROR E0323
14     const MY_CONST: u32 = 1;
15 }
16
17 pub struct FooMethodForConst;
18
19 impl Foo for FooMethodForConst {
20     //~^ ERROR E0046
21     fn bar(&self) {}
22     fn MY_CONST() {}
23     //~^ ERROR E0324
24 }
25
26 pub struct FooTypeForMethod;
27
28 impl Foo for FooTypeForMethod {
29     //~^ ERROR E0046
30     type bar = u64;
31     //~^ ERROR E0325
32     //~| ERROR E0437
33     const MY_CONST: u32 = 1;
34 }
35
36 impl Debug for FooTypeForMethod {
37 }
38 //~^^ ERROR E0046
39
40 fn main () {}