@@ -738,7 +738,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
738738 _ => bug ! ( "RawPtr operands {data:?} {meta:?}" ) ,
739739 }
740740 }
741- mir:: Rvalue :: Repeat ( ..) | mir:: Rvalue :: Aggregate ( ..) => {
741+ mir:: Rvalue :: Repeat ( ..) => bug ! ( "{rvalue:?} in codegen_rvalue_operand" ) ,
742+ mir:: Rvalue :: Aggregate ( ..) => {
742743 // According to `rvalue_creates_operand`, only ZST
743744 // aggregate rvalues are allowed to be operands.
744745 let ty = rvalue. ty ( self . mir , self . cx . tcx ( ) ) ;
@@ -1052,7 +1053,9 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
10521053 true ,
10531054 // This always produces a `ty::RawPtr`, so will be Immediate or Pair
10541055 mir:: Rvalue :: Aggregate ( box AggregateKind :: RawPtr ( ..) , ..) => true ,
1055- mir:: Rvalue :: Repeat ( ..) |
1056+ // Arrays are always aggregates, so it's not worth checking anything here.
1057+ // (If it's really `[(); N]` or `[T; 0]` and we use the place path, fine.)
1058+ mir:: Rvalue :: Repeat ( ..) => false ,
10561059 mir:: Rvalue :: Aggregate ( ..) => {
10571060 let ty = rvalue. ty ( self . mir , self . cx . tcx ( ) ) ;
10581061 let ty = self . monomorphize ( ty) ;
0 commit comments