Skip to content

Commit cf78f26

Browse files
compiler: Precisely name units of object size
Co-authored-by: Ralf Jung <[email protected]>
1 parent d93d2f1 commit cf78f26

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/rustc_abi/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -337,15 +337,15 @@ impl TargetDataLayout {
337337
Ok(dl)
338338
}
339339

340-
/// Returns **exclusive** upper bound on object size.
340+
/// Returns **exclusive** upper bound on object size in bytes.
341341
///
342342
/// The theoretical maximum object size is defined as the maximum positive `isize` value.
343343
/// This ensures that the `offset` semantics remain well-defined by allowing it to correctly
344344
/// index every address within an object along with one byte past the end, along with allowing
345345
/// `isize` to store the difference between any two pointers into an object.
346346
///
347-
/// LLVM uses a 64-bit integer to represent object size in bits, but we care only for bytes,
348-
/// so we adopt such a more-constrained address space due to its technical limitations.
347+
/// LLVM uses a 64-bit integer to represent object size in *bits*, but we care only for bytes,
348+
/// so we adopt such a more-constrained size bound due to its technical limitations.
349349
#[inline]
350350
pub fn obj_size_bound(&self) -> u64 {
351351
match self.pointer_size.bits() {

0 commit comments

Comments
 (0)