about summary refs log tree commit diff
path: root/src/bootstrap
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/bootstrap
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/bootstrap')
-rw-r--r--src/bootstrap/bin/rustc.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs
index b6764c1aaea..344eb789ff6 100644
--- a/src/bootstrap/bin/rustc.rs
+++ b/src/bootstrap/bin/rustc.rs
@@ -253,8 +253,15 @@ fn main() {
 
         // When running miri tests, we need to generate MIR for all libraries
         if env::var("TEST_MIRI").ok().map_or(false, |val| val == "true") {
+            // The flags here should be kept in sync with `add_miri_default_args`
+            // in miri's `src/lib.rs`.
             cmd.arg("-Zalways-encode-mir");
-            cmd.arg("-Zmir-emit-validate=1");
+            // These options are preferred by miri, to be able to perform better validation,
+            // but the bootstrap compiler might not understand them.
+            if stage != "0" {
+                cmd.arg("-Zmir-emit-retag");
+                cmd.arg("-Zmir-opt-level=0");
+            }
         }
 
         // Force all crates compiled by this compiler to (a) be unstable and (b)