File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -228,7 +228,7 @@ fn pointer_for_allocation<'tcx>(
228
228
crate :: pointer:: Pointer :: new ( global_ptr)
229
229
}
230
230
231
- pub ( crate ) fn data_id_for_alloc_id (
231
+ fn data_id_for_alloc_id (
232
232
cx : & mut ConstantCx ,
233
233
module : & mut dyn Module ,
234
234
alloc_id : AllocId ,
Original file line number Diff line number Diff line change @@ -202,9 +202,10 @@ pub(super) fn codegen_x86_llvm_intrinsic_call<'tcx>(
202
202
} ;
203
203
let x = codegen_operand ( fx, & x. node ) ;
204
204
let y = codegen_operand ( fx, & y. node ) ;
205
- let kind = match & kind. node {
206
- Operand :: Constant ( const_) => crate :: constant:: eval_mir_constant ( fx, const_) . 0 ,
207
- Operand :: Copy ( _) | Operand :: Move ( _) => unreachable ! ( "{kind:?}" ) ,
205
+ let kind = if let Some ( const_) = kind. node . constant ( ) {
206
+ crate :: constant:: eval_mir_constant ( fx, const_) . 0
207
+ } else {
208
+ unreachable ! ( "{kind:?}" )
208
209
} ;
209
210
210
211
let flt_cc = match kind
Original file line number Diff line number Diff line change @@ -205,9 +205,10 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
205
205
// Find a way to reuse `immediate_const_vector` from `codegen_ssa` instead.
206
206
let indexes = {
207
207
use rustc_middle:: mir:: interpret:: * ;
208
- let idx_const = match & idx. node {
209
- Operand :: Constant ( const_) => crate :: constant:: eval_mir_constant ( fx, const_) . 0 ,
210
- Operand :: Copy ( _) | Operand :: Move ( _) => unreachable ! ( "{idx:?}" ) ,
208
+ let idx_const = if let Some ( const_) = idx. node . constant ( ) {
209
+ crate :: constant:: eval_mir_constant ( fx, const_) . 0
210
+ } else {
211
+ unreachable ! ( "{idx:?}" )
211
212
} ;
212
213
213
214
let idx_bytes = match idx_const {
You can’t perform that action at this time.
0 commit comments