]> git.proxmox.com Git - rustc.git/blame - src/test/ui/type-alias-impl-trait/generic_nondefining_use.rs
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / src / test / ui / type-alias-impl-trait / generic_nondefining_use.rs
CommitLineData
94222f64 1#![feature(type_alias_impl_trait)]
ba9703b0
XL
2
3use std::fmt::Debug;
2c00a5a8 4
8faf50e0 5fn main() {}
3157f602 6
ba9703b0
XL
7type OneTy<T> = impl Debug;
8type OneLifetime<'a> = impl Debug;
9type OneConst<const X: usize> = impl Debug;
48663c56 10
ba9703b0 11// Not defining uses, because they doesn't define *all* possible generics.
a7813a04 12
ba9703b0 13fn concrete_ty() -> OneTy<u32> {
94222f64 14 //~^ ERROR non-defining opaque type use in defining scope
8faf50e0
XL
15 5u32
16}
ba9703b0
XL
17
18fn concrete_lifetime() -> OneLifetime<'static> {
94222f64 19 //~^ ERROR non-defining opaque type use in defining scope
ba9703b0
XL
20 6u32
21}
22
94222f64
XL
23fn concrete_const() -> OneConst<{ 123 }> {
24 //~^ ERROR non-defining opaque type use in defining scope
ba9703b0
XL
25 7u32
26}