]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/anonymous-region-in-apit.stderr
Rollup merge of #106644 - alexcrichton:update-wasi-toolchain, r=cuviper
[rust.git] / tests / ui / borrowck / anonymous-region-in-apit.stderr
1 error[E0521]: borrowed data escapes outside of closure
2   --> $DIR/anonymous-region-in-apit.rs:8:17
3    |
4 LL | fn qux(foo: impl Foo<&str>) {
5    |        --- lifetime `'2` appears in the type of `foo`
6 LL |     |baz: &str| foo.bar(baz);
7    |      ---  -     ^^^^^^^^^^^^
8    |      |    |     |
9    |      |    |     `baz` escapes the closure body here
10    |      |    |     argument requires that `'1` must outlive `'2`
11    |      |    let's call the lifetime of this reference `'1`
12    |      `baz` is a reference that is only valid in the closure body
13
14 error: aborting due to previous error
15
16 For more information about this error, try `rustc --explain E0521`.