#![feature(type_alias_impl_trait)] use std::fmt::Debug; fn main() {} // test that unused generic parameters are ok type TwoTys = impl Debug; pub trait Captures<'a> {} impl<'a, T: ?Sized> Captures<'a> for T {} type TwoLifetimes<'a, 'b> = impl Debug + Captures<'a> + Captures<'b>; type TwoConsts = impl Debug; fn one_ty(t: T) -> TwoTys { 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(t: *mut [u8; N]) -> TwoConsts { t //~^ ERROR non-defining opaque type use in defining scope }