3 // ignore-compare-mode-nll
4 //[nll] compile-flags: -Z borrowck=mir
6 #![allow(non_snake_case)]
13 // Test using `&mut self` sugar:
15 async fn ref_self(&mut self, f: &u32) -> &u32 {
17 //[base]~^ ERROR lifetime mismatch
18 //[nll]~^^ ERROR lifetime may not live long enough
21 // Test using `&mut Self` explicitly:
23 async fn ref_Self(self: &mut Self, f: &u32) -> &u32 {
25 //[base]~^ ERROR lifetime mismatch
26 //[nll]~^^ ERROR lifetime may not live long enough
29 async fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 {
31 //[base]~^ ERROR lifetime mismatch
32 //[nll]~^^ ERROR lifetime may not live long enough
35 async fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 {
37 //[base]~^ ERROR lifetime mismatch
38 //[nll]~^^ ERROR lifetime may not live long enough
41 async fn box_box_ref_Self(self: Box<Box<&mut Self>>, f: &u32) -> &u32 {
43 //[base]~^ ERROR lifetime mismatch
44 //[nll]~^^ ERROR lifetime may not live long enough
47 async fn box_pin_ref_Self(self: Box<Pin<&mut Self>>, f: &u32) -> &u32 {
49 //[base]~^ ERROR lifetime mismatch
50 //[nll]~^^ ERROR lifetime may not live long enough