rust/tests/ui/traits/next-solver/higher-ranked-dyn-bounds.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
299 B
Rust
Raw Normal View History

2023-12-14 12:11:28 +00:00
//@ compile-flags: -Znext-solver
//@ 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() {}