| // ignore-compare-mode-nll |
| //[nll] compile-flags: -Z borrowck=mir |
| fn a<'a, 'b>(x: &mut &'a isize, y: &mut &'b isize) where 'b: 'a { |
| // Note: this is legal because of the `'b:'a` declaration. |
| fn b<'a, 'b>(x: &mut &'a isize, y: &mut &'b isize) { |
| // Illegal now because there is no `'b:'a` declaration. |
| //[nll]~^^ ERROR lifetime may not live long enough |
| fn c<'a,'b>(x: &mut &'a isize, y: &mut &'b isize) { |
| // Here we try to call `foo` but do not know that `'a` and `'b` are |
| //[base]~^ ERROR lifetime mismatch [E0623] |
| //[nll]~^^ ERROR lifetime may not live long enough |
| // 'a and 'b are early bound in the function `a` because they appear |
| let _: fn(&mut &isize, &mut &isize) = a; |
| //~^ ERROR mismatched types [E0308] |
| //[nll]~^^ ERROR mismatched types [E0308] |
| // 'a and 'b are late bound in the function `b` because there are |
| let _: fn(&mut &isize, &mut &isize) = b; |