| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
Fixes #73159
This is similar to #69350 - if the user didn't initially
write out a 'static lifetime, adding 'static in response to
a lifetime error is usually the wrong thing to do.
|
|
|
|
|
|
|
|
|
|
|
|
As a drive-by, also added test analogous to existing
static_to_a_to_static_through_tuple, but now apply to a struct instead
of a tuple.
|
|
Update the existing NLL `patterns.rs` test accordingly.
includes changes addressing review feedback:
* Added example to docs for `UserTypeProjections` illustrating how we
build up multiple projections when descending into a pattern with
type ascriptions.
* Adapted niko's suggested docs for `UserTypeProjection`.
* Factored out `projection_ty` from more general `projection_ty_core`
(as a drive-by, made its callback an `FnMut`, as I discovered later
that I need that).
* Add note to docs that `PlaceTy.field_ty(..)` does not normalize its result.
* Normalize as we project out `field_ty`.
|
|
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.
|
|
Also change the order of the fake read for let and the AscribeUserType,
so that we use the better span and message from the fake read in errors.
|
|
|
|
Issue #54131
|
|
|
|
|
|
But only in very simple cases.
|
|
|
|
|