]> git.proxmox.com Git - rustc.git/blame - src/test/ui/type-alias-impl-trait/not_a_defining_use.rs
New upstream version 1.52.0~beta.3+dfsg1
[rustc.git] / src / test / ui / type-alias-impl-trait / not_a_defining_use.rs
CommitLineData
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
6use std::fmt::Debug;
7
8fn main() {}
9
416331ca 10type Two<T, U> = impl Debug;
9fa01778
XL
11
12fn 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
17fn three<T: Debug, U>(t: T) -> Two<T, U> {
18 (t, 5i8)
19}
20
21trait Bar {
22 type Blub: Debug;
23 const FOO: Self::Blub;
24}
25
26impl Bar for u32 {
27 type Blub = i32;
28 const FOO: i32 = 42;
29}
30
1b1a35ee 31fn four<T: Debug, U: Bar>(t: T) -> Two<T, U> {
9fa01778
XL
32 (t, <U as Bar>::FOO)
33}
34
35fn is_sync<T: Sync>() {}
36
37fn asdfl() {
38 //FIXME(oli-obk): these currently cause cycle errors
39 //is_sync::<Two<i32, u32>>();
40 //is_sync::<Two<i32, *const i32>>();
41}