]> git.lizzy.rs Git - rust.git/blob - src/test/ui/test-attr-non-associated-functions.rs
Auto merge of #62748 - luca-barbieri:optimize-refcell-borrow, r=RalfJung
[rust.git] / src / test / ui / test-attr-non-associated-functions.rs
1 // #[test] attribute is not allowed on associated functions or methods
2 // reworded error message
3 // compile-flags:--test
4
5 struct A {}
6
7 impl A {
8     #[test]
9     fn new() -> A { //~ ERROR `#[test]` attribute is only allowed on non associated functions
10         A {}
11     }
12 }
13
14 #[test]
15 fn test() {
16     let _ = A::new();
17 }
18
19 fn main() {}