@@ -135,6 +135,10 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
135
135
dest. codegen_set_discr ( bx, variant_index) ;
136
136
}
137
137
138
+ mir:: Rvalue :: Cast ( mir:: CastKind :: Transmute , ref operand, _ty) => {
139
+ self . codegen_transmute_into ( bx, operand, dest) ;
140
+ }
141
+
138
142
_ => {
139
143
assert ! ( self . rvalue_creates_operand( rvalue, DUMMY_SP ) ) ;
140
144
let temp = self . codegen_rvalue_operand ( bx, rvalue) ;
@@ -344,6 +348,9 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
344
348
} ;
345
349
OperandValue :: Immediate ( newval)
346
350
}
351
+ mir:: CastKind :: Transmute => {
352
+ bug ! ( "Transmute operand {:?} in `codegen_rvalue_operand`" , operand) ;
353
+ }
347
354
} ;
348
355
OperandRef { val, layout : cast }
349
356
}
@@ -684,6 +691,9 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
684
691
impl < ' a , ' tcx , Bx : BuilderMethods < ' a , ' tcx > > FunctionCx < ' a , ' tcx , Bx > {
685
692
pub fn rvalue_creates_operand ( & self , rvalue : & mir:: Rvalue < ' tcx > , span : Span ) -> bool {
686
693
match * rvalue {
694
+ mir:: Rvalue :: Cast ( mir:: CastKind :: Transmute , ..) =>
695
+ // sometimes this could, but for aggregates it can't
696
+ false ,
687
697
mir:: Rvalue :: Ref ( ..) |
688
698
mir:: Rvalue :: CopyForDeref ( ..) |
689
699
mir:: Rvalue :: AddressOf ( ..) |
0 commit comments