Add #[must_not_suspend] to some types in std#89303
Conversation
|
r? @dtolnay (rust-highfive has picked a reviewer for you, use r? to override) |
library/std/src/sync/mutex.rs
Outdated
| not(bootstrap), | ||
| must_not_suspend = "Holding a MutexGuard across suspend \ | ||
| points can cause deadlocks, delays, \ | ||
| and cause Future's to not implement `Send`" |
There was a problem hiding this comment.
A plural-s does not go with an apostrophe (same issue rwlock.rs).
|
I would personally really like to see it on |
dtolnay
left a comment
There was a problem hiding this comment.
The RFC explicitly calls out MutexGuard as a motivation for the lint, so that one is a no-brainer. The other types here are all very clearly in the same category as MutexGuard — LGTM.
|
@bors r+ |
|
📌 Commit cb8e83c has been approved by |
|
Cross linking tracking issue. #83310 |
Add `#[must_not_suspend]` to some types in std I am not sure what else should have it? `Ref`?
Add `#[must_not_suspend]` to some types in std I am not sure what else should have it? `Ref`?
…arth Rollup of 8 pull requests Successful merges: - rust-lang#88782 (Fix ICE when `start` lang item has wrong generics) - rust-lang#89202 (Resolve infered types when complaining about unexpected call type ) - rust-lang#89248 (Suggest similarly named associated items in trait impls) - rust-lang#89303 (Add `#[must_not_suspend]` to some types in std) - rust-lang#89306 (thread: implements available_concurrency on haiku) - rust-lang#89314 (fix(lint): don't suggest refutable patterns to "fix" irrefutable bind) - rust-lang#89370 (CTFE: tweak aggregate rvalue handling) - rust-lang#89392 (bootstrap: Update comment in config.library.toml.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
I am not sure what else should have it?
Ref?