about summary refs log tree commit diff
path: root/library/std/src/sync
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-10-11 14:16:15 +0000
committerbors <bors@rust-lang.org>2021-10-11 14:16:15 +0000
commit1067e2ca5e9cfe5c79f956e49ffc684c5142d49b (patch)
treee5f2a3b0156efd5a28e933c42629ce4b443f0b9a /library/std/src/sync
parent6ae8912a3e7d2c4c775024f58a7ba4b1aedc4073 (diff)
parent913b1de0ec1da8cdf5e8ad1c418fe4ad61e1e79d (diff)
downloadrust-1067e2ca5e9cfe5c79f956e49ffc684c5142d49b.tar.gz
rust-1067e2ca5e9cfe5c79f956e49ffc684c5142d49b.zip
Auto merge of #89767 - GuillaumeGomez:rollup-sczixhk, r=GuillaumeGomez
Rollup of 7 pull requests

Successful merges:

 - #89655 (bootstrap: don't use `--merges` to look for commit hashes for downloading artifacts)
 - #89726 (Add #[must_use] to alloc constructors)
 - #89729 (Add #[must_use] to core and std constructors)
 - #89743 (Fix RUSTC_LOG handling)
 - #89753 (Add #[must_use] to from_value conversions)
 - #89754 (Cleanup .item-table CSS)
 - #89761 (:arrow_up: rust-analyzer)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src/sync')
-rw-r--r--library/std/src/sync/barrier.rs1
-rw-r--r--library/std/src/sync/condvar.rs1
-rw-r--r--library/std/src/sync/once.rs1
3 files changed, 3 insertions, 0 deletions
diff --git a/library/std/src/sync/barrier.rs b/library/std/src/sync/barrier.rs
index a17b82f82e8..0e28a2d166f 100644
--- a/library/std/src/sync/barrier.rs
+++ b/library/std/src/sync/barrier.rs
@@ -80,6 +80,7 @@ impl Barrier {
     /// let barrier = Barrier::new(10);
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
+    #[must_use]
     pub fn new(n: usize) -> Barrier {
         Barrier {
             lock: Mutex::new(BarrierState { count: 0, generation_id: 0 }),
diff --git a/library/std/src/sync/condvar.rs b/library/std/src/sync/condvar.rs
index 00a4afc5705..d8aca9651b8 100644
--- a/library/std/src/sync/condvar.rs
+++ b/library/std/src/sync/condvar.rs
@@ -121,6 +121,7 @@ impl Condvar {
     /// let condvar = Condvar::new();
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
+    #[must_use]
     pub fn new() -> Condvar {
         Condvar { inner: sys::Condvar::new() }
     }
diff --git a/library/std/src/sync/once.rs b/library/std/src/sync/once.rs
index a2e935a0ceb..1710c005393 100644
--- a/library/std/src/sync/once.rs
+++ b/library/std/src/sync/once.rs
@@ -186,6 +186,7 @@ impl Once {
     #[inline]
     #[stable(feature = "once_new", since = "1.2.0")]
     #[rustc_const_stable(feature = "const_once_new", since = "1.32.0")]
+    #[must_use]
     pub const fn new() -> Once {
         Once { state_and_queue: AtomicUsize::new(INCOMPLETE), _marker: marker::PhantomData }
     }