rust/tests/ui/test-attrs/test-attr-non-associated-functions.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
393 B
Rust
Raw Normal View History

// compile-flags:--test
struct A {}
impl A {
2018-11-17 11:28:04 +00:00
#[test]
//~^ ERROR the `#[test]` attribute may only be used on a non-associated function
2020-03-17 12:27:56 +00:00
fn new() -> A {
A {}
}
#[test]
//~^ ERROR the `#[test]` attribute may only be used on a non-associated function
2020-03-17 12:27:56 +00:00
fn recovery_witness() -> A {
2018-11-17 11:28:04 +00:00
A {}
}
}
#[test]
fn test() {
2018-11-17 11:28:04 +00:00
let _ = A::new();
}
2018-11-17 11:28:04 +00:00
fn main() {}