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