about summary refs log tree commit diff
path: root/src/librustc_borrowck
AgeCommit message (Collapse)AuthorLines
2018-01-14Auto merge of #47261 - estebank:immutable-arg, r=petrochenkovbors-1/+2
Assignment to immutable argument: diagnostic tweak Re #46659.
2018-01-10Modify message to match labelEsteban Küber-0/+1
2018-01-09Rollup merge of #47258 - rkruppe:struct-assert, r=eddybkennytm-3/+3
rustc::ty: Rename struct_variant to non_enum_variant r? @eddyb
2018-01-07Assignment to immutable argument: diagnostic tweakEsteban Küber-1/+1
2018-01-08rustc::ty: Rename `struct_variant` to `non_enum_variant`Robin Kruppe-3/+3
It is also intended for use with unions.
2018-01-07Try to fix a perf regression by updating logMalo Jaffré-1/+1
Upgrade `log` to `0.4` in multiple crates.
2018-01-04Auto merge of #47124 - estebank:loan-paths, r=nikomatsakisbors-7/+21
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
2018-01-03Add mir test, review commentsEsteban Küber-3/+3
2018-01-02Be ambiguous when type cannot be properly mentionedEsteban Küber-16/+24
2018-01-01Address review comments: make label shorterEsteban Küber-8/+14
2018-01-01Move reason for move to labelEsteban Küber-11/+11
2018-01-01Delay panic for aliasing violation for static items.matthewjasper-8/+13
2017-12-31Reword trying to operate in immutable fieldsEsteban Küber-23/+41
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".
2017-12-20feature nll implies borrowck=mirSantiago Pastorino-1/+1
2017-12-20Auto merge of #46733 - nikomatsakis:nll-master-to-rust-master-5, r=arielb1bors-0/+1
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
2017-12-15add a new RegionKind variant: ReClosureBoundNiko Matsakis-0/+1
This is needed to allow the `ClosureRegionRequirements` to capture types that include regions.
2017-12-14Point at var in short lived borrowsEsteban Küber-11/+7
2017-12-04rustc_back: remove slice module in favor of std::slice::from_ref.Irina-Gabriela Popa-5/+4
2017-11-26Replace -Zborrowck-mir with -Zborrowck=modeest31-0/+11
where mode is one of {ast,mir,compare}. This commit only implements the functionality. The tests will be updated in a follow up commit.
2017-11-18convert the `closure_kinds` map to just store the origin informationNiko Matsakis-4/+3
The closure kinds themselves are now completely found in the `ClosureSubsts`.
2017-11-16Introduce LocalDefId which provides a type-level guarantee that the DefId is ↵Michael Woerister-5/+5
from the local crate.
2017-11-02Make the difference between lint codes and error codes explicitOliver Schneider-4/+9
2017-10-31make end-point optional in the borrow checkNiko Matsakis-1/+2
2017-10-30Refactor if block to use idiomatic matchesJosh Leeb-du Toit-14/+10
2017-10-30Refactor matches to use Result::errJosh Leeb-du Toit-11/+4
2017-10-29Fix duplicate display of error E0502Josh Leeb-du Toit-9/+30
2017-10-25Reword to avoid using either re-assignment or reassignment in errorsCarol (Nichols || Goulding)-1/+1
2017-10-18Auto merge of #44501 - nikomatsakis:issue-44137-non-query-data-in-tcx, r=eddybbors-2/+14
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
2017-10-17Rollup merge of #45097 - nivkner:fixme_fixup2, r=estebankkennytm-7/+7
address more FIXME whose associated issues were marked as closed part of #44366
2017-10-16convert constant promotion into a queryNiko Matsakis-2/+14
2017-10-16turn link to RFC 1751 into a markdown linkNiv Kaminer-1/+1
2017-10-16Auto merge of #45283 - alexcrichton:used-mut-nodes, r=arielb1bors-10/+162
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
2017-10-14rustc: Remove `used_mut_nodes` from `TyCtxt`Alex Crichton-10/+162
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
2017-10-14Auto merge of #45167 - pnkfelix:migrate-remaining-ast-diagnostics, r=arielb1bors-529/+28
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.
2017-10-11Point at immutable outer variableEsteban Küber-1/+15
When attempting to mutate an immutable outer variable from a closure, point at the outer variable and suggest making it mutable.
2017-10-10Add `Origin::Ast` arguments to all of the migrated AST-borrowck diagnostics.Felix S. Klock II-10/+18
2017-10-10Fixed client code for diagnostics migration, adding new methods to `trait ↵Felix S. Klock II-53/+20
BorrowckErrors` as necessary.
2017-10-10Moved remaining AST-borrowck diagnostic definitions to `rustc_mir` crate.Felix S. Klock II-476/+0
2017-10-08Auto merge of #45016 - pnkfelix:mir-borrowck-gather-and-signal-move-errors, ↵bors-296/+9
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
2017-10-08address more FIXME whose associated issues were marked as closedNiv Kaminer-7/+7
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
2017-10-04Move E0509 diagnostic into mod borrowck_errors shared between ast- and ↵Felix S. Klock II-102/+3
mir-borrowck.
2017-10-04Move E0508 diagnostic into mod borrowck_errors shared between ast- and ↵Felix S. Klock II-58/+2
mir-borrowck.
2017-10-04Move E0507 diagnostic into mod borrowck_errors shared between ast- and ↵Felix S. Klock II-136/+4
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.)
2017-10-04add notes to report_conflicting_borrow MIR borrowckMikhail Modin-91/+18
2017-09-29mir-borrowck: Factorize error message for `cannot_assign_static()` between ↵Basile Desloges-6/+1
AST and MIR borrowck
2017-09-29mir-borrowck: Move span_label calls for `cannot_use_when_mutably_borrowed()` ↵Basile Desloges-8/+4
inside `borrowck_errors.rs`
2017-09-29mir-borrowck: Move span_label calls for `cannot_assign_to_borrowed()` inside ↵Basile Desloges-7/+1
`borrowck_errors.rs`
2017-09-20Only consider yields coming after the expressions when computing generator ↵John Kåre Alsaker-1/+1
interiors
2017-09-14bring Ty into scopeDouglas Campos-4/+4
2017-09-08Use NodeId/HirId instead of DefId for local variables.Eduard-Mihai Burtescu-6/+6