]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/trait-objects.extended.stderr
Rollup merge of #98111 - eggyal:issue-97982, r=GuillaumeGomez
[rust.git] / src / test / ui / generic-associated-types / trait-objects.extended.stderr
1 error[E0521]: borrowed data escapes outside of function
2   --> $DIR/trait-objects.rs:15:5
3    |
4 LL | fn min_size(x: &mut dyn for<'a> StreamingIterator<Item<'a> = &'a i32>) -> usize {
5    |             -  - let's call the lifetime of this reference `'1`
6    |             |
7    |             `x` is a reference that is only valid in the function body
8 LL |
9 LL |     x.size_hint().0
10    |     ^^^^^^^^^^^^^
11    |     |
12    |     `x` escapes the function body here
13    |     argument requires that `'1` must outlive `'static`
14    |
15    = note: due to current limitations in the borrow checker, this implies a `'static` lifetime
16
17 error: aborting due to previous error
18
19 For more information about this error, try `rustc --explain E0521`.