]> git.lizzy.rs Git - rust.git/blob - src/test/ui/variance/variance-contravariant-arg-object.nll.stderr
3315eaaf1c006e9788e0914c9435d183d3a8ee2f
[rust.git] / src / test / ui / variance / variance-contravariant-arg-object.nll.stderr
1 error: lifetime may not live long enough
2   --> $DIR/variance-contravariant-arg-object.rs:14:5
3    |
4 LL | fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
5    |                     ----  ---- lifetime `'max` defined here
6    |                     |
7    |                     lifetime `'min` defined here
8 ...
9 LL |     v
10    |     ^ function was supposed to return data with lifetime `'max` but it is returning data with lifetime `'min`
11    |
12    = help: consider adding the following bound: `'min: 'max`
13
14 error: lifetime may not live long enough
15   --> $DIR/variance-contravariant-arg-object.rs:22:5
16    |
17 LL | fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
18    |                     ----  ---- lifetime `'max` defined here
19    |                     |
20    |                     lifetime `'min` defined here
21 ...
22 LL |     v
23    |     ^ function was supposed to return data with lifetime `'max` but it is returning data with lifetime `'min`
24    |
25    = help: consider adding the following bound: `'min: 'max`
26
27 error: aborting due to 2 previous errors
28