]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/generic_nondefining_use.rs
Rollup merge of #82259 - osa1:issue82156, r=petrochenkov
[rust.git] / src / test / ui / type-alias-impl-trait / generic_nondefining_use.rs
1 #![feature(type_alias_impl_trait, const_generics)]
2 #![allow(incomplete_features)]
3
4 use std::fmt::Debug;
5
6 fn main() {}
7
8 type OneTy<T> = impl Debug;
9 type OneLifetime<'a> = impl Debug;
10 type OneConst<const X: usize> = impl Debug;
11
12 // Not defining uses, because they doesn't define *all* possible generics.
13
14 fn concrete_ty() -> OneTy<u32> {
15 //~^ ERROR non-defining opaque type use in defining scope
16     5u32
17 }
18
19 fn concrete_lifetime() -> OneLifetime<'static> {
20 //~^ ERROR non-defining opaque type use in defining scope
21     6u32
22 }
23
24 fn concrete_const() -> OneConst<{123}> {
25 //~^ ERROR non-defining opaque type use in defining scope
26     7u32
27 }