about summary refs log tree commit diff
path: root/library/core/src/alloc
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2021-10-11 14:11:43 +0200
committerGitHub <noreply@github.com>2021-10-11 14:11:43 +0200
commit77be7e441a32ae160bc79dba1a28c1c2839a3a19 (patch)
tree4cabb802ad177aa466e055cb9b811dde7e276a47 /library/core/src/alloc
parentd7c9693401e590cce78ea74d8576a124266025d6 (diff)
parent5b5c12be1cf2b2531a1cbf7097d2b5102cfaccd8 (diff)
downloadrust-77be7e441a32ae160bc79dba1a28c1c2839a3a19.tar.gz
rust-77be7e441a32ae160bc79dba1a28c1c2839a3a19.zip
Rollup merge of #89729 - jkugelman:must-use-core-std-constructors, r=joshtriplett
Add #[must_use] to core and std constructors

Parent issue: #89692

r? ``@joshtriplett``
Diffstat (limited to 'library/core/src/alloc')
-rw-r--r--library/core/src/alloc/layout.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/library/core/src/alloc/layout.rs b/library/core/src/alloc/layout.rs
index ccf6e420de7..c98aa38e3df 100644
--- a/library/core/src/alloc/layout.rs
+++ b/library/core/src/alloc/layout.rs
@@ -119,6 +119,7 @@ impl Layout {
     /// Constructs a `Layout` suitable for holding a value of type `T`.
     #[stable(feature = "alloc_layout", since = "1.28.0")]
     #[rustc_const_stable(feature = "alloc_layout_const_new", since = "1.42.0")]
+    #[must_use]
     #[inline]
     pub const fn new<T>() -> Self {
         let (size, align) = size_align::<T>();