]>
Commit | Line | Data |
---|---|---|
94222f64 | 1 | #![feature(type_alias_impl_trait)] |
9fa01778 XL |
2 | |
3 | use std::fmt::Debug; | |
4 | ||
5 | fn main() {} | |
6 | ||
416331ca | 7 | type Two<T, U> = impl Debug; |
9fa01778 | 8 | |
9fa01778 XL |
9 | fn three<T: Debug, U>(t: T) -> Two<T, U> { |
10 | (t, 5i8) | |
04454e1e | 11 | //~^ ERROR `T` doesn't implement `Debug` |
9fa01778 XL |
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 | ||
1b1a35ee | 24 | fn four<T: Debug, U: Bar>(t: T) -> Two<T, U> { |
9fa01778 | 25 | (t, <U as Bar>::FOO) |
04454e1e FG |
26 | //~^ ERROR `U: Bar` is not satisfied |
27 | //~| ERROR `T` doesn't implement `Debug` | |
9fa01778 XL |
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 | } |