summaryrefslogtreecommitdiffstats
path: root/src/test/ui/error-codes/E0790.rs
blob: d99006d2df734964e081bd98a39b809262bdcf71 (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
49
50
51
52
53
mod inner {
    pub trait MyTrait {
        const MY_ASSOC_CONST: ();

        fn my_fn();
    }

    pub struct MyStruct;

    impl MyTrait for MyStruct {
        const MY_ASSOC_CONST: () = ();

        fn my_fn() {}
    }

    fn call() {
        MyTrait::my_fn(); //~ ERROR E0790
    }

    fn use_const() {
        let _ = MyTrait::MY_ASSOC_CONST; //~ ERROR E0790
    }
}

fn call_inner() {
    inner::MyTrait::my_fn(); //~ ERROR E0790
}

fn use_const_inner() {
    let _ = inner::MyTrait::MY_ASSOC_CONST; //~ ERROR E0790
}

trait MyTrait2 {
    fn my_fn();
}

struct Impl1;

impl MyTrait2 for Impl1 {
    fn my_fn() {}
}

struct Impl2;

impl MyTrait2 for Impl2 {
    fn my_fn() {}
}

fn call_multiple_impls() {
    MyTrait2::my_fn(); //~ ERROR E0790
}

fn main() {}