summaryrefslogtreecommitdiffstats
path: root/src/test/ui/type-alias-impl-trait/not_a_defining_use.rs
blob: fa47d13f5164cc0784495054f2534e5a97022c0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#![feature(type_alias_impl_trait)]

use std::fmt::Debug;

fn main() {}

type Two<T, U> = impl Debug;

fn three<T: Debug, U>(t: T) -> Two<T, U> {
    (t, 5i8)
    //~^ ERROR `T` doesn't implement `Debug`
}

trait Bar {
    type Blub: Debug;
    const FOO: Self::Blub;
}

impl Bar for u32 {
    type Blub = i32;
    const FOO: i32 = 42;
}

fn four<T: Debug, U: Bar>(t: T) -> Two<T, U> {
    (t, <U as Bar>::FOO)
    //~^ ERROR `U: Bar` is not satisfied
    //~| ERROR `T` doesn't implement `Debug`
}

fn is_sync<T: Sync>() {}

fn asdfl() {
    //FIXME(oli-obk): these currently cause cycle errors
    //is_sync::<Two<i32, u32>>();
    //is_sync::<Two<i32, *const i32>>();
}