blob: 2b2dd0dbbf2509ed209d24e1cf3963003fab6aed [file] [log] [blame]
Inna Palantff3f07a2019-07-11 16:15:26 -07001error[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;
Jeff Vander Stoep983137f2020-09-16 14:50:30 +020023 | ^ one type is more general than the other
Inna Palantff3f07a2019-07-11 16:15:26 -070024 |
Matthew Maurerf4d8f812020-03-27 13:14:30 -070025 = note: expected fn pointer `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)`
Jeff Vander Stoep983137f2020-09-16 14:50:30 +020026 found fn pointer `for<'r, 's> fn(&'r mut &isize, &'s mut &isize)`
Inna Palantff3f07a2019-07-11 16:15:26 -070027
28error: aborting due to 3 previous errors
29
Matthew Maurerf4d8f812020-03-27 13:14:30 -070030Some errors have detailed explanations: E0308, E0623.
31For more information about an error, try `rustc --explain E0308`.