about summary refs log tree commit diff
path: root/src/librustc_mir/borrow_check/path_utils.rs
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-173/+0
2020-05-25Display information about captured variable in `FnMut` errorAaron Hill-1/+37
Fixes #69446 When we encounter a region error involving an `FnMut` closure, we display a specialized error message. However, we currently do not tell the user which upvar was captured. This makes it difficult to determine the cause of the error, especially when the closure is large. This commit records marks constraints involving closure upvars with `ConstraintCategory::ClosureUpvar`. When we decide to 'blame' a `ConstraintCategory::Return`, we additionall store the captured upvar if we found a `ConstraintCategory::ClosureUpvar` in the path. When generating an error message, we point to relevant spans if we have closure upvar information available. We further customize the message if an `async` closure is being returned, to make it clear that the captured variable is being returned indirectly.
2020-03-31Use Place directly on borrow_of_local_data, it's CopySantiago Pastorino-1/+1
2020-03-31Use Place directly, it's CopySantiago Pastorino-2/+2
2020-03-30rustc -> rustc_middle part 3 (rustfmt)Mazdak Farrokhzad-1/+1
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-3/+3
2020-01-10Remove PlaceBase enum and make Place base field be local: LocalSantiago Pastorino-6/+4
2020-01-10Remove Static from PlaceBaseSantiago Pastorino-2/+0
2020-01-10Remove unused param_env parameterSantiago Pastorino-3/+1
2019-12-23Yield is an expression form, not a statement.Donough Liu-1/+1
2019-12-22Format the worldMark Rousskov-3/+3
2019-08-30Use new `Place::is_indirect` API where possibleDylan MacKenzie-16/+7
2019-08-05Fiddle param env through to `try_eval_bits` in most placesOliver Scherer-1/+3
2019-07-22Place::as_place_ref is now Place::as_refSantiago Pastorino-1/+1
2019-07-20Avoid cloning Place in report_use_of_moved_or_uninitialized and friendsSantiago Pastorino-1/+1
2019-07-03Remove needless lifetimesJeremy Stucki-1/+1
2019-06-14Unify all uses of 'gcx and 'tcx.Eduard-Mihai Burtescu-2/+2
2019-06-12Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-2/+2
2019-06-12rustc: replace `TyCtxt<'tcx, 'gcx, 'tcx>` with `TyCtxt<'gcx, 'tcx>`.Eduard-Mihai Burtescu-1/+1
2019-06-12Fix fallout from `deny(unused_lifetimes)`.Eduard-Mihai Burtescu-1/+1
2019-06-12rustc: replace `TyCtxt<'a, 'gcx, 'tcx>` with `TyCtxt<'tcx, 'gcx, 'tcx>`.Eduard-Mihai Burtescu-1/+1
2019-06-11rustc_mir: deny(unused_lifetimes).Eduard-Mihai Burtescu-1/+1
2019-06-09Changed usages of `mir` in librustc::mir and librustc_mir to `body`Jad Ghalayini-2/+2
2019-05-28Changes the type `mir::Mir` into `mir::Body`Claude-Alban RANÉLY-VERGÉ-DÉPRÉ-2/+2
The commit should have changed comments as well. At the time of writting, it passes the tidy and check tool. Revisions asked by eddyb : - Renamed of all the occurences of {visit/super}_mir - Renamed test structures `CachedMir` to `Cached` Fixing the missing import on `AggregateKind`
2019-05-24Make borrow_of_local_data iterate instead of recurseSantiago Pastorino-15/+13
2019-05-02Remove Context and ContextKindYuki Okushi-2/+1
2019-04-28Remove unused TyCtxt argument from allow_two_phase_borrow functionflip1995-4/+1
2019-04-28Fix lint findings in librustc_mirflip1995-1/+1
2019-04-28Remove two-phase-beyond-autorefYuki OKUSHI-2/+1
2019-04-21Enable migrate mode by default on the 2015 editionMatthew Jasper-3/+2
This also fully stabilizes two-phase borrows on all editions
2019-03-18promoted is still left in 2 placesSaleem Jaffer-1/+0
2019-03-01Put Local, Static and Promoted as one Base variant of PlaceSantiago Pastorino-4/+4
2019-02-10rustc: doc commentsAlexander Regueiro-1/+1
2019-02-08librustc_mir => 2018Taiki Endo-5/+5
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-17Kill borrows from a projection after assignment.David Wood-0/+1
This commit extends previous work to kill borrows from a local after assignment into that local to kill borrows from a projection after assignment into a prefix of that place.
2018-09-24Rename places_conflict to borrow_conflicts_with_placeMatthew Jasper-1/+1
This name better reflects the asymmetry of this function.
2018-09-24Add "Shallow" borrow kindMatthew Jasper-1/+8
This allows treating the "fake" match borrows differently from shared borrows.
2018-09-23Rework checking for borrows conflicting with dropsMatthew Jasper-2/+2
Previously, we would split the drop access into multiple checks for each field of a struct/tuple/closure and through `Box` dereferences. This changes this to check if the borrow is accessed by the drop in places_conflict. This also allows us to handle enums in a simpler way, since we don't have to construct any new places.
2018-07-23Promoteds are statics and statics have a place, not just a valueOliver Schneider-0/+1
2018-07-12rename `control_flow_graph` to `graph`Niko Matsakis-1/+1
2018-07-04Correctly handle an activation from dead code.David Wood-5/+5
2018-06-27extract `places_conflict` into its own moduleNiko Matsakis-360/+9
2018-06-19Return a `SmallVec` from `place_elements`.Nicholas Nethercote-2/+3
These vectors are always small, so this avoids lots of allocations.
2018-05-29Expand two-phase-borrows so that a case like this still compiles:Felix S. Klock II-3/+6
```rust fn main() { fn reuse<X>(_: &mut X) {} let mut t = 2f64; match t { ref mut _b if { false } => { reuse(_b); } _ => {} } } ``` Note: The way this is currently written is confusing; when `autoref` is off, then the arm body bindings (introduced by `bind_matched_candidate_for_arm_body`) are *also* used for the guard. (Any attempt to fix this needs to still ensure that the bindings used by the guard are introduced before the guard is evaluated.) (Once we turn NLL on by default, we can presumably simplify all of that.)
2018-05-18Refactor borrowck to share more code with fact dumpingbobtwinkles-0/+507
Following up my changes in #50798, I wanted to grab at least the low-hanging fruit for code deduplication.