Skip to content

Commit 9501020

Browse files
committed
modify style for check
1 parent 242b2d2 commit 9501020

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/type-layout.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ own, `packed` does not provide any guarantee about field ordering). An
595595
important consequence of these rules is that a type with `#[repr(packed(1))]`
596596
(or `#[repr(packed)]`) will have no inter-field padding.
597597

598-
[r[layout.repr.packed.borrowing]]
598+
r[layout.repr.packed.borrowing]
599599
When borrowing a field of a `repr(packed(...))` struct, Rust must not create a **misaligned reference** (which would be undefined behavior). Therefore:
600600

601601
- It is a **hard error** (E0793) to create a reference whose **ABI alignment requirement** is **greater** than the struct’s packed alignment.
@@ -629,7 +629,7 @@ fn err<const N: usize>(t: &T<N>) -> &[u16] {
629629
Note: This is a hard error, not a lint. Implementations may determine the
630630
target's ABI alignment either directly from the borrowed type, or---when the full
631631
layout of an array is unavailable in generic contexts---by using the element type's
632-
alignment (align([T]) == align(T)). The check must remain conservative and never
632+
alignment (`align([T])` == `align(T)`). The check must remain conservative and never
633633
permit creating misaligned references.
634634

635635
r[layout.repr.alignment.constraint-exclusive]

0 commit comments

Comments
 (0)