summaryrefslogtreecommitdiffstats
path: root/src/librustc_mir/borrow_check/mod.rs
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2018-05-04 12:04:33 +0200
committerFelix S. Klock II <pnkfelix@pnkfx.org>2018-05-29 23:01:36 +0200
commit24abe6f363cd47d444e4cff1123da93817b980f8 (patch)
tree849e130d445bc81ee9a6fadeae611c0118e8e86c /src/librustc_mir/borrow_check/mod.rs
parentDebug flag to bypass restriction of mutation in match guards. (diff)
downloadgrust-24abe6f363cd47d444e4cff1123da93817b980f8.tar.gz
grust-24abe6f363cd47d444e4cff1123da93817b980f8.tar.bz2
grust-24abe6f363cd47d444e4cff1123da93817b980f8.tar.xz
rust-lang/rust#27282: Add `StatementKind::ReadForMatch` to MIR.
(This is just the data structure changes and some boilerplate match code that followed from it; the actual emission of these statements comes in a follow-up commit.)
Diffstat (limited to 'src/librustc_mir/borrow_check/mod.rs')
-rw-r--r--src/librustc_mir/borrow_check/mod.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/librustc_mir/borrow_check/mod.rs b/src/librustc_mir/borrow_check/mod.rs
index 9bfba219cc..233974435f 100644
--- a/src/librustc_mir/borrow_check/mod.rs
+++ b/src/librustc_mir/borrow_check/mod.rs
@@ -423,6 +423,14 @@ impl<'cx, 'gcx, 'tcx> DataflowResultsConsumer<'cx, 'tcx> for MirBorrowckCtxt<'cx
423 flow_state, 423 flow_state,
424 ); 424 );
425 } 425 }
426 StatementKind::ReadForMatch(ref place) => {
427 self.access_place(ContextKind::ReadForMatch.new(location),
428 (place, span),
429 (Deep, Read(ReadKind::Borrow(BorrowKind::Shared))),
430 LocalMutationIsAllowed::No,
431 flow_state,
432 );
433 }
426 StatementKind::SetDiscriminant { 434 StatementKind::SetDiscriminant {
427 ref place, 435 ref place,
428 variant_index: _, 436 variant_index: _,
@@ -2090,6 +2098,7 @@ enum ContextKind {
2090 CallDest, 2098 CallDest,
2091 Assert, 2099 Assert,
2092 Yield, 2100 Yield,
2101 ReadForMatch,
2093 StorageDead, 2102 StorageDead,
2094} 2103}
2095 2104