]> git.proxmox.com Git - rustc.git/blame - src/test/ui/lifetimes/lifetime-bound-will-change-warning.nll.stderr
New upstream version 1.57.0+dfsg1
[rustc.git] / src / test / ui / lifetimes / lifetime-bound-will-change-warning.nll.stderr
CommitLineData
48663c56
XL
1error[E0521]: borrowed data escapes outside of function
2 --> $DIR/lifetime-bound-will-change-warning.rs:34:5
3 |
dc9dc135 4LL | fn test2<'a>(x: &'a Box<dyn Fn() + 'a>) {
c295e0f8
XL
5 | -- - `x` is a reference that is only valid in the function body
6 | |
7 | lifetime `'a` defined here
48663c56
XL
8LL | // but ref_obj will not, so warn.
9LL | ref_obj(x)
c295e0f8
XL
10 | ^^^^^^^^^^
11 | |
12 | `x` escapes the function body here
13 | argument requires that `'a` must outlive `'static`
48663c56
XL
14
15error[E0521]: borrowed data escapes outside of function
16 --> $DIR/lifetime-bound-will-change-warning.rs:39:5
17 |
dc9dc135 18LL | fn test2cc<'a>(x: &'a Box<dyn Fn() + 'a>) {
c295e0f8
XL
19 | -- - `x` is a reference that is only valid in the function body
20 | |
21 | lifetime `'a` defined here
48663c56
XL
22LL | // same as test2, but cross crate
23LL | lib::ref_obj(x)
c295e0f8
XL
24 | ^^^^^^^^^^^^^^^
25 | |
26 | `x` escapes the function body here
27 | argument requires that `'a` must outlive `'static`
48663c56
XL
28
29error: aborting due to 2 previous errors
30
5869c6ff 31For more information about this error, try `rustc --explain E0521`.