fork/rust

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

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

1.39.0
1.2 KiB30 linesraw
1error[E0623]: lifetime mismatch
2  --> $DIR/regions-lifetime-bounds-on-fns.rs:8:10
3   |
4LL | fn b<'a, 'b>(x: &mut &'a isize, y: &mut &'b isize) {
5   |                      ---------          --------- these two types are declared with different lifetimes...
6LL |     // Illegal now because there is no `'b:'a` declaration.
7LL |     *x = *y;
8   |          ^^ ...but data from `y` flows into `x` here
9
10error[E0623]: lifetime mismatch
11  --> $DIR/regions-lifetime-bounds-on-fns.rs:14:7
12   |
13LL | fn c<'a,'b>(x: &mut &'a isize, y: &mut &'b isize) {
14   |                     ---------          --------- these two types are declared with different lifetimes...
15...
16LL |     a(x, y);
17   |       ^ ...but data from `y` flows into `x` here
18
19error[E0308]: mismatched types
20  --> $DIR/regions-lifetime-bounds-on-fns.rs:20:43
21   |
22LL |     let _: fn(&mut &isize, &mut &isize) = a;
23   |                                           ^ expected concrete lifetime, found bound lifetime parameter
24   |
25   = note: expected type `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)`
26              found type `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}`
27
28error: aborting due to 3 previous errors
29
30For more information about this error, try `rustc --explain E0308`.