blob: 0f21dd5ffe508b532fcdb47531794814a9119a6f (
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
|
// edition:2018
// build-pass (FIXME(62277): could be check-pass?)
trait Trait<'a, 'b> {}
impl<T> Trait<'_, '_> for T {}
// Here we wind up selecting `'a` and `'b` in the hidden type because
// those are the types that appear in the original values.
fn upper_bounds<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a, 'b> {
// In this simple case, you have a hidden type `(&'0 u8, &'1 u8)` and constraints like
//
// ```
// 'a: '0
// 'b: '1
// '0 in ['a, 'b]
// '1 in ['a, 'b]
// ```
//
// We use the fact that `'a: 0'` must hold (combined with the in
// constraint) to determine that `'0 = 'a` must be the answer.
(a, b)
}
fn main() {}
|