Commit Graph

7 Commits

Author SHA1 Message Date
Mark Rousskov
2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Matthew Jasper
2a3969a3f7 Use new 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.
2018-10-21 12:35:00 +01:00
Felix S. Klock II
673cd6efbe Updates to tests reflecting the diangostic changes in previous commit.
It is worth pointing out that the reason that so few diagnostics are
effected is because of the filter I put in where it only goes down the
new path if the borrowed place is *not* a prefix of the dropped place.

(Without that filter, a *lot* of the tests would need this change, and
it would probably be a net loss for the UX, since you'd see it even in
cases like borrows of generic types where there is no explicit mention
of `Drop`.)
2018-09-18 02:06:45 +02:00
Matthew Jasper
338d545b90 Don't match on region kinds when reporting NLL errors
With NLL region kinds are always ReVar
2018-07-23 20:54:09 +01:00
Esteban Küber
03bcebbc60 Also point to free named region on lifetime errors 2018-06-28 11:12:44 -07:00
Guillaume Gomez
2e104a77cf update tests 2018-03-14 00:53:24 +01:00
Niko Matsakis
1e4e632ad8 add regression tests for various MIR bugs that get fixed
Fixes #31567
Fixes #47470
Fixes #48132
Fixes #48179
2018-03-13 11:22:07 -04:00