]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/trait-objects.extended.stderr
Auto merge of #99612 - yanchen4791:issue-95079-fix, r=compiler-errors
[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:16: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 error: aborting due to previous error
16
17 For more information about this error, try `rustc --explain E0521`.