mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-30 04:56:25 +03:00
Use Place directly in evaluate_array_len, it's Copy
This commit is contained in:
@@ -400,7 +400,7 @@ pub fn codegen_rvalue_operand(
|
||||
self.codegen_place_to_pointer(bx, place, mk_ptr)
|
||||
}
|
||||
|
||||
mir::Rvalue::Len(ref place) => {
|
||||
mir::Rvalue::Len(place) => {
|
||||
let size = self.evaluate_array_len(&mut bx, place);
|
||||
let operand = OperandRef {
|
||||
val: OperandValue::Immediate(size),
|
||||
@@ -537,7 +537,7 @@ pub fn codegen_rvalue_operand(
|
||||
}
|
||||
}
|
||||
|
||||
fn evaluate_array_len(&mut self, bx: &mut Bx, place: &mir::Place<'tcx>) -> Bx::Value {
|
||||
fn evaluate_array_len(&mut self, bx: &mut Bx, place: mir::Place<'tcx>) -> Bx::Value {
|
||||
// ZST are passed as operands and require special handling
|
||||
// because codegen_place() panics if Local is operand.
|
||||
if let Some(index) = place.as_local() {
|
||||
|
||||
Reference in New Issue
Block a user