-
Notifications
You must be signed in to change notification settings - Fork 13.6k
doc test: fix mpsc.rs try_send doc test #145299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
r? @ibraheemdev rustbot has assigned @ibraheemdev. Use |
fabea18
to
14c02d5
Compare
I can't approve this because I'm not on the appropriate team, but it does seem simpler and more reliable than the existing test. r? libs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the correct fix here is to change to single-threaded: mpsc is, after all, meant to be used in multithreaded environments.
The correct thing to do here is save the handles from spawn
and .join
them at the end of the test https://doc.rust-lang.org/std/thread/fn.spawn.html#examples
Thank you, I will push another commit to moidfy the doctest. |
Signed-off-by: Eval EXEC <execvy@gmail.com>
14c02d5
to
a0eea23
Compare
This Pr want to fix the doctest, to make #145293 's CI pass:
r? @Zalathar
https://github.com/rust-lang/rust/actions/runs/16903356990/job/47887354221