]> git.lizzy.rs Git - rust.git/blob - tests/ui/impl-header-lifetime-elision/dyn-trait.stderr
Rollup merge of #106144 - tgross35:patch-1, r=Mark-Simulacrum
[rust.git] / tests / ui / impl-header-lifetime-elision / dyn-trait.stderr
1 error[E0521]: borrowed data escapes outside of function
2   --> $DIR/dyn-trait.rs:24:5
3    |
4 LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
5    |                          --  - `x` is a reference that is only valid in the function body
6    |                          |
7    |                          lifetime `'a` defined here
8 LL |     static_val(x);
9    |     ^^^^^^^^^^^^^
10    |     |
11    |     `x` escapes the function body here
12    |     argument requires that `'a` must outlive `'static`
13
14 error: aborting due to previous error
15
16 For more information about this error, try `rustc --explain E0521`.