]> git.proxmox.com Git - rustc.git/blame - src/test/ui/issues/issue-78957.rs
New upstream version 1.61.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-78957.rs
CommitLineData
fc512014 1#![deny(unused_attributes)]
fc512014
XL
2
3use std::marker::PhantomData;
4
5pub struct Foo<#[inline] const N: usize>;
6//~^ ERROR attribute should be applied to function or closure
7pub struct Bar<#[cold] const N: usize>;
8//~^ ERROR attribute should be applied to a function
9//~| WARN this was previously accepted
10pub struct Baz<#[repr(C)] const N: usize>;
11//~^ ERROR attribute should be applied to a struct, enum, or union
12//
13pub struct Foo2<#[inline] 'a>(PhantomData<&'a ()>);
14//~^ ERROR attribute should be applied to function or closure
15pub struct Bar2<#[cold] 'a>(PhantomData<&'a ()>);
16//~^ ERROR attribute should be applied to a function
17//~| WARN this was previously accepted
18pub struct Baz2<#[repr(C)] 'a>(PhantomData<&'a ()>);
19//~^ ERROR attribute should be applied to a struct, enum, or union
20//
21pub struct Foo3<#[inline] T>(PhantomData<T>);
22//~^ ERROR attribute should be applied to function or closure
23pub struct Bar3<#[cold] T>(PhantomData<T>);
24//~^ ERROR attribute should be applied to a function
25//~| WARN this was previously accepted
26pub struct Baz3<#[repr(C)] T>(PhantomData<T>);
27//~^ ERROR attribute should be applied to a struct, enum, or union
28
29fn main() {}