]> git.proxmox.com Git - rustc.git/blame - src/test/ui/type-alias-impl-trait/not_a_defining_use.rs
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / ui / type-alias-impl-trait / not_a_defining_use.rs
CommitLineData
94222f64 1#![feature(type_alias_impl_trait)]
9fa01778
XL
2
3use std::fmt::Debug;
4
5fn main() {}
6
416331ca 7type Two<T, U> = impl Debug;
9fa01778 8
9fa01778
XL
9fn three<T: Debug, U>(t: T) -> Two<T, U> {
10 (t, 5i8)
04454e1e 11 //~^ ERROR `T` doesn't implement `Debug`
9fa01778
XL
12}
13
14trait Bar {
15 type Blub: Debug;
16 const FOO: Self::Blub;
17}
18
19impl Bar for u32 {
20 type Blub = i32;
21 const FOO: i32 = 42;
22}
23
1b1a35ee 24fn 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
30fn is_sync<T: Sync>() {}
31
32fn asdfl() {
33 //FIXME(oli-obk): these currently cause cycle errors
34 //is_sync::<Two<i32, u32>>();
35 //is_sync::<Two<i32, *const i32>>();
36}