]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/generic_underconstrained2.rs
Auto merge of #106458 - albertlarsan68:move-tests, r=jyn514
[rust.git] / tests / ui / type-alias-impl-trait / generic_underconstrained2.rs
1 #![feature(type_alias_impl_trait)]
2
3 fn main() {}
4
5 type Underconstrained<T: std::fmt::Debug> = impl Send;
6
7 // not a defining use, because it doesn't define *all* possible generics
8 fn underconstrained<U>(_: U) -> Underconstrained<U> {
9     //~^ ERROR `U` doesn't implement `Debug`
10     5u32
11 }
12
13 type Underconstrained2<T: std::fmt::Debug> = impl Send;
14
15 // not a defining use, because it doesn't define *all* possible generics
16 fn underconstrained2<U, V>(_: U, _: V) -> Underconstrained2<V> {
17     //~^ ERROR `V` doesn't implement `Debug`
18     5u32
19 }