nonpoison::Condvar should take MutexGuard by reference#148343
nonpoison::Condvar should take MutexGuard by reference#148343bors merged 3 commits intorust-lang:masterfrom
nonpoison::Condvar should take MutexGuard by reference#148343Conversation
Setup for writing different tests for the `nonpoison::Condvar` since it will have a different API. Signed-off-by: Connor Tsui <[email protected]>
nonpoison::Condvar should take MutexGuard by reference
The poisoning version had to return a |
6c86243 to
2f152f1
Compare
Since non-poisoning `Condvar` take non-poisoing `Mutex`es when `wait`ing, we do not need to take by ownership since a poison error cannot occur while we wait. Signed-off-by: Connor Tsui <[email protected]>
Signed-off-by: Connor Tsui <[email protected]>
2f152f1 to
c1153b0
Compare
|
Ah I was thinking theoretically it could also have just returned a |
|
There is no poison flag in the |
|
Thanks for the quick review! I just changed a few other things on top of the comments (use |
|
@bors r+ |
|
Make sure to also update the signatures in the tracking issue. |
…Amanieu `nonpoison::Condvar` should take `MutexGuard` by reference Feature: `#![feature(nonpoison_condvar)]` Tracking Issue: rust-lang#134645 Specific comment: rust-lang#134645 (comment) Changes the `nonpoison::Condvar` API to take `MutexGuard` by reference instead of ownership. I'm actually not entirely sure why the current poison variant of `Condvar` takes by ownership, is it just legacy reasons? Additionally, the `nonpoison_and_poison_unwrap_test` macro doesn't really make sense anymore now that the APIs are completely different, so this reverts that change from a few months ago. r? `@Amanieu`
…Amanieu `nonpoison::Condvar` should take `MutexGuard` by reference Feature: `#![feature(nonpoison_condvar)]` Tracking Issue: rust-lang#134645 Specific comment: rust-lang#134645 (comment) Changes the `nonpoison::Condvar` API to take `MutexGuard` by reference instead of ownership. I'm actually not entirely sure why the current poison variant of `Condvar` takes by ownership, is it just legacy reasons? Additionally, the `nonpoison_and_poison_unwrap_test` macro doesn't really make sense anymore now that the APIs are completely different, so this reverts that change from a few months ago. r? ``@Amanieu``
…Amanieu `nonpoison::Condvar` should take `MutexGuard` by reference Feature: `#![feature(nonpoison_condvar)]` Tracking Issue: rust-lang#134645 Specific comment: rust-lang#134645 (comment) Changes the `nonpoison::Condvar` API to take `MutexGuard` by reference instead of ownership. I'm actually not entirely sure why the current poison variant of `Condvar` takes by ownership, is it just legacy reasons? Additionally, the `nonpoison_and_poison_unwrap_test` macro doesn't really make sense anymore now that the APIs are completely different, so this reverts that change from a few months ago. r? ```@Amanieu```
Rollup of 10 pull requests Successful merges: - #135602 (Tweak output of missing lifetime on associated type) - #139751 (Implement pin-project in pattern matching for `&pin mut|const T`) - #142682 (Update bundled musl to 1.2.5) - #148171 (Simplify code to generate line numbers in highlight) - #148263 (Unpin `libc` and `rustix` in `compiler` and `rustbook`) - #148301 ([rustdoc search] Include extern crates when filtering on `import`) - #148330 (Don't require dlltool with the dummy backend on MinGW) - #148338 (cleanup: upstream dropped amx-transpose functionality) - #148340 (Clippy subtree update) - #148343 (`nonpoison::Condvar` should take `MutexGuard` by reference) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 10 pull requests Successful merges: - #135602 (Tweak output of missing lifetime on associated type) - #139751 (Implement pin-project in pattern matching for `&pin mut|const T`) - #142682 (Update bundled musl to 1.2.5) - #148171 (Simplify code to generate line numbers in highlight) - #148263 (Unpin `libc` and `rustix` in `compiler` and `rustbook`) - #148301 ([rustdoc search] Include extern crates when filtering on `import`) - #148330 (Don't require dlltool with the dummy backend on MinGW) - #148338 (cleanup: upstream dropped amx-transpose functionality) - #148340 (Clippy subtree update) - #148343 (`nonpoison::Condvar` should take `MutexGuard` by reference) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #148343 - connortsui20:guard-ref-condvar, r=Amanieu `nonpoison::Condvar` should take `MutexGuard` by reference Feature: `#![feature(nonpoison_condvar)]` Tracking Issue: #134645 Specific comment: #134645 (comment) Changes the `nonpoison::Condvar` API to take `MutexGuard` by reference instead of ownership. I'm actually not entirely sure why the current poison variant of `Condvar` takes by ownership, is it just legacy reasons? Additionally, the `nonpoison_and_poison_unwrap_test` macro doesn't really make sense anymore now that the APIs are completely different, so this reverts that change from a few months ago. r? ````@Amanieu````
…Amanieu `nonpoison::Condvar` should take `MutexGuard` by reference Feature: `#![feature(nonpoison_condvar)]` Tracking Issue: rust-lang#134645 Specific comment: rust-lang#134645 (comment) Changes the `nonpoison::Condvar` API to take `MutexGuard` by reference instead of ownership. I'm actually not entirely sure why the current poison variant of `Condvar` takes by ownership, is it just legacy reasons? Additionally, the `nonpoison_and_poison_unwrap_test` macro doesn't really make sense anymore now that the APIs are completely different, so this reverts that change from a few months ago. r? ````@Amanieu````
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#135602 (Tweak output of missing lifetime on associated type) - rust-lang#139751 (Implement pin-project in pattern matching for `&pin mut|const T`) - rust-lang#142682 (Update bundled musl to 1.2.5) - rust-lang#148171 (Simplify code to generate line numbers in highlight) - rust-lang#148263 (Unpin `libc` and `rustix` in `compiler` and `rustbook`) - rust-lang#148301 ([rustdoc search] Include extern crates when filtering on `import`) - rust-lang#148330 (Don't require dlltool with the dummy backend on MinGW) - rust-lang#148338 (cleanup: upstream dropped amx-transpose functionality) - rust-lang#148340 (Clippy subtree update) - rust-lang#148343 (`nonpoison::Condvar` should take `MutexGuard` by reference) r? `@ghost` `@rustbot` modify labels: rollup
Feature:
#![feature(nonpoison_condvar)]Tracking Issue: #134645
Specific comment: #134645 (comment)
Changes the
nonpoison::CondvarAPI to takeMutexGuardby reference instead of ownership.I'm actually not entirely sure why the current poison variant of
Condvartakes by ownership, is it just legacy reasons?Additionally, the
nonpoison_and_poison_unwrap_testmacro doesn't really make sense anymore now that the APIs are completely different, so this reverts that change from a few months ago.r? @Amanieu