blob: 093c1c231861f1893fb4c0e68d35a21546575ddc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#![feature(type_alias_impl_trait)]
use std::fmt::Debug;
fn main() {}
// test that unused generic parameters are ok
type TwoTys<T, U> = impl Debug;
type TwoLifetimes<'a, 'b> = impl Debug;
type TwoConsts<const X: usize, const Y: usize> = impl Debug;
fn one_ty<T: Debug>(t: T) -> TwoTys<T, T> {
t
//~^ ERROR non-defining opaque type use in defining scope
}
fn one_lifetime<'a>(t: &'a u32) -> TwoLifetimes<'a, 'a> {
t
//~^ ERROR non-defining opaque type use in defining scope
}
fn one_const<const N: usize>(t: *mut [u8; N]) -> TwoConsts<N, N> {
t
//~^ ERROR non-defining opaque type use in defining scope
}
|