]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/mir_check_cast_unsize.stderr
Auto merge of #103600 - compiler-errors:early-binder-nits, r=spastorino
[rust.git] / src / test / ui / nll / mir_check_cast_unsize.stderr
1 error: lifetime may not live long enough
2   --> $DIR/mir_check_cast_unsize.rs:6:5
3    |
4 LL | fn bar<'a>(x: &'a u32) -> &'static dyn Debug {
5    |        -- lifetime `'a` defined here
6 LL |     x
7    |     ^ returning this value requires that `'a` must outlive `'static`
8    |
9 help: to declare that the trait object captures data from argument `x`, you can add an explicit `'a` lifetime bound
10    |
11 LL | fn bar<'a>(x: &'a u32) -> &'static dyn Debug + 'a {
12    |                                              ++++
13
14 error: aborting due to previous error
15