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]
|
2020-03-17 07:27:56 -05:00
|
|
|
fn new() -> A {
|
|
|
|
//~^ ERROR `#[test]` attribute is only allowed on non associated functions
|
|
|
|
A {}
|
|
|
|
}
|
|
|
|
#[test]
|
|
|
|
fn recovery_witness() -> A {
|
|
|
|
//~^ ERROR `#[test]` attribute is only allowed on non associated functions
|
2018-11-17 05:28:04 -06:00
|
|
|
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() {}
|