]>
Commit | Line | Data |
---|---|---|
6a06907d XL |
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 | |
9fa01778 XL |
5 | |
6 | use std::fmt::Debug; | |
7 | ||
8 | fn main() {} | |
9 | ||
416331ca | 10 | type Two<T, U> = impl Debug; |
9fa01778 XL |
11 | |
12 | fn two<T: Debug>(t: T) -> Two<T, u32> { | |
1b1a35ee | 13 | //~^ ERROR non-defining opaque type use in defining scope |
9fa01778 XL |
14 | (t, 4i8) |
15 | } | |
16 | ||
17 | fn three<T: Debug, U>(t: T) -> Two<T, U> { | |
18 | (t, 5i8) | |
19 | } | |
20 | ||
21 | trait Bar { | |
22 | type Blub: Debug; | |
23 | const FOO: Self::Blub; | |
24 | } | |
25 | ||
26 | impl Bar for u32 { | |
27 | type Blub = i32; | |
28 | const FOO: i32 = 42; | |
29 | } | |
30 | ||
1b1a35ee | 31 | fn four<T: Debug, U: Bar>(t: T) -> Two<T, U> { |
9fa01778 XL |
32 | (t, <U as Bar>::FOO) |
33 | } | |
34 | ||
35 | fn is_sync<T: Sync>() {} | |
36 | ||
37 | fn asdfl() { | |
38 | //FIXME(oli-obk): these currently cause cycle errors | |
39 | //is_sync::<Two<i32, u32>>(); | |
40 | //is_sync::<Two<i32, *const i32>>(); | |
41 | } |