#![feature(type_alias_impl_trait)] use std::fmt::{Debug, Display}; struct Struct(Option); // Make sure that, in contrast to type aliases without opaque types, // we actually do a wf check for the aliased type. type Foo = (impl Debug, Struct); //~^ ERROR: `T` doesn't implement `std::fmt::Display` fn foo() -> Foo { (Vec::::new(), Struct(None)) } fn main() {}