]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.rs
Auto merge of #95454 - randomicon00:fix95444, r=wesleywiser
[rust.git] / src / test / ui / type-alias-impl-trait / generic_duplicate_param_use9.rs
1 #![feature(type_alias_impl_trait)]
2
3 use std::fmt::Debug;
4
5 fn main() {}
6
7 type Two<A, B> = impl Debug;
8 //~^ ERROR the trait bound `A: Foo` is not satisfied
9 //~| ERROR `A` doesn't implement `Debug`
10 //~| ERROR `B` doesn't implement `Debug`
11
12 trait Foo {
13     type Bar: Debug;
14     const BAR: Self::Bar;
15 }
16
17 fn two<T: Debug + Foo, U: Debug>(t: T, u: U) -> Two<T, U> {
18     (t, u, T::BAR)
19 }
20
21 fn three<T: Debug, U: Debug>(t: T, u: U) -> Two<T, U> {
22     (t, u, 42) //~ ERROR concrete type differs from previous
23 }