Skip to content

Commit 1e30f3e

Browse files
committed
Change ShallowDrop to Free, so that it matches what trans will do
1 parent 88a9c3e commit 1e30f3e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/librustc_mir/build/expr/as_rvalue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ impl<'a,'tcx> Builder<'a,'tcx> {
7171

7272
// schedule a shallow free of that memory, lest we unwind:
7373
let extent = this.extent_of_innermost_scope().unwrap();
74-
this.schedule_drop(expr_span, extent, DropKind::Shallow, &result, value_ty);
74+
this.schedule_drop(expr_span, extent, DropKind::Free, &result, value_ty);
7575

7676
// initialize the box contents:
7777
let contents = result.clone().deref();

src/librustc_mir/repr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,16 +355,16 @@ pub enum StatementKind<'tcx> {
355355

356356
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
357357
pub enum DropKind {
358-
Shallow,
359-
Deep,
358+
Free, // free a partially constructed box, should go away eventually
359+
Deep
360360
}
361361

362362
impl<'tcx> Debug for Statement<'tcx> {
363363
fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error> {
364364
use self::StatementKind::*;
365365
match self.kind {
366366
Assign(ref lv, ref rv) => write!(fmt, "{:?} = {:?}", lv, rv),
367-
Drop(DropKind::Shallow, ref lv) => write!(fmt, "shallow_drop {:?}", lv),
367+
Drop(DropKind::Free, ref lv) => write!(fmt, "free {:?}", lv),
368368
Drop(DropKind::Deep, ref lv) => write!(fmt, "drop {:?}", lv),
369369
}
370370
}

0 commit comments

Comments
 (0)