]> git.proxmox.com Git - rustc.git/blame - tests/ui/self/elision/ref-mut-struct.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / self / elision / ref-mut-struct.rs
CommitLineData
dc9dc135
XL
1#![allow(non_snake_case)]
2
3use std::pin::Pin;
4
5struct Struct { }
6
7impl Struct {
8 // Test using `&mut Struct` explicitly:
9
10 fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 {
04454e1e 11 f
923072b8 12 //~^ ERROR lifetime may not live long enough
dc9dc135
XL
13 }
14
15 fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 {
04454e1e 16 f
923072b8 17 //~^ ERROR lifetime may not live long enough
dc9dc135
XL
18 }
19
20 fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 {
04454e1e 21 f
923072b8 22 //~^ ERROR lifetime may not live long enough
dc9dc135
XL
23 }
24
25 fn box_box_ref_Struct(self: Box<Box<&mut Struct>>, f: &u32) -> &u32 {
04454e1e 26 f
923072b8 27 //~^ ERROR lifetime may not live long enough
dc9dc135
XL
28 }
29
30 fn box_pin_ref_Struct(self: Box<Pin<&mut Struct>>, f: &u32) -> &u32 {
04454e1e 31 f
923072b8 32 //~^ ERROR lifetime may not live long enough
dc9dc135
XL
33 }
34}
35
36fn main() { }