@@ -738,7 +738,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
738
738
_ => bug ! ( "RawPtr operands {data:?} {meta:?}" ) ,
739
739
}
740
740
}
741
- mir:: Rvalue :: Repeat ( ..) | mir:: Rvalue :: Aggregate ( ..) => {
741
+ mir:: Rvalue :: Repeat ( ..) => bug ! ( "{rvalue:?} in codegen_rvalue_operand" ) ,
742
+ mir:: Rvalue :: Aggregate ( ..) => {
742
743
// According to `rvalue_creates_operand`, only ZST
743
744
// aggregate rvalues are allowed to be operands.
744
745
let ty = rvalue. ty ( self . mir , self . cx . tcx ( ) ) ;
@@ -1052,7 +1053,9 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
1052
1053
true ,
1053
1054
// This always produces a `ty::RawPtr`, so will be Immediate or Pair
1054
1055
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 ,
1056
1059
mir:: Rvalue :: Aggregate ( ..) => {
1057
1060
let ty = rvalue. ty ( self . mir , self . cx . tcx ( ) ) ;
1058
1061
let ty = self . monomorphize ( ty) ;
0 commit comments