]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/generic_nondefining_use.rs
Sync rust-lang/portable-simd@5f49d4c8435a25d804b2f375e949cb25479f5be9
[rust.git] / src / test / 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 //~^ ERROR could not find defining uses
9 type OneLifetime<'a> = impl Debug;
10 //~^ ERROR could not find defining uses
11 type OneConst<const X: usize> = impl Debug;
12 //~^ ERROR could not find defining uses
13
14 // Not defining uses, because they doesn't define *all* possible generics.
15
16 fn concrete_ty() -> OneTy<u32> {
17     //~^ ERROR non-defining opaque type use in defining scope
18     5u32
19 }
20
21 fn concrete_lifetime() -> OneLifetime<'static> {
22     //~^ ERROR non-defining opaque type use in defining scope
23     6u32
24 }
25
26 fn concrete_const() -> OneConst<{ 123 }> {
27     //~^ ERROR non-defining opaque type use in defining scope
28     7u32
29 }