]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lifetimes/lifetime-bound-will-change-warning.nll.stderr
Auto merge of #54624 - arielb1:evaluate-outlives, r=nikomatsakis
[rust.git] / src / test / ui / lifetimes / lifetime-bound-will-change-warning.nll.stderr
1 error: borrowed data escapes outside of function
2   --> $DIR/lifetime-bound-will-change-warning.rs:44:5
3    |
4 LL | fn test2<'a>(x: &'a Box<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) //~ ERROR mismatched types
8    |     ^^^^^^^^^^ `x` escapes the function body here
9
10 error: borrowed data escapes outside of function
11   --> $DIR/lifetime-bound-will-change-warning.rs:49:5
12    |
13 LL | fn test2cc<'a>(x: &'a Box<Fn()+'a>) {
14    |                - `x` is a reference that is only valid in the function body
15 LL |     // same as test2, but cross crate
16 LL |     lib::ref_obj(x) //~ ERROR mismatched types
17    |     ^^^^^^^^^^^^^^^ `x` escapes the function body here
18
19 error: aborting due to 2 previous errors
20