]>
Commit | Line | Data |
---|---|---|
a1dfa0c6 XL |
1 | // #[test] attribute is not allowed on associated functions or methods |
2 | // reworded error message | |
3 | // compile-flags:--test | |
94b46f34 | 4 | |
a1dfa0c6 | 5 | struct A {} |
94b46f34 | 6 | |
a1dfa0c6 XL |
7 | impl A { |
8 | #[test] | |
ba9703b0 XL |
9 | fn new() -> A { |
10 | //~^ ERROR `#[test]` attribute is only allowed on non associated functions | |
11 | A {} | |
12 | } | |
13 | #[test] | |
14 | fn recovery_witness() -> A { | |
15 | //~^ ERROR `#[test]` attribute is only allowed on non associated functions | |
a1dfa0c6 | 16 | A {} |
8faf50e0 | 17 | } |
94b46f34 | 18 | } |
0531ce1d | 19 | |
a1dfa0c6 XL |
20 | #[test] |
21 | fn test() { | |
22 | let _ = A::new(); | |
23 | } | |
b7449926 | 24 | |
5bcae85e | 25 | fn main() {} |