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>(
228228 crate :: pointer:: Pointer :: new ( global_ptr)
229229}
230230
231- pub ( crate ) fn data_id_for_alloc_id (
231+ fn data_id_for_alloc_id (
232232 cx : & mut ConstantCx ,
233233 module : & mut dyn Module ,
234234 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>(
202202 } ;
203203 let x = codegen_operand ( fx, & x. node ) ;
204204 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:?}" )
208209 } ;
209210
210211 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>(
205205 // Find a way to reuse `immediate_const_vector` from `codegen_ssa` instead.
206206 let indexes = {
207207 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:?}" )
211212 } ;
212213
213214 let idx_bytes = match idx_const {
You can’t perform that action at this time.
0 commit comments