]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lint/inline-trait-and-foreign-items.rs
Rollup merge of #87180 - notriddle:notriddle/sidebar-keyboard-mobile, r=GuillaumeGomez
[rust.git] / src / test / ui / lint / inline-trait-and-foreign-items.rs
1 #![feature(extern_types)]
2 // revisions: min_tait full_tait
3 #![feature(min_type_alias_impl_trait)]
4 #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
5 //[full_tait]~^ WARN incomplete
6
7 #![warn(unused_attributes)]
8
9 trait Trait {
10     #[inline] //~ WARN `#[inline]` is ignored on constants
11     //~^ WARN this was previously accepted
12     const X: u32;
13
14     #[inline] //~ ERROR attribute should be applied to function or closure
15     type T;
16
17     type U;
18 }
19
20 impl Trait for () {
21     #[inline] //~ WARN `#[inline]` is ignored on constants
22     //~^ WARN this was previously accepted
23     const X: u32 = 0;
24
25     #[inline] //~ ERROR attribute should be applied to function or closure
26     type T = Self;
27
28     #[inline] //~ ERROR attribute should be applied to function or closure
29     type U = impl Trait; //~ ERROR could not find defining uses
30 }
31
32 extern "C" {
33     #[inline] //~ ERROR attribute should be applied to function or closure
34     static X: u32;
35
36     #[inline] //~ ERROR attribute should be applied to function or closure
37     type T;
38 }
39
40 fn main() {}