about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-10-21 12:04:25 +0000
committerbors <bors@rust-lang.org>2018-10-21 12:04:25 +0000
commit31b97f789f4809d0bff76e931a5dfd4fece079da (patch)
tree839dfa6f7660e53328b4d65d7fe335b588a6aabc /src/rustllvm/RustWrapper.cpp
parent66910ba686e1e89ff6cfbb46b3e5394bedbe5564 (diff)
parent2a3969a3f70779790fd8de1f1602441b5078566b (diff)
downloadrust-31b97f789f4809d0bff76e931a5dfd4fece079da.tar.gz
rust-31b97f789f4809d0bff76e931a5dfd4fece079da.zip
Auto merge of #55069 - matthewjasper:explain-free-region-liveness, r=nikomatsakis
[NLL] Use new region infer errors when explaining borrows

Use the new free region infer errors for explaining borrows

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. (E0521)

Closes #51026 - `regions-nested-fns-2.rs` isn't changed to that diagnostic, since that would not be the correct error here.
Closes #51169
cc #53882 - The error is (IMO) better now, but it could be better when we trace lifetimes in these error messages.

r? @nikomatsakis cc @pnkfelix
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions