1
Fork 0

Change ShallowDrop to Free, so that it matches what trans will do

This commit is contained in:
Niko Matsakis 2015-10-21 17:16:11 -04:00
parent 88a9c3e764
commit 1e30f3e52b
2 changed files with 4 additions and 4 deletions

View file

@ -71,7 +71,7 @@ impl<'a,'tcx> Builder<'a,'tcx> {
// schedule a shallow free of that memory, lest we unwind: // schedule a shallow free of that memory, lest we unwind:
let extent = this.extent_of_innermost_scope().unwrap(); 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: // initialize the box contents:
let contents = result.clone().deref(); let contents = result.clone().deref();

View file

@ -355,8 +355,8 @@ pub enum StatementKind<'tcx> {
#[derive(Copy, Clone, Debug, PartialEq, Eq)] #[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum DropKind { pub enum DropKind {
Shallow, Free, // free a partially constructed box, should go away eventually
Deep, Deep
} }
impl<'tcx> Debug for Statement<'tcx> { impl<'tcx> Debug for Statement<'tcx> {
@ -364,7 +364,7 @@ impl<'tcx> Debug for Statement<'tcx> {
use self::StatementKind::*; use self::StatementKind::*;
match self.kind { match self.kind {
Assign(ref lv, ref rv) => write!(fmt, "{:?} = {:?}", lv, rv), 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), Drop(DropKind::Deep, ref lv) => write!(fmt, "drop {:?}", lv),
} }
} }