summaryrefslogtreecommitdiffstats
path: root/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.rs
blob: 3bd1dda63314ab854bb1f0e2636661206ed9de3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#![feature(type_alias_impl_trait)]

use std::fmt::Debug;

fn main() {}

// test that unused generic parameters are ok
type Two<T, U> = impl Debug;

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

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