fork/rust
git clone https://git.julia.blue/fork/rust
4560ea788cb
1.39.0
1error[E0521]: borrowed data escapes outside of function 2 --> $DIR/lifetime-bound-will-change-warning.rs:34:5 3 | 4LL | fn test2<'a>(x: &'a Box<dyn Fn() + 'a>) { 5 | - `x` is a reference that is only valid in the function body 6LL | // but ref_obj will not, so warn. 7LL | ref_obj(x) 8 | ^^^^^^^^^^ `x` escapes the function body here 9 10error[E0521]: borrowed data escapes outside of function 11 --> $DIR/lifetime-bound-will-change-warning.rs:39:5 12 | 13LL | fn test2cc<'a>(x: &'a Box<dyn Fn() + 'a>) { 14 | - `x` is a reference that is only valid in the function body 15LL | // same as test2, but cross crate 16LL | lib::ref_obj(x) 17 | ^^^^^^^^^^^^^^^ `x` escapes the function body here 18 19error: aborting due to 2 previous errors 20