about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-11-02 12:45:03 +0000
committerbors <bors@rust-lang.org>2018-11-02 12:45:03 +0000
commit87a3c1ee7016bbfb782f2fd8adc75b46687ef929 (patch)
treed1f5ce96602af0244456e01139806980d7730c8b /src/librustc_codegen_llvm
parentd0c869c323289c5ec4df83e1c9091fa0b3e2fc07 (diff)
parentd10304eeb5c9e63597b9ee1094aca0f63c4f31ca (diff)
downloadrust-87a3c1ee7016bbfb782f2fd8adc75b46687ef929.tar.gz
rust-87a3c1ee7016bbfb782f2fd8adc75b46687ef929.zip
Auto merge of #55316 - RalfJung:retagging, r=oli-obk
Add Retagging statements

This adds a `Retag` statement kind to MIR, used to perform the retagging operation from [Stacked Borrows](https://www.ralfj.de/blog/2018/08/07/stacked-borrows.html). It also kills the old `Validate` statements that I added last year.

NOTE: This includes https://github.com/rust-lang/rust/pull/55270. Only [these commits are new](https://github.com/RalfJung/rust/compare/stacked-borrows-ng...RalfJung:retagging).
Diffstat (limited to 'src/librustc_codegen_llvm')
-rw-r--r--src/librustc_codegen_llvm/mir/analyze.rs3
-rw-r--r--src/librustc_codegen_llvm/mir/statement.rs2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/librustc_codegen_llvm/mir/analyze.rs b/src/librustc_codegen_llvm/mir/analyze.rs
index a63cbe70df6..a93c6faaf7b 100644
--- a/src/librustc_codegen_llvm/mir/analyze.rs
+++ b/src/librustc_codegen_llvm/mir/analyze.rs
@@ -219,7 +219,8 @@ impl Visitor<'tcx> for LocalAnalyzer<'mir, 'a, 'll, 'tcx> {
                 self.assign(local, location);
             }
 
-            PlaceContext::NonUse(_) => {}
+            PlaceContext::NonUse(_) |
+            PlaceContext::MutatingUse(MutatingUseContext::Retag) => {}
 
             PlaceContext::NonMutatingUse(NonMutatingUseContext::Copy) |
             PlaceContext::NonMutatingUse(NonMutatingUseContext::Move) => {
diff --git a/src/librustc_codegen_llvm/mir/statement.rs b/src/librustc_codegen_llvm/mir/statement.rs
index 93be0074f6e..cc4e64e0788 100644
--- a/src/librustc_codegen_llvm/mir/statement.rs
+++ b/src/librustc_codegen_llvm/mir/statement.rs
@@ -109,7 +109,7 @@ impl FunctionCx<'a, 'll, 'tcx> {
             }
             mir::StatementKind::FakeRead(..) |
             mir::StatementKind::EndRegion(_) |
-            mir::StatementKind::Validate(..) |
+            mir::StatementKind::Retag { .. } |
             mir::StatementKind::AscribeUserType(..) |
             mir::StatementKind::Nop => bx,
         }