Skip to content

Commit 6d7c6d7

Browse files
committed
into: simplify AddressOf logic after rebase
1 parent a7641f1 commit 6d7c6d7

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

Diff for: src/librustc_mir/build/expr/into.rs

+4-9
Original file line numberDiff line numberDiff line change
@@ -300,16 +300,11 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
300300
mutability,
301301
arg,
302302
} => {
303-
let address_of = match mutability {
304-
hir::Mutability::Not => Rvalue::AddressOf(
305-
Mutability::Not,
306-
unpack!(block = this.as_read_only_place(block, arg)),
307-
),
308-
hir::Mutability::Mut => Rvalue::AddressOf(
309-
Mutability::Mut,
310-
unpack!(block = this.as_place(block, arg)),
311-
),
303+
let place = match mutability {
304+
hir::Mutability::Not => this.as_read_only_place(block, arg),
305+
hir::Mutability::Mut => this.as_place(block, arg),
312306
};
307+
let address_of = Rvalue::AddressOf(mutability, unpack!(block = place));
313308
this.cfg.push_assign(block, source_info, destination, address_of);
314309
block.unit()
315310
}

0 commit comments

Comments
 (0)