Use Place directly in evaluate_array_len, it's Copy
This commit is contained in:
parent
1f5338cfd6
commit
a865e779b0
1 changed files with 2 additions and 2 deletions
|
@ -400,7 +400,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||||
self.codegen_place_to_pointer(bx, place, mk_ptr)
|
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 size = self.evaluate_array_len(&mut bx, place);
|
||||||
let operand = OperandRef {
|
let operand = OperandRef {
|
||||||
val: OperandValue::Immediate(size),
|
val: OperandValue::Immediate(size),
|
||||||
|
@ -537,7 +537,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
// ZST are passed as operands and require special handling
|
||||||
// because codegen_place() panics if Local is operand.
|
// because codegen_place() panics if Local is operand.
|
||||||
if let Some(index) = place.as_local() {
|
if let Some(index) = place.as_local() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue