| Age | Commit message (Collapse) | Author | Lines |
|
Assignment to immutable argument: diagnostic tweak
Re #46659.
|
|
|
|
rustc::ty: Rename struct_variant to non_enum_variant
r? @eddyb
|
|
|
|
It is also intended for use with unions.
|
|
Upgrade `log` to `0.4` in multiple crates.
|
|
Reword reason for move note
On move errors, when encountering an enum variant, be more ambiguous and do not refer to the type on the cause note, to avoid referring to `(maybe as std::prelude::v1::Some).0`, and instead refer to `the value`.
Sidesteps part of the problem with #41962:
```
error[E0382]: use of partially moved value: `maybe`
--> file.rs:5:30
|
5 | if let Some(thing) = maybe {
| ----- ^^^^^ value used here after move
| |
| value moved here
= note: move occurs because the value has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait
error[E0382]: use of moved value: `(maybe as std::prelude::v1::Some).0`
--> file.rs:5:21
|
5 | if let Some(thing) = maybe {
| ^^^^^ value moved here in previous iteration of loop
= note: move occurs because the value has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait
error: aborting due to 2 previous errors
```
Previous discussion: #44360
r? @arielb1
|
|
|
|
|
|
|
|
|
|
|
|
The previous message ("cannot assign/mutably borrow immutable field")
when trying to modify a field of an immutable binding gave the
(incorrect) impression that fields can be mutable independently of their
ADT's binding. Slightly reword the message to read "cannot
assign/mutably borrow field of immutable binding".
|
|
|
|
nll part 5
Next round of changes from the nll-master branch.
Extensions:
- we now propagate ty-region-outlives constraints out of closures and into their creator when necessary
- we fix a few ICEs that can occur by doing liveness analysis (and the resulting normalization) during type-checking
- we handle the implicit region bound that assumes that each type `T` outlives the fn body
- we handle normalization of inputs/outputs in fn signatures
Not included in this PR (will come next):
- handling `impl Trait`
- tracking causal information
- extended errors
r? @arielb1
|
|
This is needed to allow the `ClosureRegionRequirements` to capture
types that include regions.
|
|
|
|
|
|
where mode is one of {ast,mir,compare}.
This commit only implements the functionality.
The tests will be updated in a follow up commit.
|
|
The closure kinds themselves are now completely found in the `ClosureSubsts`.
|
|
from the local crate.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
remove or encapsulate the remaining non-query data in tcx
I wound up removing the existing cache around inhabitedness since it didn't seem to be adding much value. I reworked const rvalue promotion, but not that much (i.e., I did not split the computation into bits, as @eddyb had tossed out as a suggestion). But it's now demand driven, at least.
cc @michaelwoerister -- see the `forbid_reads` change in last commit
r? @eddyb -- since the trickiest of this PR is the work on const rvalue promotion
cc #44137
|
|
address more FIXME whose associated issues were marked as closed
part of #44366
|
|
|
|
|
|
rustc: Remove `used_mut_nodes` from `TyCtxt`
This updates the borrowck query to return a result, and this result is then used
to incrementally check for unused mutable nodes given sets of all the used
mutable nodes.
Closes #42384
|
|
This updates the borrowck query to return a result, and this result is then used
to incrementally check for unused mutable nodes given sets of all the used
mutable nodes.
Closes #42384
|
|
MIR-borrowck: Migrate remaining ast diagnostics
This PR migrates all of the remaining diagnostics in `rustc_borrowck` over to `rustc_mir`, exposing them for use by both AST-borrowck and MIR-borrowck.
This should hopefully resolve all remaining cases of diagnostic messages emitted from borrowck under `-Z borrowck-mir` without an origin annotation.
|
|
When attempting to mutate an immutable outer variable from a closure,
point at the outer variable and suggest making it mutable.
|
|
|
|
BorrowckErrors` as necessary.
|
|
|
|
r=nikomatsakis
MIR-borrowck: gather and signal any move errors
When building up the `MoveData` structure for a given MIR, also accumulate any erroneous actions, and then report all of those errors when the construction is complete.
This PR adds a host of move-related error constructor methods to `trait BorrowckErrors`. I think I got the notes right; but we should plan to audit all of the notes before turning MIR-borrowck on by default.
Fix #44830
|
|
update FIXME(#6298) to point to open issue 15020
update FIXME(#6268) to point to RFC 811
update FIXME(#10520) to point to RFC 1751
remove FIXME for emscripten issue 4563 and include target in `test_estimate_scaling_factor`
remove FIXME(#18207) since node_id isn't used for `ref` pattern analysis
remove FIXME(#6308) since DST was implemented in #12938
remove FIXME(#2658) since it was decided to not reorganize module
remove FIXME(#20590) since it was decided to stay conservative with projection types
remove FIXME(#20297) since it was decided that solving the issue is unnecessary
remove FIXME(#27086) since closures do correspond to structs now
remove FIXME(#13846) and enable `function_sections` for windows
remove mention of #22079 in FIXME(#22079) since this is a general FIXME
remove FIXME(#5074) since the restriction on borrow were lifted
|
|
mir-borrowck.
|
|
mir-borrowck.
|
|
mir-borrowck.
(Had to modify signature of `report_cannot_move_out_of` slightly to
satisfy requirements of newly added `fn cannot_move_out_of` method.)
|
|
|
|
AST and MIR borrowck
|
|
inside `borrowck_errors.rs`
|
|
`borrowck_errors.rs`
|
|
interiors
|
|
|
|
|