]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/generic_nondefining_use.rs
Rollup merge of #107332 - chansuke:issue-107230, r=albertlarsan68
[rust.git] / tests / ui / type-alias-impl-trait / generic_nondefining_use.rs
1 #![feature(type_alias_impl_trait)]
2
3 use std::fmt::Debug;
4
5 fn main() {}
6
7 type OneTy<T> = impl Debug;
8
9 type OneLifetime<'a> = impl Debug;
10
11 type OneConst<const X: usize> = impl Debug;
12
13 // Not defining uses, because they doesn't define *all* possible generics.
14
15 fn concrete_ty() -> OneTy<u32> {
16     5u32
17     //~^ ERROR expected generic type parameter, found `u32`
18 }
19
20 fn concrete_lifetime() -> OneLifetime<'static> {
21     6u32
22     //~^ ERROR expected generic lifetime parameter, found `'static`
23 }
24
25 fn concrete_const() -> OneConst<{ 123 }> {
26     7u32
27     //~^ ERROR expected generic constant parameter, found `123`
28 }