Skip to content

Commit d0b9833

Browse files
committed
review feedback: comments and spacing
1 parent be07911 commit d0b9833

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/librustc/ty/layout.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -2529,8 +2529,9 @@ where
25292529
attrs.pointee_align = Some(pointee.align);
25302530

25312531
// `Box` (`UniqueBorrowed`) are not necessarily dereferencable
2532-
// for the entire duration of the function, so set their size to 0.
2533-
attrs.pointee_size = match kind {
2532+
// for the entire duration of the function as they can be deallocated
2533+
// any time. Set their valid size to 0.
2534+
attrs.pointee_size = match kind {
25342535
PointerKind::UniqueOwned => Size::ZERO,
25352536
_ => pointee.size
25362537
};

src/librustc_target/abi/call/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ mod attr_impl {
6969
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
7070
pub struct ArgAttributes {
7171
pub regular: ArgAttribute,
72-
/// The dereferenceable size of the pointee.
72+
/// The minimum size of the pointee, guaranteed to be valid for the duration of the whole call
73+
/// (corresponding to LLVM's dereferenceable and dereferenceable_or_null attributes).
7374
pub pointee_size: Size,
7475
pub pointee_align: Option<Align>
7576
}

0 commit comments

Comments
 (0)