Skip to content

Commit a865e77

Browse files
committed
Use Place directly in evaluate_array_len, it's Copy
1 parent 1f5338c commit a865e77

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc_codegen_ssa/mir/rvalue.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
400400
self.codegen_place_to_pointer(bx, place, mk_ptr)
401401
}
402402

403-
mir::Rvalue::Len(ref place) => {
403+
mir::Rvalue::Len(place) => {
404404
let size = self.evaluate_array_len(&mut bx, place);
405405
let operand = OperandRef {
406406
val: OperandValue::Immediate(size),
@@ -537,7 +537,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
537537
}
538538
}
539539

540-
fn evaluate_array_len(&mut self, bx: &mut Bx, place: &mir::Place<'tcx>) -> Bx::Value {
540+
fn evaluate_array_len(&mut self, bx: &mut Bx, place: mir::Place<'tcx>) -> Bx::Value {
541541
// ZST are passed as operands and require special handling
542542
// because codegen_place() panics if Local is operand.
543543
if let Some(index) = place.as_local() {

0 commit comments

Comments
 (0)