diff options
Diffstat (limited to 'src/test/ui/self/elision/ref-mut-struct.rs')
| -rw-r--r-- | src/test/ui/self/elision/ref-mut-struct.rs | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/test/ui/self/elision/ref-mut-struct.rs b/src/test/ui/self/elision/ref-mut-struct.rs index 05e275b19e4..72674bd65b6 100644 --- a/src/test/ui/self/elision/ref-mut-struct.rs +++ b/src/test/ui/self/elision/ref-mut-struct.rs @@ -1,3 +1,7 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + #![allow(non_snake_case)] use std::pin::Pin; @@ -8,23 +12,33 @@ impl Struct { // Test using `&mut Struct` explicitly: fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 { - f //~ ERROR lifetime mismatch + f + //[base]~^ ERROR lifetime mismatch + //[nll]~^^ ERROR lifetime may not live long enough } fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 { - f //~ ERROR lifetime mismatch + f + //[base]~^ ERROR lifetime mismatch + //[nll]~^^ ERROR lifetime may not live long enough } fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 { - f //~ ERROR lifetime mismatch + f + //[base]~^ ERROR lifetime mismatch + //[nll]~^^ ERROR lifetime may not live long enough } fn box_box_ref_Struct(self: Box<Box<&mut Struct>>, f: &u32) -> &u32 { - f //~ ERROR lifetime mismatch + f + //[base]~^ ERROR lifetime mismatch + //[nll]~^^ ERROR lifetime may not live long enough } fn box_pin_ref_Struct(self: Box<Pin<&mut Struct>>, f: &u32) -> &u32 { - f //~ ERROR lifetime mismatch + f + //[base]~^ ERROR lifetime mismatch + //[nll]~^^ ERROR lifetime may not live long enough } } |
