summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/non_lifetime_binders/disqualifying-object-candidates.rs
blob: b999f251d333eab4f87657211b21f4801302af1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// check-pass

trait Foo {
    type Bar<T>
    where
        dyn Send + 'static: Send;
}

impl Foo for () {
    type Bar<T> = i32;
    // We take `<() as Foo>::Bar<T>: Sized` and normalize it under the where clause
    // of `for<S> <() as Foo>::Bar<S> = i32`. This gives us back `i32: Send` with
    // the nested obligation `(dyn Send + 'static): Send`. However, during candidate
    // assembly for object types, we disqualify any obligations that has non-region
    // late-bound vars in the param env(!), rather than just the predicate. This causes
    // the where clause to not hold even though it trivially should.
}

fn main() {}