@@ -480,13 +480,6 @@ impl<'a, 'tcx> MirConstContext<'a, 'tcx> {
480480 let ty = self . monomorphize ( & constant. ty ) ;
481481 match constant. literal . clone ( ) {
482482 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-
490483 let substs = self . monomorphize ( & substs) ;
491484 let instance = Instance :: new ( def_id, substs) ;
492485 MirConstContext :: trans_def ( self . ccx , instance, IndexVec :: new ( ) )
@@ -930,13 +923,6 @@ impl<'a, 'tcx> MirContext<'a, 'tcx> {
930923 let ty = self . monomorphize ( & constant. ty ) ;
931924 let result = match constant. literal . clone ( ) {
932925 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-
940926 let substs = self . monomorphize ( & substs) ;
941927 let instance = Instance :: new ( def_id, substs) ;
942928 MirConstContext :: trans_def ( bcx. ccx , instance, IndexVec :: new ( ) )
0 commit comments