about summary refs log tree commit diff
path: root/tests/ui/impl-trait/member-constraints/apply_member_constraint-no-req-eq.rs
blob: e9af42b30e9bb28a8334c14f9a1396823c7613f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//@ check-pass
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver

trait Id {
    type This;
}
impl<T> Id for T {
    type This = T;
}

// We have two member constraints here:
//
// - 'unconstrained member ['a, 'static]
// - 'unconstrained member ['static]
//
// Applying the first constraint results in `'unconstrained: 'a`
// while the second then adds `'unconstrained: 'static`. If applying
// member constraints were to require the member region equal to the
// choice region, applying the first constraint first and then the
// second would result in a `'a: 'static` requirement.
fn test<'a>() -> impl Id<This = impl Sized + use<>> + use<'a> {
    &()
}
fn main() {}