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