fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
886 B24 linesraw
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   |
10   = help: consider replacing `'a` with `'static`
11
12error[E0521]: borrowed data escapes outside of function
13  --> $DIR/lifetime-bound-will-change-warning.rs:39:5
14   |
15LL | fn test2cc<'a>(x: &'a Box<dyn Fn() + 'a>) {
16   |                - `x` is a reference that is only valid in the function body
17LL |     // same as test2, but cross crate
18LL |     lib::ref_obj(x)
19   |     ^^^^^^^^^^^^^^^ `x` escapes the function body here
20   |
21   = help: consider replacing `'a` with `'static`
22
23error: aborting due to 2 previous errors
24