]> git.lizzy.rs Git - rust.git/commitdiff
treat ref-to-raw cast like a reborrow: do a special kind of retag
authorRalf Jung <post@ralfj.de>
Tue, 11 Dec 2018 18:54:38 +0000 (19:54 +0100)
committerRalf Jung <post@ralfj.de>
Tue, 18 Dec 2018 08:56:31 +0000 (09:56 +0100)
22 files changed:
src/librustc/ich/impls_mir.rs
src/librustc/mir/mod.rs
src/librustc/mir/visit.rs
src/librustc_codegen_ssa/mir/statement.rs
src/librustc_mir/borrow_check/mod.rs
src/librustc_mir/borrow_check/nll/invalidation.rs
src/librustc_mir/borrow_check/nll/type_check/mod.rs
src/librustc_mir/dataflow/impls/borrows.rs
src/librustc_mir/dataflow/move_paths/builder.rs
src/librustc_mir/interpret/cast.rs
src/librustc_mir/interpret/machine.rs
src/librustc_mir/interpret/step.rs
src/librustc_mir/shim.rs
src/librustc_mir/transform/add_retag.rs
src/librustc_mir/transform/check_unsafety.rs
src/librustc_mir/transform/generator.rs
src/librustc_mir/transform/inline.rs
src/librustc_mir/transform/qualify_consts.rs
src/librustc_mir/transform/qualify_min_const_fn.rs
src/librustc_mir/transform/remove_noop_landing_pads.rs
src/librustc_mir/transform/rustc_peek.rs
src/test/mir-opt/retag.rs

index a46e12be1aeace57d5b28a503e8f90111c98e075..d82020f59a10ecbd4be52055b5fef06fb306d77d 100644 (file)
@@ -200,13 +200,13 @@ fn hash_stable<W: StableHasherResult>(&self,
     SetDiscriminant { place, variant_index },
     StorageLive(place),
     StorageDead(place),
-    EscapeToRaw(place),
-    Retag { fn_entry, two_phase, place },
+    Retag(retag_kind, place),
     AscribeUserType(place, variance, c_ty),
     Nop,
     InlineAsm { asm, outputs, inputs },
 });
 
+impl_stable_hash_for!(enum mir::RetagKind { FnEntry, TwoPhase, Raw, Default });
 impl_stable_hash_for!(enum mir::FakeReadCause { ForMatchGuard, ForMatchedPlace, ForLet });
 
 impl<'a, 'gcx> HashStable<StableHashingContext<'a>> for mir::Place<'gcx> {
index 68b5c3e2df3224b108145fe1d166e9ca7b4fb6d0..61fed669e14993171c612499690973026e080e9c 100644 (file)
@@ -1774,23 +1774,7 @@ pub enum StatementKind<'tcx> {
     /// by miri and only generated when "-Z mir-emit-retag" is passed.
     /// See <https://internals.rust-lang.org/t/stacked-borrows-an-aliasing-model-for-rust/8153/>
     /// for more details.
-    Retag {
-        /// `fn_entry` indicates whether this is the initial retag that happens in the
-        /// function prolog.
-        fn_entry: bool,
-        /// `two_phase` indicates whether this is just the reservation action of
-        /// a two-phase borrow.
-        two_phase: bool,
-        /// The place to retag
-        place: Place<'tcx>,
-    },
-
-    /// Escape the given reference to a raw pointer, so that it can be accessed
-    /// without precise provenance tracking. These statements are currently only interpreted
-    /// by miri and only generated when "-Z mir-emit-retag" is passed.
-    /// See <https://internals.rust-lang.org/t/stacked-borrows-an-aliasing-model-for-rust/8153/>
-    /// for more details.
-    EscapeToRaw(Operand<'tcx>),
+    Retag(RetagKind, Place<'tcx>),
 
     /// Encodes a user's type ascription. These need to be preserved
     /// intact so that NLL can respect them. For example:
@@ -1810,6 +1794,19 @@ pub enum StatementKind<'tcx> {
     Nop,
 }
 
+/// `RetagKind` describes what kind of retag is to be performed.
+#[derive(Copy, Clone, RustcEncodable, RustcDecodable, Debug, PartialEq, Eq)]
+pub enum RetagKind {
+    /// The initial retag when entering a function
+    FnEntry,
+    /// Retag preparing for a two-phase borrow
+    TwoPhase,
+    /// Retagging raw pointers
+    Raw,
+    /// A "normal" retag
+    Default,
+}
+
 /// The `FakeReadCause` describes the type of pattern why a `FakeRead` statement exists.
 #[derive(Copy, Clone, RustcEncodable, RustcDecodable, Debug)]
 pub enum FakeReadCause {
@@ -1845,13 +1842,16 @@ fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
         match self.kind {
             Assign(ref place, ref rv) => write!(fmt, "{:?} = {:?}", place, rv),
             FakeRead(ref cause, ref place) => write!(fmt, "FakeRead({:?}, {:?})", cause, place),
-            Retag { fn_entry, two_phase, ref place } =>
-                write!(fmt, "Retag({}{}{:?})",
-                    if fn_entry { "[fn entry] " } else { "" },
-                    if two_phase { "[2phase] " } else { "" },
+            Retag(ref kind, ref place) =>
+                write!(fmt, "Retag({}{:?})",
+                    match kind {
+                        RetagKind::FnEntry => "[fn entry] ",
+                        RetagKind::TwoPhase => "[2phase] ",
+                        RetagKind::Raw => "[raw] ",
+                        RetagKind::Default => "",
+                    },
                     place,
                 ),
-            EscapeToRaw(ref place) => write!(fmt, "EscapeToRaw({:?})", place),
             StorageLive(ref place) => write!(fmt, "StorageLive({:?})", place),
             StorageDead(ref place) => write!(fmt, "StorageDead({:?})", place),
             SetDiscriminant {
@@ -2965,6 +2965,7 @@ pub enum ClosureOutlivesSubject<'tcx> {
     SourceInfo,
     UpvarDecl,
     FakeReadCause,
+    RetagKind,
     SourceScope,
     SourceScopeData,
     SourceScopeLocalData,
@@ -3031,8 +3032,7 @@ impl<'tcx> TypeFoldable<'tcx> for StatementKind<'tcx> {
         (StatementKind::StorageLive)(a),
         (StatementKind::StorageDead)(a),
         (StatementKind::InlineAsm) { asm, outputs, inputs },
-        (StatementKind::Retag) { fn_entry, two_phase, place },
-        (StatementKind::EscapeToRaw)(place),
+        (StatementKind::Retag)(kind, place),
         (StatementKind::AscribeUserType)(a, v, b),
         (StatementKind::Nop),
     }
index 237f6bc9c7b45b81627c8028895eab5f95269845..278a4dc1d873aceafd5a672c4721a57a946f4d1c 100644 (file)
@@ -153,11 +153,10 @@ fn visit_ascribe_user_ty(&mut self,
             }
 
             fn visit_retag(&mut self,
-                           fn_entry: & $($mutability)* bool,
-                           two_phase: & $($mutability)* bool,
+                           kind: & $($mutability)* RetagKind,
                            place: & $($mutability)* Place<'tcx>,
                            location: Location) {
-                self.super_retag(fn_entry, two_phase, place, location);
+                self.super_retag(kind, place, location);
             }
 
             fn visit_place(&mut self,
@@ -385,9 +384,6 @@ fn super_statement(&mut self,
                             location
                         );
                     }
-                    StatementKind::EscapeToRaw(ref $($mutability)* op) => {
-                        self.visit_operand(op, location);
-                    }
                     StatementKind::StorageLive(ref $($mutability)* local) => {
                         self.visit_local(
                             local,
@@ -417,10 +413,9 @@ fn super_statement(&mut self,
                             self.visit_operand(input, location);
                         }
                     }
-                    StatementKind::Retag { ref $($mutability)* fn_entry,
-                                           ref $($mutability)* two_phase,
-                                           ref $($mutability)* place } => {
-                        self.visit_retag(fn_entry, two_phase, place, location);
+                    StatementKind::Retag ( ref $($mutability)* kind,
+                                           ref $($mutability)* place ) => {
+                        self.visit_retag(kind, place, location);
                     }
                     StatementKind::AscribeUserType(
                         ref $($mutability)* place,
@@ -725,8 +720,7 @@ fn super_ascribe_user_ty(&mut self,
             }
 
             fn super_retag(&mut self,
-                           _fn_entry: & $($mutability)* bool,
-                           _two_phase: & $($mutability)* bool,
+                           _kind: & $($mutability)* RetagKind,
                            place: & $($mutability)* Place<'tcx>,
                            location: Location) {
                 self.visit_place(
index 568a7e7e1600f3fe3a3019c11e366f7d66eb8a0d..80539b78c7073c9e75364e7b43a6552fd399ab33 100644 (file)
@@ -106,7 +106,6 @@ pub fn codegen_statement(
             }
             mir::StatementKind::FakeRead(..) |
             mir::StatementKind::Retag { .. } |
-            mir::StatementKind::EscapeToRaw { .. } |
             mir::StatementKind::AscribeUserType(..) |
             mir::StatementKind::Nop => bx,
         }
index 5eca62938f7a8c821cbe68b18930779f7c770b12..824acc89b1d526d78d7de4c7854fc920dd65fce3 100644 (file)
@@ -590,7 +590,6 @@ fn visit_statement_entry(
             StatementKind::Nop
             | StatementKind::AscribeUserType(..)
             | StatementKind::Retag { .. }
-            | StatementKind::EscapeToRaw { .. }
             | StatementKind::StorageLive(..) => {
                 // `Nop`, `AscribeUserType`, `Retag`, and `StorageLive` are irrelevant
                 // to borrow check.
index 07bda8af62618a6191df91d1533277641add6939..d2810de284a894b6b122356903bf87e7a9725a57 100644 (file)
@@ -135,7 +135,6 @@ fn visit_statement(&mut self,
             StatementKind::Nop |
             StatementKind::AscribeUserType(..) |
             StatementKind::Retag { .. } |
-            StatementKind::EscapeToRaw { .. } |
             StatementKind::StorageLive(..) => {
                 // `Nop`, `AscribeUserType`, `Retag`, and `StorageLive` are irrelevant
                 // to borrow check.
index 4807abe2bdd19c08dbedbb476ad9b884c2e3311c..b9fc100d9a2e6c36994383f5ccadbce69f048761 100644 (file)
@@ -1316,7 +1316,6 @@ fn check_stmt(&mut self, mir: &Mir<'tcx>, stmt: &Statement<'tcx>, location: Loca
             | StatementKind::StorageDead(..)
             | StatementKind::InlineAsm { .. }
             | StatementKind::Retag { .. }
-            | StatementKind::EscapeToRaw { .. }
             | StatementKind::Nop => {}
         }
     }
index 5e78ef03c2c6b4e7197699b8c478377f9322bf79..0bace39c7e3950572eb74181ec3e2e71231b41eb 100644 (file)
@@ -300,7 +300,6 @@ fn statement_effect(&self, sets: &mut BlockSets<BorrowIndex>, location: Location
             mir::StatementKind::SetDiscriminant { .. } |
             mir::StatementKind::StorageLive(..) |
             mir::StatementKind::Retag { .. } |
-            mir::StatementKind::EscapeToRaw { .. } |
             mir::StatementKind::AscribeUserType(..) |
             mir::StatementKind::Nop => {}
 
index 7fe27e97d3d3bab0488e05d0a0a237b0f5980da2..d201a355a2ae94941a019c9ca3e8bde6f5bd8c58 100644 (file)
@@ -302,7 +302,6 @@ fn gather_statement(&mut self, stmt: &Statement<'tcx>) {
                           "SetDiscriminant should not exist during borrowck");
             }
             StatementKind::Retag { .. } |
-            StatementKind::EscapeToRaw { .. } |
             StatementKind::AscribeUserType(..) |
             StatementKind::Nop => {}
         }
index 7d636b77ced4ce9453941fd90989e085ac7bfebf..118539fc58ebf2bb2299390554e8adf41bd52f94 100644 (file)
@@ -44,22 +44,16 @@ pub fn cast(
             }
 
             Misc => {
-                let src_layout = src.layout;
                 let src = self.read_immediate(src)?;
 
-                // There are no casts to references
-                assert!(!dest.layout.ty.is_region_ptr());
-                // Hence we make all casts erase the tag
-                let src = src.erase_tag().with_default_tag();
-
-                if self.type_is_fat_ptr(src_layout.ty) {
-                    match (src, self.type_is_fat_ptr(dest.layout.ty)) {
+                if self.type_is_fat_ptr(src.layout.ty) {
+                    match (*src, self.type_is_fat_ptr(dest.layout.ty)) {
                         // pointers to extern types
                         (Immediate::Scalar(_),_) |
                         // slices and trait objects to other slices/trait objects
                         (Immediate::ScalarPair(..), true) => {
                             // No change to immediate
-                            self.write_immediate(src, dest)?;
+                            self.write_immediate(*src, dest)?;
                         }
                         // slices and trait objects to thin pointers (dropping the metadata)
                         (Immediate::ScalarPair(data, _), false) => {
@@ -67,11 +61,11 @@ pub fn cast(
                         }
                     }
                 } else {
-                    match src_layout.variants {
+                    match src.layout.variants {
                         layout::Variants::Single { index } => {
-                            if let Some(def) = src_layout.ty.ty_adt_def() {
+                            if let Some(def) = src.layout.ty.ty_adt_def() {
                                 // Cast from a univariant enum
-                                assert!(src_layout.is_zst());
+                                assert!(src.layout.is_zst());
                                 let discr_val = def
                                     .discriminant_for_variant(*self.tcx, index)
                                     .val;
@@ -84,7 +78,7 @@ pub fn cast(
                         layout::Variants::NicheFilling { .. } => {},
                     }
 
-                    let dest_val = self.cast_scalar(src.to_scalar()?, src_layout, dest.layout)?;
+                    let dest_val = self.cast_scalar(src.to_scalar()?, src.layout, dest.layout)?;
                     self.write_scalar(dest_val, dest)?;
                 }
             }
index 4c7aa887045c718ef2b2c899e4fc27090ab9fc20..e6f3b664c007b5684bb2f761c53305abba04a1c9 100644 (file)
@@ -203,22 +203,12 @@ fn tag_dereference(
     #[inline]
     fn retag(
         _ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
-        _fn_entry: bool,
-        _two_phase: bool,
+        _kind: mir::RetagKind,
         _place: PlaceTy<'tcx, Self::PointerTag>,
     ) -> EvalResult<'tcx> {
         Ok(())
     }
 
-    /// Execute an escape-to-raw operation
-    #[inline]
-    fn escape_to_raw(
-        _ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
-        _ptr: OpTy<'tcx, Self::PointerTag>,
-    ) -> EvalResult<'tcx> {
-        Ok(())
-    }
-
     /// Called immediately before a new stack frame got pushed
     fn stack_push(
         ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
index a6835e4f167380ed0cb5c525675cfb2b768cfafc..596dba576064623199fc7ffbc73ba7e1c2b53867 100644 (file)
@@ -119,13 +119,9 @@ fn statement(&mut self, stmt: &mir::Statement<'tcx>) -> EvalResult<'tcx> {
             FakeRead(..) => {}
 
             // Stacked Borrows.
-            Retag { fn_entry, two_phase, ref place } => {
+            Retag(kind, ref place) => {
                 let dest = self.eval_place(place)?;
-                M::retag(self, fn_entry, two_phase, dest)?;
-            }
-            EscapeToRaw(ref op) => {
-                let op = self.eval_operand(op, None)?;
-                M::escape_to_raw(self, op)?;
+                M::retag(self, kind, dest)?;
             }
 
             // Statements we do not track.
index 114162946051ea71cf6657a1f8a9c758acf1b8d0..0ed8ce2a1b896106fd18365d3729cfd97d848898 100644 (file)
@@ -226,20 +226,11 @@ fn build_drop_shim<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
         // The first argument (index 0), but add 1 for the return value.
         let dropee_ptr = Place::Local(Local::new(1+0));
         if tcx.sess.opts.debugging_opts.mir_emit_retag {
-            // Function arguments should be retagged
+            // Function arguments should be retagged, and we make this one raw.
             mir.basic_blocks_mut()[START_BLOCK].statements.insert(0, Statement {
                 source_info,
-                kind: StatementKind::Retag {
-                    fn_entry: true,
-                    two_phase: false,
-                    place: dropee_ptr.clone(),
-                },
+                kind: StatementKind::Retag(RetagKind::Raw, dropee_ptr.clone()),
             });
-            // We use raw ptr operations, better prepare the alias tracking for that
-            mir.basic_blocks_mut()[START_BLOCK].statements.insert(1, Statement {
-                source_info,
-                kind: StatementKind::EscapeToRaw(Operand::Copy(dropee_ptr.clone())),
-            })
         }
         let patch = {
             let param_env = tcx.param_env(def_id).with_reveal_all();
index 811b85446cb23b59eb02210a0980bb5f3bd98107..69c0a68ae70516a68eddcf991b12b54abde4bc45 100644 (file)
@@ -118,7 +118,7 @@ fn run_pass<'a, 'tcx>(&self,
             basic_blocks[START_BLOCK].statements.splice(0..0,
                 places.into_iter().map(|place| Statement {
                     source_info,
-                    kind: StatementKind::Retag { fn_entry: true, two_phase: false, place },
+                    kind: StatementKind::Retag(RetagKind::FnEntry, place),
                 })
             );
         }
@@ -154,7 +154,7 @@ fn run_pass<'a, 'tcx>(&self,
         for (source_info, dest_place, dest_block) in returns {
             basic_blocks[dest_block].statements.insert(0, Statement {
                 source_info,
-                kind: StatementKind::Retag { fn_entry: false, two_phase: false, place: dest_place },
+                kind: StatementKind::Retag(RetagKind::Default, dest_place),
             });
         }
 
@@ -164,9 +164,9 @@ fn run_pass<'a, 'tcx>(&self,
             // We want to insert statements as we iterate.  To this end, we
             // iterate backwards using indices.
             for i in (0..block_data.statements.len()).rev() {
-                match block_data.statements[i].kind {
-                    // If we are casting *from* a reference, we may have to escape-to-raw.
-                    StatementKind::Assign(_, box Rvalue::Cast(
+                let (retag_kind, place) = match block_data.statements[i].kind {
+                    // If we are casting *from* a reference, we may have to retag-as-raw.
+                    StatementKind::Assign(ref place, box Rvalue::Cast(
                         CastKind::Misc,
                         ref src,
                         dest_ty,
@@ -175,42 +175,35 @@ fn run_pass<'a, 'tcx>(&self,
                         if src_ty.is_region_ptr() {
                             // The only `Misc` casts on references are those creating raw pointers.
                             assert!(dest_ty.is_unsafe_ptr());
-                            // Insert escape-to-raw before the cast.  We are not concerned
-                            // with stability here: Our EscapeToRaw will not change the value
-                            // that the cast will then use.
-                            // `src` might be a "move", but we rely on this not actually moving
-                            // but just doing a memcpy.  It is crucial that we do EscapeToRaw
-                            // on the src because we need it with its original type.
-                            let source_info = block_data.statements[i].source_info;
-                            block_data.statements.insert(i, Statement {
-                                source_info,
-                                kind: StatementKind::EscapeToRaw(src.clone()),
-                            });
+                            (RetagKind::Raw, place)
+                        } else {
+                            // Some other cast, no retag
+                            continue
                         }
                     }
                     // Assignments of reference or ptr type are the ones where we may have
                     // to update tags.  This includes `x = &[mut] ...` and hence
                     // we also retag after taking a reference!
                     StatementKind::Assign(ref place, box ref rvalue) if needs_retag(place) => {
-                        let two_phase = match rvalue {
-                            Rvalue::Ref(_, borrow_kind, _) =>
-                                borrow_kind.allows_two_phase_borrow(),
-                            _ => false
+                        let kind = match rvalue {
+                            Rvalue::Ref(_, borrow_kind, _)
+                                if borrow_kind.allows_two_phase_borrow()
+                            =>
+                                RetagKind::TwoPhase,
+                            _ =>
+                                RetagKind::Default,
                         };
-                        // Insert a retag after the assignment.
-                        let source_info = block_data.statements[i].source_info;
-                        block_data.statements.insert(i+1, Statement {
-                            source_info,
-                            kind: StatementKind::Retag {
-                                fn_entry: false,
-                                two_phase,
-                                place: place.clone(),
-                            },
-                        });
+                        (kind, place)
                     }
                     // Do nothing for the rest
-                    _ => {},
+                    _ => continue,
                 };
+                // Insert a retag after the statement.
+                let source_info = block_data.statements[i].source_info;
+                block_data.statements.insert(i+1, Statement {
+                    source_info,
+                    kind: StatementKind::Retag(retag_kind, place.clone()),
+                });
             }
         }
     }
index 3607869384077656bcc6591ceb6ee520d9f1bae4..f6b7f817aad5306b7a32fb6ec77e62618bc4fc16 100644 (file)
@@ -117,7 +117,6 @@ fn visit_statement(&mut self,
             StatementKind::StorageLive(..) |
             StatementKind::StorageDead(..) |
             StatementKind::Retag { .. } |
-            StatementKind::EscapeToRaw { .. } |
             StatementKind::AscribeUserType(..) |
             StatementKind::Nop => {
                 // safe (at least as emitted during MIR construction)
index f870e4a2a422701e247c5411e6ea1d9c78eb57e7..fe19accb03137a1d170fdffbea2c80541931b0a4 100644 (file)
@@ -689,7 +689,7 @@ fn create_generator_drop_shim<'a, 'tcx>(
         // Alias tracking must know we changed the type
         mir.basic_blocks_mut()[START_BLOCK].statements.insert(0, Statement {
             source_info,
-            kind: StatementKind::EscapeToRaw(Operand::Copy(Place::Local(self_arg()))),
+            kind: StatementKind::Retag(RetagKind::Raw, Place::Local(self_arg())),
         })
     }
 
index afe0066df1f28dbc6e2ca85bd4d2849c480fbf4d..88424d75baa882e145e1c36a304abd881f1229ff 100644 (file)
@@ -709,16 +709,17 @@ fn visit_basic_block_data(&mut self, block: BasicBlock, data: &mut BasicBlockDat
 
     fn visit_retag(
         &mut self,
-        fn_entry: &mut bool,
-        two_phase: &mut bool,
+        kind: &mut RetagKind,
         place: &mut Place<'tcx>,
         loc: Location,
     ) {
-        self.super_retag(fn_entry, two_phase, place, loc);
+        self.super_retag(kind, place, loc);
 
         // We have to patch all inlined retags to be aware that they are no longer
         // happening on function entry.
-        *fn_entry = false;
+        if *kind == RetagKind::FnEntry {
+            *kind = RetagKind::Default;
+        }
     }
 
     fn visit_terminator_kind(&mut self, block: BasicBlock,
index 5f08dee87285928dc6d7361a9b7d681a741792ba..59e59ce479e044ba41a8d9f02f40419a23204918 100644 (file)
@@ -1237,7 +1237,6 @@ fn visit_statement(&mut self, bb: BasicBlock, statement: &Statement<'tcx>, locat
                 StatementKind::StorageDead(_) |
                 StatementKind::InlineAsm {..} |
                 StatementKind::Retag { .. } |
-                StatementKind::EscapeToRaw { .. } |
                 StatementKind::AscribeUserType(..) |
                 StatementKind::Nop => {}
             }
index 3c1b9dbd91fa80e60548fbe54ab1ddc9012659a5..85c6e3989aa324f8877093a9950ca6576814600a 100644 (file)
@@ -243,7 +243,6 @@ fn check_statement(
         | StatementKind::StorageLive(_)
         | StatementKind::StorageDead(_)
         | StatementKind::Retag { .. }
-        | StatementKind::EscapeToRaw { .. }
         | StatementKind::AscribeUserType(..)
         | StatementKind::Nop => Ok(()),
     }
index 81b010e7dcec9ba8f7bad43a4bd95ad102cf351d..cdab5a1d7b011796f79081ebe4d589df8b277426 100644 (file)
@@ -65,8 +65,7 @@ fn is_nop_landing_pad(
                 StatementKind::Assign { .. } |
                 StatementKind::SetDiscriminant { .. } |
                 StatementKind::InlineAsm { .. } |
-                StatementKind::Retag { .. } |
-                StatementKind::EscapeToRaw { .. } => {
+                StatementKind::Retag { .. } => {
                     return false;
                 }
             }
index c996dc285f7e77f71c1dc7cceb7ea0179fc2538e..fabcba12f21bb39fdbc8b9ee9b1b532e0c016053 100644 (file)
@@ -162,7 +162,6 @@ fn each_block<'a, 'tcx, O>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
             mir::StatementKind::StorageDead(_) |
             mir::StatementKind::InlineAsm { .. } |
             mir::StatementKind::Retag { .. } |
-            mir::StatementKind::EscapeToRaw { .. } |
             mir::StatementKind::AscribeUserType(..) |
             mir::StatementKind::Nop => continue,
             mir::StatementKind::SetDiscriminant{ .. } =>
index 7da55c0868cd2bf6d5a3611dd1482f706dc88ff4..f48862ff9330b107dcd32013f4f8481f52b24c70 100644 (file)
@@ -87,8 +87,8 @@ fn main() {
 //         ...
 //         _14 = &mut (*_10);
 //         Retag(_14);
-//         EscapeToRaw(move _14);
 //         _13 = move _14 as *mut i32 (Misc);
+//         Retag([raw] _13);
 //         ...
 //         _17 = move _18(move _19) -> bb2;
 //     }