fork/rust

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

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

master
2.1 KiB44 linesraw
1error: lifetime may not live long enough
2  --> $DIR/issue-90170-elision-mismatch.rs:3:40
3   |
4LL | pub fn foo(x: &mut Vec<&u8>, y: &u8) { x.push(y); }
5   |                        -        -      ^^^^^^^^^ argument requires that `'1` must outlive `'2`
6   |                        |        |
7   |                        |        let's call the lifetime of this reference `'1`
8   |                        let's call the lifetime of this reference `'2`
9   |
10help: consider introducing a named lifetime parameter
11   |
12LL | pub fn foo<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); }
13   |           ++++              ++          ++
14
15error: lifetime may not live long enough
16  --> $DIR/issue-90170-elision-mismatch.rs:5:44
17   |
18LL | pub fn foo2(x: &mut Vec<&'_ u8>, y: &u8) { x.push(y); }
19   |                         -           -      ^^^^^^^^^ argument requires that `'1` must outlive `'2`
20   |                         |           |
21   |                         |           let's call the lifetime of this reference `'1`
22   |                         let's call the lifetime of this reference `'2`
23   |
24help: consider introducing a named lifetime parameter
25   |
26LL | pub fn foo2<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); }
27   |            ++++              ~~          ++
28
29error: lifetime may not live long enough
30  --> $DIR/issue-90170-elision-mismatch.rs:7:63
31   |
32LL | pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&u8>, y: &u8) { x.push(y); }
33   |                                               -        -      ^^^^^^^^^ argument requires that `'1` must outlive `'2`
34   |                                               |        |
35   |                                               |        let's call the lifetime of this reference `'1`
36   |                                               let's call the lifetime of this reference `'2`
37   |
38help: consider introducing a named lifetime parameter
39   |
40LL | pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); }
41   |                                                ++          ++
42
43error: aborting due to 3 previous errors
44