fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1// run-rustfix 2// edition:2021 3#![allow(dead_code, unused_mut, unused_variables)] 4struct A {} 5struct Msg<'a> { 6 s: &'a [i32], 7} 8impl A { 9 async fn g(buf: &[i32]) -> Msg<'_> { 10 Msg { s: &buf[0..1] } 11 } 12 async fn f() { 13 let mut buf = [0; 512]; 14 let m2 = &buf[..]; //~ ERROR `buf` does not live long enough 15 let m = Self::g(m2).await; 16 Self::f2(m).await; 17 } 18 async fn f2(m: Msg<'_>) {} 19 //~^ ERROR implicit elided lifetime not allowed here 20} 21 22fn main() {}