]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/default-method/rustc_must_implement_one_of_misuse.rs
:arrow_up: rust-analyzer
[rust.git] / src / test / ui / traits / default-method / rustc_must_implement_one_of_misuse.rs
1 #![feature(rustc_attrs)]
2
3 #[rustc_must_implement_one_of(a, b)]
4 //~^ Function not found in this trait
5 //~| Function not found in this trait
6 trait Tr0 {}
7
8 #[rustc_must_implement_one_of(a, b)]
9 //~^ Function not found in this trait
10 trait Tr1 {
11     fn a() {}
12 }
13
14 #[rustc_must_implement_one_of(a)]
15 //~^ the `#[rustc_must_implement_one_of]` attribute must be used with at least 2 args
16 trait Tr2 {
17     fn a() {}
18 }
19
20 #[rustc_must_implement_one_of]
21 //~^ malformed `rustc_must_implement_one_of` attribute input
22 trait Tr3 {}
23
24 #[rustc_must_implement_one_of(A, B)]
25 trait Tr4 {
26     const A: u8 = 1; //~ Not a function
27
28     type B; //~ Not a function
29 }
30
31 #[rustc_must_implement_one_of(a, b)]
32 trait Tr5 {
33     fn a(); //~ This function doesn't have a default implementation
34
35     fn b(); //~ This function doesn't have a default implementation
36 }
37
38 #[rustc_must_implement_one_of(abc, xyz)]
39 //~^ attribute should be applied to a trait
40 fn function() {}
41
42 #[rustc_must_implement_one_of(abc, xyz)]
43 //~^ attribute should be applied to a trait
44 struct Struct {}
45
46 fn main() {}