diff options
| author | Ben Kimock <kimockb@gmail.com> | 2023-03-24 10:48:40 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-24 10:48:40 -0400 |
| commit | c9c1346874299b3dac07b3f310429c00fe91c998 (patch) | |
| tree | 8e6f7fbcd879bb0349b382193f012bbf9d587559 | |
| parent | 5896f8672da837e973bcabd9c415019205f3f8ef (diff) | |
| download | rust-c9c1346874299b3dac07b3f310429c00fe91c998.tar.gz rust-c9c1346874299b3dac07b3f310429c00fe91c998.zip | |
Clarify that we are doing ptr.addr() internally
Co-authored-by: Ralf Jung <post@ralfj.de>
| -rw-r--r-- | compiler/rustc_mir_transform/src/check_alignment.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_mir_transform/src/check_alignment.rs b/compiler/rustc_mir_transform/src/check_alignment.rs index d654c973e02..694102388cf 100644 --- a/compiler/rustc_mir_transform/src/check_alignment.rs +++ b/compiler/rustc_mir_transform/src/check_alignment.rs @@ -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 |
