]> git.lizzy.rs Git - rust.git/blob - tests/ui/generic-associated-types/bugs/hrtb-implied-3.stderr
Rollup merge of #104672 - Voultapher:unify-sort-modules, r=thomcc
[rust.git] / tests / ui / generic-associated-types / bugs / hrtb-implied-3.stderr
1 error[E0521]: borrowed data escapes outside of function
2   --> $DIR/hrtb-implied-3.rs:19:5
3    |
4 LL | fn fails(iter: &str) {
5    |          ----  - let's call the lifetime of this reference `'1`
6    |          |
7    |          `iter` is a reference that is only valid in the function body
8 LL |     trivial_bound(iter);
9    |     ^^^^^^^^^^^^^^^^^^^
10    |     |
11    |     `iter` escapes the function body here
12    |     argument requires that `'1` must outlive `'static`
13    |
14 note: due to current limitations in the borrow checker, this implies a `'static` lifetime
15   --> $DIR/hrtb-implied-3.rs:14:26
16    |
17 LL |     for<'a> I::Item<'a>: Sized,
18    |                          ^^^^^
19
20 error: aborting due to previous error
21
22 For more information about this error, try `rustc --explain E0521`.