]> git.lizzy.rs Git - rust.git/blob - tests/ui/traits/object/issue-44454-2.stderr
Auto merge of #105716 - chriswailes:ndk-update-redux, r=pietroalbini
[rust.git] / tests / ui / traits / object / issue-44454-2.stderr
1 error[E0521]: borrowed data escapes outside of function
2   --> $DIR/issue-44454-2.rs:16:5
3    |
4 LL | fn extend_lt<'a>(x: &'a str) -> Box<dyn AsRef<str> + 'static> {
5    |              --  - `x` is a reference that is only valid in the function body
6    |              |
7    |              lifetime `'a` defined here
8 LL |     type DynTrait = dyn for<'a> Trait<&'a str, Assoc = &'a str>;
9 LL |     hr::<DynTrait, _>(x)
10    |     ^^^^^^^^^^^^^^^^^^^^
11    |     |
12    |     `x` escapes the function body here
13    |     argument requires that `'a` must outlive `'static`
14
15 error: aborting due to previous error
16
17 For more information about this error, try `rustc --explain E0521`.