summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/next-solver/higher-ranked-dyn-bounds.rs
blob: b87210d7fb390d9c4acb80f5de770cd623bab4d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// 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() {}