]> git.proxmox.com Git - rustc.git/blame - src/test/ui/lint/inline-trait-and-foreign-items.rs
New upstream version 1.51.0+dfsg1
[rustc.git] / src / test / ui / lint / inline-trait-and-foreign-items.rs
CommitLineData
e74abb32
XL
1#![feature(extern_types)]
2#![feature(type_alias_impl_trait)]
3
4#![warn(unused_attributes)]
5
6trait Trait {
7 #[inline] //~ WARN `#[inline]` is ignored on constants
8 //~^ WARN this was previously accepted
9 const X: u32;
10
11 #[inline] //~ ERROR attribute should be applied to function or closure
12 type T;
13
14 type U;
15}
16
17impl Trait for () {
18 #[inline] //~ WARN `#[inline]` is ignored on constants
19 //~^ WARN this was previously accepted
20 const X: u32 = 0;
21
22 #[inline] //~ ERROR attribute should be applied to function or closure
23 type T = Self;
24
25 #[inline] //~ ERROR attribute should be applied to function or closure
26 type U = impl Trait; //~ ERROR could not find defining uses
27}
28
5869c6ff 29extern "C" {
e74abb32
XL
30 #[inline] //~ ERROR attribute should be applied to function or closure
31 static X: u32;
32
33 #[inline] //~ ERROR attribute should be applied to function or closure
34 type T;
35}
36
37fn main() {}