2018-11-17 04:39:58 -06:00
|
|
|
// #[test] attribute is not allowed on associated functions or methods
|
2018-11-17 05:28:04 -06:00
|
|
|
// reworded error message
|
2018-11-17 04:39:58 -06:00
|
|
|
// 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 {}
|
|
|
|
}
|
2018-11-17 04:39:58 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test() {
|
2018-11-17 05:28:04 -06:00
|
|
|
let _ = A::new();
|
2018-11-17 04:39:58 -06:00
|
|
|
}
|
|
|
|
|
2018-11-17 05:28:04 -06:00
|
|
|
fn main() {}
|