]> git.proxmox.com Git - rustc.git/blob - src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-elided.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / impl-trait / multiple-lifetimes / ordinary-bounds-pick-original-elided.rs
1 // edition:2018
2 // build-pass (FIXME(62277): could be check-pass?
3
4 trait Trait<'a, 'b> {}
5 impl<T> Trait<'_, '_> for T {}
6
7 // Test case where we have elision in the impl trait and we have to
8 // pick the right region.
9
10 // Ultimately `Trait<'x, 'static>`.
11 fn upper_bounds1(a: &u8) -> impl Trait<'_, 'static> {
12 (a, a)
13 }
14
15 // Ultimately `Trait<'x, 'x>`, so not really multiple bounds.
16 fn upper_bounds2(a: &u8) -> impl Trait<'_, '_> {
17 (a, a)
18 }
19
20 // Kind of a weird annoying case.
21 fn upper_bounds3<'b>(a: &u8) -> impl Trait<'_, 'b> {
22 (a, a)
23 }
24
25 fn main() {}