]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/generic_duplicate_param_use5.rs
Rollup merge of #106766 - GuillaumeGomez:rm-stripper-dead-code, r=notriddle
[rust.git] / tests / ui / type-alias-impl-trait / generic_duplicate_param_use5.rs
1 #![feature(type_alias_impl_trait)]
2
3 use std::fmt::Debug;
4
5 fn main() {}
6
7 // test that unused generic parameters are ok
8 type Two<T, U> = impl Debug;
9
10 fn two<T: Debug, U: Debug>(t: T, u: U) -> Two<T, U> {
11     (t, u)
12     //~^ ERROR `T` doesn't implement `Debug`
13     //~| ERROR `U` doesn't implement `Debug`
14 }
15
16 fn three<T: Debug, U: Debug>(t: T, u: U) -> Two<T, U> {
17     (u, t)
18     //~^ ERROR `T` doesn't implement `Debug`
19     //~| ERROR `U` doesn't implement `Debug`
20 }