]> git.proxmox.com Git - rustc.git/blame - src/test/ui/test-attrs/test-attr-non-associated-functions.rs
New upstream version 1.44.1+dfsg1
[rustc.git] / src / test / ui / test-attrs / test-attr-non-associated-functions.rs
CommitLineData
a1dfa0c6
XL
1// #[test] attribute is not allowed on associated functions or methods
2// reworded error message
3// compile-flags:--test
94b46f34 4
a1dfa0c6 5struct A {}
94b46f34 6
a1dfa0c6
XL
7impl 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]
21fn test() {
22 let _ = A::new();
23}
b7449926 24
5bcae85e 25fn main() {}