]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/not_a_defining_use.rs
Auto merge of #106458 - albertlarsan68:move-tests, r=jyn514
[rust.git] / tests / ui / type-alias-impl-trait / not_a_defining_use.rs
1 #![feature(type_alias_impl_trait)]
2
3 use std::fmt::Debug;
4
5 fn main() {}
6
7 type Two<T, U> = impl Debug;
8
9 fn three<T: Debug, U>(t: T) -> Two<T, U> {
10     (t, 5i8)
11     //~^ ERROR `T` doesn't implement `Debug`
12 }
13
14 trait Bar {
15     type Blub: Debug;
16     const FOO: Self::Blub;
17 }
18
19 impl Bar for u32 {
20     type Blub = i32;
21     const FOO: i32 = 42;
22 }
23
24 fn four<T: Debug, U: Bar>(t: T) -> Two<T, U> {
25     (t, <U as Bar>::FOO)
26     //~^ ERROR `U: Bar` is not satisfied
27     //~| ERROR `T` doesn't implement `Debug`
28 }
29
30 fn is_sync<T: Sync>() {}
31
32 fn asdfl() {
33     //FIXME(oli-obk): these currently cause cycle errors
34     //is_sync::<Two<i32, u32>>();
35     //is_sync::<Two<i32, *const i32>>();
36 }