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