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