rust/src/test/ui/test-attr-non-associated-functions.rs

20 lines
328 B
Rust
Raw Normal View History

// #[test] attribute is not allowed on associated functions or methods
2018-11-17 05:28:04 -06:00
// reworded error message
// compile-flags:--test
struct A {}
impl A {
2018-11-17 05:28:04 -06:00
#[test]
fn new() -> A { //~ ERROR #[test] attribute is only allowed on non associated functions
A {}
}
}
#[test]
fn test() {
2018-11-17 05:28:04 -06:00
let _ = A::new();
}
2018-11-17 05:28:04 -06:00
fn main() {}