]>
Commit | Line | Data |
---|---|---|
fc512014 | 1 | #![deny(unused_attributes)] |
fc512014 XL |
2 | |
3 | use std::marker::PhantomData; | |
4 | ||
5 | pub struct Foo<#[inline] const N: usize>; | |
6 | //~^ ERROR attribute should be applied to function or closure | |
7 | pub struct Bar<#[cold] const N: usize>; | |
8 | //~^ ERROR attribute should be applied to a function | |
9 | //~| WARN this was previously accepted | |
10 | pub struct Baz<#[repr(C)] const N: usize>; | |
11 | //~^ ERROR attribute should be applied to a struct, enum, or union | |
12 | // | |
13 | pub struct Foo2<#[inline] 'a>(PhantomData<&'a ()>); | |
14 | //~^ ERROR attribute should be applied to function or closure | |
15 | pub struct Bar2<#[cold] 'a>(PhantomData<&'a ()>); | |
16 | //~^ ERROR attribute should be applied to a function | |
17 | //~| WARN this was previously accepted | |
18 | pub struct Baz2<#[repr(C)] 'a>(PhantomData<&'a ()>); | |
19 | //~^ ERROR attribute should be applied to a struct, enum, or union | |
20 | // | |
21 | pub struct Foo3<#[inline] T>(PhantomData<T>); | |
22 | //~^ ERROR attribute should be applied to function or closure | |
23 | pub struct Bar3<#[cold] T>(PhantomData<T>); | |
24 | //~^ ERROR attribute should be applied to a function | |
25 | //~| WARN this was previously accepted | |
26 | pub struct Baz3<#[repr(C)] T>(PhantomData<T>); | |
27 | //~^ ERROR attribute should be applied to a struct, enum, or union | |
28 | ||
29 | fn main() {} |