]> git.lizzy.rs Git - rust.git/commitdiff
review feedback: comments and spacing
authorRalf Jung <post@ralfj.de>
Mon, 25 Nov 2019 21:45:00 +0000 (22:45 +0100)
committerRalf Jung <post@ralfj.de>
Mon, 25 Nov 2019 21:45:00 +0000 (22:45 +0100)
src/librustc/ty/layout.rs
src/librustc_target/abi/call/mod.rs

index e14a78a8c44ca5aeb2e14827ca23b53360a5125c..c67e6a0a13e635578d6213af168644cfddd46ec1 100644 (file)
@@ -2529,8 +2529,9 @@ fn new_internal(
                     attrs.pointee_align = Some(pointee.align);
 
                     // `Box` (`UniqueBorrowed`) are not necessarily dereferencable
-                    // for the entire duration of the function, so set their size to 0.
-                    attrs.pointee_size =  match kind {
+                    // for the entire duration of the function as they can be deallocated
+                    // any time. Set their valid size to 0.
+                    attrs.pointee_size = match kind {
                         PointerKind::UniqueOwned => Size::ZERO,
                         _ => pointee.size
                     };
index 1b55676fe4f98dd3a79f2817e5a880dfad71f24f..3a3ad763790ba49baa3507d9459f88da0ac83984 100644 (file)
@@ -69,7 +69,8 @@ pub struct ArgAttribute: u16 {
 #[derive(Copy, Clone, PartialEq, Eq, Debug)]
 pub struct ArgAttributes {
     pub regular: ArgAttribute,
-    /// The dereferenceable size of the pointee.
+    /// The minimum size of the pointee, guaranteed to be valid for the duration of the whole call
+    /// (corresponding to LLVM's dereferenceable and dereferenceable_or_null attributes).
     pub pointee_size: Size,
     pub pointee_align: Option<Align>
 }