fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.0 KiB28 linesraw
1error: lifetime may not live long enough
2  --> $DIR/variance-contravariant-arg-object.rs:14:5
3   |
4LL | 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...
9LL |     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
14error: lifetime may not live long enough
15  --> $DIR/variance-contravariant-arg-object.rs:23:5
16   |
17LL | fn get_max_from_min<'min, 'max>(v: Box<dyn Get<&'min i32>>)
18   |                     ----  ---- lifetime `'max` defined here
19   |                     |
20   |                     lifetime `'min` defined here
21...
22LL |     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
27error: aborting due to 2 previous errors
28