This gives at least some explanation for why a borrow is expected to last for a certain free region. Also: * Reports E0373: "closure may outlive the current function" with NLL. * Special cases the case of returning a reference to (or value referencing) a local variable or temporary (E0515). * Special case assigning a reference to a local variable in a closure to a captured variable.
13 lines
465 B
Text
13 lines
465 B
Text
error[E0597]: `a` does not live long enough
|
|
--> $DIR/normalization.rs:12:31
|
|
|
|
|
LL | let b: <() as Foo>::Out = &a; //~ ERROR
|
|
| ---------------- ^^ borrowed value does not live long enough
|
|
| |
|
|
| type annotation requires that `a` is borrowed for `'static`
|
|
LL | }
|
|
| - `a` dropped here while still borrowed
|
|
|
|
error: aborting due to previous error
|
|
|
|
For more information about this error, try `rustc --explain E0597`.
|