fork/rust

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

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

master
1.3 KiB32 linesraw
1error: lifetime may not live long enough
2  --> $DIR/ex3-both-anon-regions-3.rs:2:5
3   |
4LL | fn foo(z: &mut Vec<(&u8,&u8)>, (x, y): (&u8, &u8)) {
5   |                     -                   - let's call the lifetime of this reference `'1`
6   |                     |
7   |                     let's call the lifetime of this reference `'2`
8LL |     z.push((x,y));
9   |     ^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
10   |
11help: consider introducing a named lifetime parameter
12   |
13LL | fn foo<'a>(z: &mut Vec<(&'a u8,&u8)>, (x, y): (&'a u8, &u8)) {
14   |       ++++               ++                     ++
15
16error: lifetime may not live long enough
17  --> $DIR/ex3-both-anon-regions-3.rs:2:5
18   |
19LL | fn foo(z: &mut Vec<(&u8,&u8)>, (x, y): (&u8, &u8)) {
20   |                         -                    - let's call the lifetime of this reference `'3`
21   |                         |
22   |                         let's call the lifetime of this reference `'4`
23LL |     z.push((x,y));
24   |     ^^^^^^^^^^^^^ argument requires that `'3` must outlive `'4`
25   |
26help: consider introducing a named lifetime parameter
27   |
28LL | fn foo<'a>(z: &mut Vec<(&u8,&'a u8)>, (x, y): (&u8, &'a u8)) {
29   |       ++++                   ++                      ++
30
31error: aborting due to 2 previous errors
32