]>
Commit | Line | Data |
---|---|---|
ba9703b0 XL |
1 | #![feature(type_alias_impl_trait, const_generics)] |
2 | #![allow(incomplete_features)] | |
0531ce1d | 3 | |
9fa01778 XL |
4 | use std::fmt::Debug; |
5 | ||
5bcae85e | 6 | fn main() {} |
8faf50e0 | 7 | |
9fa01778 | 8 | // test that unused generic parameters are ok |
ba9703b0 XL |
9 | type TwoTys<T, U> = impl Debug; |
10 | type TwoLifetimes<'a, 'b> = impl Debug; | |
11 | type TwoConsts<const X: usize, const Y: usize> = impl Debug; | |
8faf50e0 | 12 | |
ba9703b0 XL |
13 | fn one_ty<T: Debug>(t: T) -> TwoTys<T, T> { |
14 | //~^ ERROR non-defining opaque type use in defining scope | |
15 | t | |
16 | } | |
17 | ||
18 | fn one_lifetime<'a>(t: &'a u32) -> TwoLifetimes<'a, 'a> { | |
19 | //~^ ERROR non-defining opaque type use in defining scope | |
20 | t | |
21 | } | |
22 | ||
23 | fn 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 | } |