mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
18 lines
303 B
Rust
18 lines
303 B
Rust
// compile-flags: -Ztrait-solver=next
|
|
// check-pass
|
|
|
|
trait Trait<'a> {
|
|
type Item: for<'b> Trait2<'b>;
|
|
}
|
|
|
|
trait Trait2<'a> {}
|
|
impl Trait2<'_> for () {}
|
|
|
|
fn needs_trait(_: Box<impl for<'a> Trait<'a> + ?Sized>) {}
|
|
|
|
fn foo(x: Box<dyn for<'a> Trait<'a, Item = ()>>) {
|
|
needs_trait(x);
|
|
}
|
|
|
|
fn main() {}
|