]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lint/lint-ctypes-73249-2.rs
Rollup merge of #87180 - notriddle:notriddle/sidebar-keyboard-mobile, r=GuillaumeGomez
[rust.git] / src / test / ui / lint / lint-ctypes-73249-2.rs
1 // revisions: min_tait full_tait
2 #![feature(min_type_alias_impl_trait)]
3 #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
4 //[full_tait]~^ WARN incomplete
5 #![deny(improper_ctypes)]
6
7 pub trait Baz { }
8
9 impl Baz for () { }
10
11 type Qux = impl Baz;
12
13 fn assign() -> Qux {}
14
15 pub trait Foo {
16     type Assoc: 'static;
17 }
18
19 impl Foo for () {
20     type Assoc = Qux;
21 }
22
23 #[repr(transparent)]
24 pub struct A<T: Foo> {
25     x: &'static <T as Foo>::Assoc,
26 }
27
28 extern "C" {
29     pub fn lint_me() -> A<()>; //~ ERROR: uses type `impl Baz`
30 }
31
32 fn main() {}