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:🧵:Builder   fn new() -> Builder;
std/src/thread/mod.rs:318:5   std:🧵:Builder   fn name(mut self, name: String) -> Builder;
std/src/thread/mod.rs:341:5   std:🧵:Builder   fn stack_size(mut self, size: usize) -> Builder;
```

Parent issue: #89692

r? `@joshtriplett`
This commit is contained in:
Matthias Krüger 2021-10-31 00:33:23 +02:00 committed by GitHub
commit d872d7fd00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 spawn the thread"]
#[stable(feature = "rust1", since = "1.0.0")]
#[derive(Debug)]
pub struct Builder {