summaryrefslogtreecommitdiffstats
path: root/tests/ui/test-attrs/test-attr-non-associated-functions.rs
blob: 2481919b616eda82d7d29752a681b0b8f8d8f22e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// compile-flags:--test

struct A {}

impl A {
    #[test]
    //~^ ERROR the `#[test]` attribute may only be used on a non-associated function
    fn new() -> A {
        A {}
    }
    #[test]
    //~^ ERROR the `#[test]` attribute may only be used on a non-associated function
    fn recovery_witness() -> A {
        A {}
    }
}

#[test]
fn test() {
    let _ = A::new();
}

fn main() {}