summaryrefslogtreecommitdiffstats
path: root/tests/ui/type-alias-impl-trait/generic_duplicate_param_use9.rs
blob: 6afcdfe4d1c3dea32ae19899edca25c19aa1ae71 (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
#![feature(type_alias_impl_trait)]

use std::fmt::Debug;

fn main() {}

type Two<A, B> = impl Debug;

trait Foo {
    type Bar: Debug;
    const BAR: Self::Bar;
}

fn two<T: Debug + Foo, U: Debug>(t: T, u: U) -> Two<T, U> {
    (t, u, T::BAR)
    //~^ ERROR the trait bound `A: Foo` is not satisfied
    //~| ERROR `A` doesn't implement `Debug`
    //~| ERROR `B` doesn't implement `Debug`
}

fn three<T: Debug, U: Debug>(t: T, u: U) -> Two<T, U> {
    (t, u, 42)
    //~^ ERROR `A` doesn't implement `Debug`
    //~| ERROR `B` doesn't implement `Debug`
}