Commit Graph

14 Commits

Author SHA1 Message Date
Mikhail Modin
5fc0b743d7 add "temporary value dropped while borrowed" error
Issue #54131
2018-09-25 15:23:56 +01:00
bors
576b640a02 Auto merge of #54262 - matthewjasper:explain-in-typeck, r=nikomatsakis
[NLL] Record more infomation on free region constraints in typeck

Changes:

* Makes the span of the MIR return place point to the return type
* Don't try to use a path to a type alias as a path to the adt it aliases (fixes an ICE)
* Don't claim that `self` is declared outside of the function. [see this test](f2995d5b1a (diff-0c9e6b1b204f42129b481df9ce459d44))
* Remove boring/interesting distinction and instead add a `ConstraintCategory` to the constraint.
* Add categories for implicit `Sized` and `Copy` requirements, for closure bounds, for user type annotations and `impl Trait`.
* Don't use the span of the first statement for Locations::All bounds (even if it happens to work on the tests we have)

Future work:

* Fine tuning the heuristic used to choose the place the report the error.
* Reporting multiple places (behind a flag)
* Better closure bounds reporting. This probably requires some discussion.

r? @nikomatsakis
2018-09-23 01:39:54 +00:00
Matthew Jasper
bd0895d7d0 Update ui tests 2018-09-19 20:50:09 +01:00
Matthew Jasper
6e425219f1 Don't claim that locals in a function are declared outside of the
function body
2018-09-19 19:52:55 +01:00
Remy Rakic
ab236dfc86 Update NLL 3-point error message for fake reads in optimized let patterns 2018-09-18 14:36:37 +02:00
bors
052d24e6c8 Auto merge of #54088 - matthewjasper:use-reason-in-dlle-errors, r=pnkfelix
[NLL] Suggest let binding

Closes #49821

Also adds an alternative to `explain_why_borrow_contains_point` that allows changing error messages based on the reason that will be given. This will also be useful for #51026, #51169 and maybe further changes to does not live long enough messages.
2018-09-14 15:45:02 +00:00
toidiu
731f4efae5 stabalize infer outlives requirements (RFC 2093).
Co-authored-by: nikomatsakis
2018-09-11 11:40:04 -04:00
Matthew Jasper
54f7311587 Suggest a let binding to extend temporary lifetimes with NLL 2018-09-09 19:43:46 +01:00
Wesley Wiser
b1211e8703 Fix tests 2018-09-06 22:57:05 -04:00
Basile Desloges
b01550a718 Update tests 2018-09-01 12:58:18 +02:00
Matthew Jasper
7f7fadaee6 Also use smaller spans for unsize adjustments 2018-08-27 12:36:49 +01:00
Matthew Jasper
9309e2ef07 Use smaller span for adjustments on block expressions 2018-08-25 12:13:28 +01:00
Matthew Jasper
a19db49c86 Update former compile-fail tests 2018-08-14 21:26:33 +01:00
David Wood
3fc7ab2373
Merged migrated compile-fail tests and ui tests. Fixes #46841. 2018-08-14 11:12:09 +02:00