Clarify that we are doing ptr.addr() internally

Co-authored-by: Ralf Jung <post@ralfj.de>
This commit is contained in:
Ben Kimock 2023-03-24 10:48:40 -04:00 committed by GitHub
parent 5896f8672d
commit c9c1346874
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -136,7 +136,7 @@ fn insert_alignment_check<'tcx>(
.statements
.push(Statement { source_info, kind: StatementKind::Assign(Box::new((thin_ptr, rvalue))) });
// Cast the pointer to a usize
// Transmute the pointer to a usize (equivalent to `ptr.addr()`)
let rvalue = Rvalue::Cast(CastKind::Transmute, Operand::Copy(thin_ptr), tcx.types.usize);
let addr = local_decls.push(LocalDecl::with_source_info(tcx.types.usize, source_info)).into();
block_data