|
1 | 1 | error[E0623]: lifetime mismatch
|
2 |
| - --> $DIR/issue-90170-elision-mismatch.rs:3:43 |
| 2 | + --> $DIR/issue-90170-elision-mismatch.rs:3:47 |
3 | 3 | |
|
4 |
| -LL | fn foo(x: &mut Vec<&u8>, y: &u8) { x.push(y); } |
5 |
| - | --- --- ^ ...but data from `y` flows into `x` here |
6 |
| - | | |
7 |
| - | these two types are declared with different lifetimes... |
| 4 | +LL | pub fn foo(x: &mut Vec<&u8>, y: &u8) { x.push(y); } |
| 5 | + | --- --- ^ ...but data from `y` flows into `x` here |
| 6 | + | | |
| 7 | + | these two types are declared with different lifetimes... |
8 | 8 | |
|
9 | 9 | = note: each elided lifetime in input position becomes a distinct lifetime
|
10 | 10 | help: consider introducing a named lifetime parameter
|
11 | 11 | |
|
12 |
| -LL | fn foo<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } |
13 |
| - | ++++ ++ ++ |
| 12 | +LL | pub fn foo<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } |
| 13 | + | ++++ ++ ++ |
14 | 14 |
|
15 | 15 | error[E0623]: lifetime mismatch
|
16 |
| - --> $DIR/issue-90170-elision-mismatch.rs:5:47 |
| 16 | + --> $DIR/issue-90170-elision-mismatch.rs:5:51 |
17 | 17 | |
|
18 |
| -LL | fn foo2(x: &mut Vec<&'_ u8>, y: &u8) { x.push(y); } |
19 |
| - | ------ --- ^ ...but data from `y` flows into `x` here |
20 |
| - | | |
21 |
| - | these two types are declared with different lifetimes... |
| 18 | +LL | pub fn foo2(x: &mut Vec<&'_ u8>, y: &u8) { x.push(y); } |
| 19 | + | ------ --- ^ ...but data from `y` flows into `x` here |
| 20 | + | | |
| 21 | + | these two types are declared with different lifetimes... |
22 | 22 | |
|
23 | 23 | = note: each elided lifetime in input position becomes a distinct lifetime
|
24 | 24 | help: consider introducing a named lifetime parameter
|
25 | 25 | |
|
26 |
| -LL | fn foo2<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } |
27 |
| - | ++++ ~~ ++ |
| 26 | +LL | pub fn foo2<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } |
| 27 | + | ++++ ~~ ++ |
28 | 28 |
|
29 | 29 | error[E0623]: lifetime mismatch
|
30 |
| - --> $DIR/issue-90170-elision-mismatch.rs:7:66 |
| 30 | + --> $DIR/issue-90170-elision-mismatch.rs:7:70 |
31 | 31 | |
|
32 |
| -LL | fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&u8>, y: &u8) { x.push(y); } |
33 |
| - | --- --- ^ ...but data from `y` flows into `x` here |
34 |
| - | | |
35 |
| - | these two types are declared with different lifetimes... |
| 32 | +LL | pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&u8>, y: &u8) { x.push(y); } |
| 33 | + | --- --- ^ ...but data from `y` flows into `x` here |
| 34 | + | | |
| 35 | + | these two types are declared with different lifetimes... |
36 | 36 | |
|
37 | 37 | = note: each elided lifetime in input position becomes a distinct lifetime
|
38 | 38 | help: consider introducing a named lifetime parameter
|
39 | 39 | |
|
40 |
| -LL | fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } |
41 |
| - | ++ ++ |
42 |
| - |
43 |
| -error[E0308]: mismatched types |
44 |
| - --> $DIR/issue-90170-elision-mismatch.rs:16:9 |
45 |
| - | |
46 |
| -LL | foo(&mut a, &mut b); |
47 |
| - | ^^^^^^ expected struct `Vec`, found array `[u8; 3]` |
48 |
| - | |
49 |
| - = note: expected mutable reference `&mut Vec<&u8>` |
50 |
| - found mutable reference `&mut [u8; 3]` |
51 |
| - |
52 |
| -error[E0308]: mismatched types |
53 |
| - --> $DIR/issue-90170-elision-mismatch.rs:16:17 |
54 |
| - | |
55 |
| -LL | foo(&mut a, &mut b); |
56 |
| - | ^^^^^^ expected `u8`, found array `[u8; 3]` |
57 |
| - | |
58 |
| - = note: expected reference `&u8` |
59 |
| - found mutable reference `&mut [u8; 3]` |
| 40 | +LL | pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } |
| 41 | + | ++ ++ |
60 | 42 |
|
61 |
| -error: aborting due to 5 previous errors |
| 43 | +error: aborting due to 3 previous errors |
62 | 44 |
|
63 |
| -Some errors have detailed explanations: E0308, E0623. |
64 |
| -For more information about an error, try `rustc --explain E0308`. |
| 45 | +For more information about this error, try `rustc --explain E0623`. |
0 commit comments