Skip to content

Fix the example in document for WaitTimeoutResult::timed_out #110056

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

Merged
merged 1 commit into from
Jul 30, 2023

Conversation

chenyukang
Copy link
Member

Fixes #110045

@rustbot
Copy link
Collaborator

rustbot commented Apr 7, 2023

r? @thomcc

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Apr 7, 2023
@rustbot
Copy link
Collaborator

rustbot commented Apr 7, 2023

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@chenyukang
Copy link
Member Author

r? libs

@rustbot rustbot assigned joshtriplett and unassigned thomcc Apr 29, 2023
@chenyukang
Copy link
Member Author

r? libs

@rustbot rustbot assigned cuviper and unassigned joshtriplett Jun 3, 2023
Comment on lines 24 to 25
/// This example spawns a thread which will sleep 20 milliseconds before
/// updating the condvar and then notify.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where you're going seems like a good direction but currently it ends up at... "and then notify"... notify what?

Comment on lines 27 to 28
/// The main thread will wait with a timeout with only 10 milliseconds on the condvar
/// and will leave once timeout
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"with a timeout with"... This could be constructed more like "with a 10 millisecond timeout".

And what is the thread "leaving"? The loop, right? But it could be clearer.

@workingjubilee
Copy link
Member

@rustbot author
r? workingjubilee

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 30, 2023
@rustbot rustbot assigned workingjubilee and unassigned cuviper Jul 30, 2023
@chenyukang chenyukang force-pushed the yukang/fix-110045 branch 2 times, most recently from 78fee78 to 5d11c20 Compare July 30, 2023 08:20
@chenyukang
Copy link
Member Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 30, 2023
Copy link
Member

@workingjubilee workingjubilee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better! Just a little bit more?

@workingjubilee workingjubilee added the A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools label Jul 30, 2023
@workingjubilee
Copy link
Member

Side thought: It'd be cute if this example showed that the condvar's timeout and notification status can differ, but that's not a requirement. This still addresses the concern in question.

@workingjubilee
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jul 30, 2023

📌 Commit d67d989 has been approved by workingjubilee

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 30, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 30, 2023
…rkingjubilee

Fix the example in document for WaitTimeoutResult::timed_out

Fixes rust-lang#110045
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 30, 2023
…rkingjubilee

Fix the example in document for WaitTimeoutResult::timed_out

Fixes rust-lang#110045
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 30, 2023
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#110056 (Fix the example in document for WaitTimeoutResult::timed_out)
 - rust-lang#112655 (Mark `map_or` as `#[must_use]`)
 - rust-lang#114018 (Make `--error-format human-annotate-rs` handle multiple files)
 - rust-lang#114068 (inline format!() args up to and including rustc_middle (2))
 - rust-lang#114223 (Documentation: Fix Stilted Language in Vec->Indexing)
 - rust-lang#114227 (Add tidy check for stray rustfix files)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit e517ee0 into rust-lang:master Jul 30, 2023
@rustbot rustbot added this to the 1.73.0 milestone Jul 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Documentation mismatch for WaitTimeoutResult::timed_out
8 participants