]>
Commit | Line | Data |
---|---|---|
dc9dc135 | 1 | // edition:2018 |
416331ca | 2 | // build-pass (FIXME(62277): could be check-pass?) |
dc9dc135 | 3 | |
17df50a5 XL |
4 | trait Trait<'a, 'b> {} |
5 | impl<T> Trait<'_, '_> for T {} | |
dc9dc135 XL |
6 | |
7 | // Here we wind up selecting `'a` and `'b` in the hidden type because | |
8 | // those are the types that appear in the original values. | |
9 | ||
10 | fn upper_bounds<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a, 'b> { | |
11 | // In this simple case, you have a hidden type `(&'0 u8, &'1 u8)` and constraints like | |
12 | // | |
13 | // ``` | |
14 | // 'a: '0 | |
15 | // 'b: '1 | |
16 | // '0 in ['a, 'b] | |
17 | // '1 in ['a, 'b] | |
18 | // ``` | |
19 | // | |
20 | // We use the fact that `'a: 0'` must hold (combined with the in | |
21 | // constraint) to determine that `'0 = 'a` must be the answer. | |
22 | (a, b) | |
23 | } | |
24 | ||
17df50a5 | 25 | fn main() {} |