Skip to content

Commit d872d7f

Browse files
authored
Rollup merge of #89789 - jkugelman:must-use-thread-builder, r=joshtriplett
Add #[must_use] to thread::Builder I copied the wording of the [`fmt::Debug` builders](https://doc.rust-lang.org/src/core/fmt/builders.rs.html#444). Affects: ```rust std/src/thread/mod.rs:289:5 std::thread::Builder fn new() -> Builder; std/src/thread/mod.rs:318:5 std::thread::Builder fn name(mut self, name: String) -> Builder; std/src/thread/mod.rs:341:5 std::thread::Builder fn stack_size(mut self, size: usize) -> Builder; ``` Parent issue: #89692 r? `@joshtriplett`
2 parents 2609fab + 6a8311c commit d872d7f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/std/src/thread/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ pub const fn require_unstable_const_init_thread_local() {}
257257
/// [`unwrap`]: crate::result::Result::unwrap
258258
/// [naming-threads]: ./index.html#naming-threads
259259
/// [stack-size]: ./index.html#stack-size
260+
#[must_use = "must eventually spawn the thread"]
260261
#[stable(feature = "rust1", since = "1.0.0")]
261262
#[derive(Debug)]
262263
pub struct Builder {

0 commit comments

Comments
 (0)