]> git.proxmox.com Git - rustc.git/blame - src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.rs
New upstream version 1.44.1+dfsg1
[rustc.git] / src / test / ui / type-alias-impl-trait / generic_duplicate_param_use.rs
CommitLineData
ba9703b0
XL
1#![feature(type_alias_impl_trait, const_generics)]
2#![allow(incomplete_features)]
0531ce1d 3
9fa01778
XL
4use std::fmt::Debug;
5
5bcae85e 6fn main() {}
8faf50e0 7
9fa01778 8// test that unused generic parameters are ok
ba9703b0
XL
9type TwoTys<T, U> = impl Debug;
10type TwoLifetimes<'a, 'b> = impl Debug;
11type TwoConsts<const X: usize, const Y: usize> = impl Debug;
8faf50e0 12
ba9703b0
XL
13fn one_ty<T: Debug>(t: T) -> TwoTys<T, T> {
14//~^ ERROR non-defining opaque type use in defining scope
15 t
16}
17
18fn one_lifetime<'a>(t: &'a u32) -> TwoLifetimes<'a, 'a> {
19//~^ ERROR non-defining opaque type use in defining scope
20 t
21}
22
23fn one_const<const N: usize>(t: *mut [u8; N]) -> TwoConsts<N, N> {
24//~^ ERROR non-defining opaque type use in defining scope
8faf50e0
XL
25 t
26}