2022-05-22 01:05:15 -05:00
|
|
|
// revisions: base nll
|
|
|
|
// ignore-compare-mode-nll
|
|
|
|
//[nll] compile-flags: -Z borrowck=mir
|
|
|
|
|
2017-08-05 17:39:43 -05:00
|
|
|
struct Ref<'a, 'b> { a: &'a u32, b: &'b u32 }
|
|
|
|
|
|
|
|
fn foo(mut x: Ref, y: &u32) {
|
2022-05-22 01:05:15 -05:00
|
|
|
y = x.b;
|
|
|
|
//[base]~^ ERROR lifetime mismatch
|
|
|
|
//[nll]~^^ ERROR lifetime may not live long enough
|
|
|
|
//[nll]~| ERROR cannot assign to immutable argument
|
2017-06-29 14:40:04 -05:00
|
|
|
}
|
2017-08-05 17:39:43 -05:00
|
|
|
|
|
|
|
fn main() { }
|