]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lifetimes/lifetime-bound-will-change-warning.nll.stderr
Merge commit '3e7c6dec244539970b593824334876f8b6ed0b18' into clippyup
[rust.git] / src / test / ui / lifetimes / lifetime-bound-will-change-warning.nll.stderr
1 error[E0521]: borrowed data escapes outside of function
2   --> $DIR/lifetime-bound-will-change-warning.rs:34:5
3    |
4 LL | fn test2<'a>(x: &'a Box<dyn Fn() + 'a>) {
5    |              - `x` is a reference that is only valid in the function body
6 LL |     // but ref_obj will not, so warn.
7 LL |     ref_obj(x)
8    |     ^^^^^^^^^^ `x` escapes the function body here
9    |
10    = help: consider replacing `'a` with `'static`
11
12 error[E0521]: borrowed data escapes outside of function
13   --> $DIR/lifetime-bound-will-change-warning.rs:39:5
14    |
15 LL | fn test2cc<'a>(x: &'a Box<dyn Fn() + 'a>) {
16    |                - `x` is a reference that is only valid in the function body
17 LL |     // same as test2, but cross crate
18 LL |     lib::ref_obj(x)
19    |     ^^^^^^^^^^^^^^^ `x` escapes the function body here
20    |
21    = help: consider replacing `'a` with `'static`
22
23 error: aborting due to 2 previous errors
24