}
hir::ItemKind::Existential(..) => {
let def_id = tcx.hir().local_def_id(it.id);
- let pty_ty = tcx.type_of(def_id);
- let generics = tcx.generics_of(def_id);
- check_bounds_are_used(tcx, &generics, pty_ty);
let substs = Substs::identity_for_item(tcx, def_id);
check_opaque(tcx, def_id, substs, it.span);
}
+// compile-pass
#![feature(existential_type)]
fn main() {}
-existential type Two<T, U>: 'static; //~ ERROR type parameter `U` is unused
+// test that unused generic parameters are ok
+existential type Two<T, U>: 'static;
fn one<T: 'static>(t: T) -> Two<T, T> {
t
+// compile-pass
#![feature(existential_type)]
fn main() {
}
-existential type PartiallyDefined<T>: 'static; //~ `T` is unused
+// test that unused generic parameters are ok
+existential type PartiallyDefined<T>: 'static;
fn partially_defined<T: std::fmt::Debug>(_: T) -> PartiallyDefined<T> {
4u32
}
-existential type PartiallyDefined2<T>: 'static; //~ `T` is unused
+// test that unused generic parameters are ok
+existential type PartiallyDefined2<T>: 'static;
fn partially_defined2<T: std::fmt::Debug>(_: T) -> PartiallyDefined2<T> {
4u32