From e4c5e86228b2f284577e7e0a115e2c9c9214e573 Mon Sep 17 00:00:00 2001 From: John Kugelman Date: Mon, 11 Oct 2021 17:25:47 -0400 Subject: [PATCH 1/2] Add #[must_use] to thread::Builder --- library/std/src/thread/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/library/std/src/thread/mod.rs b/library/std/src/thread/mod.rs index 7d404aff30e07..f141546b6460d 100644 --- a/library/std/src/thread/mod.rs +++ b/library/std/src/thread/mod.rs @@ -257,6 +257,7 @@ pub const fn require_unstable_const_init_thread_local() {} /// [`unwrap`]: crate::result::Result::unwrap /// [naming-threads]: ./index.html#naming-threads /// [stack-size]: ./index.html#stack-size +#[must_use = "must eventually call `spawn()` on Thread builders"] #[stable(feature = "rust1", since = "1.0.0")] #[derive(Debug)] pub struct Builder { From 6a8311cbfd19eccb57b1a1fa6974bc77db723f4a Mon Sep 17 00:00:00 2001 From: John Kugelman Date: Tue, 12 Oct 2021 10:48:27 -0400 Subject: [PATCH 2/2] Update library/std/src/thread/mod.rs Co-authored-by: Josh Triplett --- library/std/src/thread/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/thread/mod.rs b/library/std/src/thread/mod.rs index f141546b6460d..53aa10c592e39 100644 --- a/library/std/src/thread/mod.rs +++ b/library/std/src/thread/mod.rs @@ -257,7 +257,7 @@ pub const fn require_unstable_const_init_thread_local() {} /// [`unwrap`]: crate::result::Result::unwrap /// [naming-threads]: ./index.html#naming-threads /// [stack-size]: ./index.html#stack-size -#[must_use = "must eventually call `spawn()` on Thread builders"] +#[must_use = "must eventually spawn the thread"] #[stable(feature = "rust1", since = "1.0.0")] #[derive(Debug)] pub struct Builder {