]> git.lizzy.rs Git - rust.git/commitdiff
Change ShallowDrop to Free, so that it matches what trans will do
authorNiko Matsakis <niko@alum.mit.edu>
Wed, 21 Oct 2015 21:16:11 +0000 (17:16 -0400)
committerNiko Matsakis <niko@alum.mit.edu>
Tue, 3 Nov 2015 09:34:59 +0000 (04:34 -0500)
src/librustc_mir/build/expr/as_rvalue.rs
src/librustc_mir/repr.rs

index 3cfc51ec3c98adda6fafbda78d1caa5c25f3469c..c5831b881abe57ce863fe637b5d95d61546dc7f8 100644 (file)
@@ -71,7 +71,7 @@ fn expr_as_rvalue(&mut self,
 
                 // schedule a shallow free of that memory, lest we unwind:
                 let extent = this.extent_of_innermost_scope().unwrap();
-                this.schedule_drop(expr_span, extent, DropKind::Shallow, &result, value_ty);
+                this.schedule_drop(expr_span, extent, DropKind::Free, &result, value_ty);
 
                 // initialize the box contents:
                 let contents = result.clone().deref();
index 09f174e2ba6946f2f824a5090cfd3c297112f659..54e00dc0a68ad66b917d65088cba765e18207319 100644 (file)
@@ -355,8 +355,8 @@ pub enum StatementKind<'tcx> {
 
 #[derive(Copy, Clone, Debug, PartialEq, Eq)]
 pub enum DropKind {
-    Shallow,
-    Deep,
+    Free, // free a partially constructed box, should go away eventually
+    Deep
 }
 
 impl<'tcx> Debug for Statement<'tcx> {
@@ -364,7 +364,7 @@ fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error> {
         use self::StatementKind::*;
         match self.kind {
             Assign(ref lv, ref rv) => write!(fmt, "{:?} = {:?}", lv, rv),
-            Drop(DropKind::Shallow, ref lv) => write!(fmt, "shallow_drop {:?}", lv),
+            Drop(DropKind::Free, ref lv) => write!(fmt, "free {:?}", lv),
             Drop(DropKind::Deep, ref lv) => write!(fmt, "drop {:?}", lv),
         }
     }