@@ -480,13 +480,6 @@ impl<'a, 'tcx> MirConstContext<'a, 'tcx> {
480
480
let ty = self . monomorphize ( & constant. ty ) ;
481
481
match constant. literal . clone ( ) {
482
482
mir:: Literal :: Item { def_id, substs } => {
483
- // Shortcut for zero-sized types
484
- // which would not work with MirConstContext.
485
- if common:: type_is_zero_size ( self . ccx , ty) {
486
- let llty = type_of:: type_of ( self . ccx , ty) ;
487
- return Ok ( Const :: new ( C_null ( llty) , ty) ) ;
488
- }
489
-
490
483
let substs = self . monomorphize ( & substs) ;
491
484
let instance = Instance :: new ( def_id, substs) ;
492
485
MirConstContext :: trans_def ( self . ccx , instance, IndexVec :: new ( ) )
@@ -930,13 +923,6 @@ impl<'a, 'tcx> MirContext<'a, 'tcx> {
930
923
let ty = self . monomorphize ( & constant. ty ) ;
931
924
let result = match constant. literal . clone ( ) {
932
925
mir:: Literal :: Item { def_id, substs } => {
933
- // Shortcut for zero-sized types
934
- // which would not work with MirConstContext.
935
- if common:: type_is_zero_size ( bcx. ccx , ty) {
936
- let llty = type_of:: type_of ( bcx. ccx , ty) ;
937
- return Const :: new ( C_null ( llty) , ty) ;
938
- }
939
-
940
926
let substs = self . monomorphize ( & substs) ;
941
927
let instance = Instance :: new ( def_id, substs) ;
942
928
MirConstContext :: trans_def ( bcx. ccx , instance, IndexVec :: new ( ) )
0 commit comments