diff options
| author | Jubilee <workingjubilee@gmail.com> | 2024-09-21 07:54:54 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-21 07:54:54 -0700 |
| commit | cf78f26d5ed5ce32f49fb38cca969d3609599e27 (patch) | |
| tree | 1ea0ca0d9c0d71b5dc615ba5c4c44ecc5dc1ec2a | |
| parent | d93d2f146d2209b826e3f4c125a2f53c09cd8475 (diff) | |
| download | rust-cf78f26d5ed5ce32f49fb38cca969d3609599e27.tar.gz rust-cf78f26d5ed5ce32f49fb38cca969d3609599e27.zip | |
compiler: Precisely name units of object size
Co-authored-by: Ralf Jung <post@ralfj.de>
| -rw-r--r-- | compiler/rustc_abi/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_abi/src/lib.rs b/compiler/rustc_abi/src/lib.rs index 5e0adc45229..3bd94445116 100644 --- a/compiler/rustc_abi/src/lib.rs +++ b/compiler/rustc_abi/src/lib.rs @@ -337,15 +337,15 @@ impl TargetDataLayout { Ok(dl) } - /// Returns **exclusive** upper bound on object size. + /// Returns **exclusive** upper bound on object size in bytes. /// /// The theoretical maximum object size is defined as the maximum positive `isize` value. /// This ensures that the `offset` semantics remain well-defined by allowing it to correctly /// index every address within an object along with one byte past the end, along with allowing /// `isize` to store the difference between any two pointers into an object. /// - /// LLVM uses a 64-bit integer to represent object size in bits, but we care only for bytes, - /// so we adopt such a more-constrained address space due to its technical limitations. + /// LLVM uses a 64-bit integer to represent object size in *bits*, but we care only for bytes, + /// so we adopt such a more-constrained size bound due to its technical limitations. #[inline] pub fn obj_size_bound(&self) -> u64 { match self.pointer_size.bits() { |
