]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/generic_nondefining_use.rs
Move /src/test to /tests
[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
14 // Not defining uses, because they doesn't define *all* possible generics.
15
16 fn concrete_ty() -> OneTy<u32> {
17     5u32
18     //~^ ERROR non-defining opaque type use in defining scope
19 }
20
21 fn concrete_lifetime() -> OneLifetime<'static> {
22     6u32
23     //~^ ERROR non-defining opaque type use in defining scope
24 }
25
26 fn concrete_const() -> OneConst<{ 123 }> {
27     7u32
28     //~^ ERROR non-defining opaque type use in defining scope
29 }