Skip to content

Commit 9c91846

Browse files
committed
Remove zst hacks
1 parent b0d9afb commit 9c91846

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

src/librustc_trans/mir/constant.rs

-14
Original file line numberDiff line numberDiff line change
@@ -479,13 +479,6 @@ impl<'a, 'tcx> MirConstContext<'a, 'tcx> {
479479
let ty = self.monomorphize(&constant.ty);
480480
match constant.literal.clone() {
481481
mir::Literal::Item { def_id, substs } => {
482-
// Shortcut for zero-sized types
483-
// which would not work with MirConstContext.
484-
if common::type_is_zero_size(self.ccx, ty) {
485-
let llty = type_of::type_of(self.ccx, ty);
486-
return Ok(Const::new(C_null(llty), ty));
487-
}
488-
489482
let substs = self.monomorphize(&substs);
490483
MirConstContext::trans_def(self.ccx, def_id, substs, IndexVec::new())
491484
}
@@ -927,13 +920,6 @@ impl<'a, 'tcx> MirContext<'a, 'tcx> {
927920
let ty = self.monomorphize(&constant.ty);
928921
let result = match constant.literal.clone() {
929922
mir::Literal::Item { def_id, substs } => {
930-
// Shortcut for zero-sized types
931-
// which would not work with MirConstContext.
932-
if common::type_is_zero_size(bcx.ccx, ty) {
933-
let llty = type_of::type_of(bcx.ccx, ty);
934-
return Const::new(C_null(llty), ty);
935-
}
936-
937923
let substs = self.monomorphize(&substs);
938924
MirConstContext::trans_def(bcx.ccx, def_id, substs, IndexVec::new())
939925
}

0 commit comments

Comments
 (0)