Add is_disconnected functions to mpsc and mpmc channels#153170
Merged
rust-bors[bot] merged 3 commits intorust-lang:mainfrom Mar 19, 2026
Merged
Add is_disconnected functions to mpsc and mpmc channels#153170rust-bors[bot] merged 3 commits intorust-lang:mainfrom
rust-bors[bot] merged 3 commits intorust-lang:mainfrom
Conversation
Collaborator
|
rustbot has assigned @Mark-Simulacrum. Use Why was this reviewer chosen?The reviewer was selected based on:
|
Contributor
Author
|
@rustbot label +S-waiting-on-ACP |
This comment has been minimized.
This comment has been minimized.
c952a5b to
7adb9ba
Compare
a1phyr
reviewed
Feb 28, 2026
Contributor
Author
I added the following text to the documentation: /// Note that a return value of `false` does not guarantee the channel will
/// remain connected. The channel may be disconnected immediately after this method
/// returns, so a subsequent [`Sender::send`] may still fail with [`SendError`].
and subsequent versions for |
4 tasks
Contributor
Author
|
@rustbot label +S-waiting-on-review -S-waiting-on-ACP |
Contributor
Author
|
Currently I've put the methods for mpmc behind |
Member
|
@bors r+ rollup I think it seems reasonable either way but this setup seems fine for the feature gate. |
Contributor
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Mar 19, 2026
…ted, r=Mark-Simulacrum Add is_disconnected functions to mpsc and mpmc channels Add `is_disconnected()` functions to the `Sender` and `Receiver` of both `mpmc` an `mpsc` channels. ```rust std::sync::mpmc::Sender<T>::is_disconnected(&self) -> bool std::sync::mpmc::Receiver<T>::is_disconnected(&self) -> bool std::sync::mpsc::Sender<T>::is_disconnected(&self) -> bool std::sync::mpsc::Receiver<T>::is_disconnected(&self) -> bool ``` The `mpsc` methods are locked behind the `mpsc_is_disconnected` feature gate, which has no tracking issue yet. ACP: rust-lang/libs-team#748 Tracking issue: rust-lang#153668
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Mar 19, 2026
…ted, r=Mark-Simulacrum Add is_disconnected functions to mpsc and mpmc channels Add `is_disconnected()` functions to the `Sender` and `Receiver` of both `mpmc` an `mpsc` channels. ```rust std::sync::mpmc::Sender<T>::is_disconnected(&self) -> bool std::sync::mpmc::Receiver<T>::is_disconnected(&self) -> bool std::sync::mpsc::Sender<T>::is_disconnected(&self) -> bool std::sync::mpsc::Receiver<T>::is_disconnected(&self) -> bool ``` The `mpsc` methods are locked behind the `mpsc_is_disconnected` feature gate, which has no tracking issue yet. ACP: rust-lang/libs-team#748 Tracking issue: rust-lang#153668
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Mar 19, 2026
…ted, r=Mark-Simulacrum Add is_disconnected functions to mpsc and mpmc channels Add `is_disconnected()` functions to the `Sender` and `Receiver` of both `mpmc` an `mpsc` channels. ```rust std::sync::mpmc::Sender<T>::is_disconnected(&self) -> bool std::sync::mpmc::Receiver<T>::is_disconnected(&self) -> bool std::sync::mpsc::Sender<T>::is_disconnected(&self) -> bool std::sync::mpsc::Receiver<T>::is_disconnected(&self) -> bool ``` The `mpsc` methods are locked behind the `mpsc_is_disconnected` feature gate, which has no tracking issue yet. ACP: rust-lang/libs-team#748 Tracking issue: rust-lang#153668
rust-bors bot
pushed a commit
that referenced
this pull request
Mar 19, 2026
…uwer Rollup of 12 pull requests Successful merges: - #152870 (Do not enable split debuginfo for windows-gnu) - #153333 (Fix bootstrap rust build failure for vxworks) - #153681 (ci: add runners for vanilla LLVM 22) - #153824 (Add `Wake` diagnostic item for `alloc::task::Wake`) - #154077 (Optimize 128-bit integer formatting) - #154078 (`define_callbacks` tweaks) - #151905 (Split the `dec2flt::RawFloat` trait for easier reuse) - #153170 (Add is_disconnected functions to mpsc and mpmc channels) - #153804 (Derive Macro Eq: link to more detailed documentation) - #153974 (Point at return type when it is the source of the type expectation) - #154018 (simplify and remove `tests/ui/kindck` and related tests) - #154041 (bootstrap: Allow `--bless`ing changes to editor settings files)
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Mar 19, 2026
…ted, r=Mark-Simulacrum Add is_disconnected functions to mpsc and mpmc channels Add `is_disconnected()` functions to the `Sender` and `Receiver` of both `mpmc` an `mpsc` channels. ```rust std::sync::mpmc::Sender<T>::is_disconnected(&self) -> bool std::sync::mpmc::Receiver<T>::is_disconnected(&self) -> bool std::sync::mpsc::Sender<T>::is_disconnected(&self) -> bool std::sync::mpsc::Receiver<T>::is_disconnected(&self) -> bool ``` The `mpsc` methods are locked behind the `mpsc_is_disconnected` feature gate, which has no tracking issue yet. ACP: rust-lang/libs-team#748 Tracking issue: rust-lang#153668
This was referenced Mar 19, 2026
rust-bors bot
pushed a commit
that referenced
this pull request
Mar 19, 2026
…uwer Rollup of 19 pull requests Successful merges: - #152870 (Do not enable split debuginfo for windows-gnu) - #153333 (Fix bootstrap rust build failure for vxworks) - #153681 (ci: add runners for vanilla LLVM 22) - #153727 (When single impl can satisfy inference error, suggest type) - #153824 (Add `Wake` diagnostic item for `alloc::task::Wake`) - #154077 (Optimize 128-bit integer formatting) - #154078 (`define_callbacks` tweaks) - #151905 (Split the `dec2flt::RawFloat` trait for easier reuse) - #153170 (Add is_disconnected functions to mpsc and mpmc channels) - #153308 (Add hygiene annotations for tokens in `macro_rules!` bodies) - #153557 (fix inference variables leaking into HIR const literal lowering logic) - #153804 (Derive Macro Eq: link to more detailed documentation) - #153913 (Fix some suggestions of the `for-loops-over-fallibles` lint) - #153974 (Point at return type when it is the source of the type expectation) - #153987 (mGCA: Lower const generic args to infer when needed) - #154018 (simplify and remove `tests/ui/kindck` and related tests) - #154036 (borrowck/type_check: remove helper left-over from unsized locals) - #154038 (merge `regions-outlives-nominal-type-*` tests into one file) - #154041 (bootstrap: Allow `--bless`ing changes to editor settings files)
rust-bors bot
pushed a commit
that referenced
this pull request
Mar 19, 2026
…uwer Rollup of 19 pull requests Successful merges: - #152870 (Do not enable split debuginfo for windows-gnu) - #153333 (Fix bootstrap rust build failure for vxworks) - #153681 (ci: add runners for vanilla LLVM 22) - #153727 (When single impl can satisfy inference error, suggest type) - #153824 (Add `Wake` diagnostic item for `alloc::task::Wake`) - #154077 (Optimize 128-bit integer formatting) - #154078 (`define_callbacks` tweaks) - #151905 (Split the `dec2flt::RawFloat` trait for easier reuse) - #153170 (Add is_disconnected functions to mpsc and mpmc channels) - #153308 (Add hygiene annotations for tokens in `macro_rules!` bodies) - #153557 (fix inference variables leaking into HIR const literal lowering logic) - #153804 (Derive Macro Eq: link to more detailed documentation) - #153913 (Fix some suggestions of the `for-loops-over-fallibles` lint) - #153974 (Point at return type when it is the source of the type expectation) - #153987 (mGCA: Lower const generic args to infer when needed) - #154018 (simplify and remove `tests/ui/kindck` and related tests) - #154036 (borrowck/type_check: remove helper left-over from unsized locals) - #154038 (merge `regions-outlives-nominal-type-*` tests into one file) - #154041 (bootstrap: Allow `--bless`ing changes to editor settings files)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
is_disconnected()functions to theSenderandReceiverof bothmpmcanmpscchannels.The
mpscmethods are locked behind thempsc_is_disconnectedfeature gate, which has no tracking issue yet.ACP: rust-lang/libs-team#748
Tracking issue: #153668