Skip to content

Commit c9c1346

Browse files
saethlinRalfJung
andauthored
Clarify that we are doing ptr.addr() internally
Co-authored-by: Ralf Jung <post@ralfj.de>
1 parent 5896f86 commit c9c1346

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_mir_transform/src/check_alignment.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ fn insert_alignment_check<'tcx>(
136136
.statements
137137
.push(Statement { source_info, kind: StatementKind::Assign(Box::new((thin_ptr, rvalue))) });
138138

139-
// Cast the pointer to a usize
139+
// Transmute the pointer to a usize (equivalent to `ptr.addr()`)
140140
let rvalue = Rvalue::Cast(CastKind::Transmute, Operand::Copy(thin_ptr), tcx.types.usize);
141141
let addr = local_decls.push(LocalDecl::with_source_info(tcx.types.usize, source_info)).into();
142142
block_data

0 commit comments

Comments
 (0)