]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.rs
Auto merge of #84267 - dtolnay:ptrunit, r=nagisa
[rust.git] / src / test / ui / type-alias-impl-trait / generic_duplicate_param_use2.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 //~^ ERROR `T` doesn't implement `Debug`
10
11 fn one<T: Debug>(t: T) -> Two<T, T> {
12     //~^ ERROR non-defining opaque type use in defining scope
13     t
14 }
15
16 fn two<T: Debug, U>(t: T, _: U) -> Two<T, U> {
17     t
18 }