Skip to content
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

Adjusted some doctests in libcore to use should_panic. #73302

Merged
merged 1 commit into from
Jun 13, 2020

Conversation

JakobDegen
Copy link
Contributor

Fixes #73196 .

I grepped libstd and libcore for all the instances of this pattern that I could find, but its possible that I missed some of course. If anyone knows of any more, please let me know and I will add them to the PR.

Previously, some doctests were spawning new threads and joining them to
indicate that a particular call should panic; this hurt readability, so
the tests have been adjusted to simply call the method and use the
`should_panic` marker.
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @hanna-kruppe (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 13, 2020
@hanna-kruppe
Copy link
Contributor

Thanks! @bors r+

@bors
Copy link
Contributor

bors commented Jun 13, 2020

📌 Commit 3ab4b38 has been approved by hanna-kruppe

@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 Jun 13, 2020
@Mark-Simulacrum
Copy link
Member

r? @Mark-Simulacrum

This looks like it hits all of the cases I can quickly find by grepping so let's go ahead, we can always have more PRs later if necessary :)

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jun 13, 2020

💡 This pull request was already approved, no need to approve it again.

@bors
Copy link
Contributor

bors commented Jun 13, 2020

📌 Commit 3ab4b38 has been approved by Mark-Simulacrum

@Mark-Simulacrum
Copy link
Member

oh gah, Github decided not to show the previous comment. ignore me :)

bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 13, 2020
Rollup of 8 pull requests

Successful merges:

 - rust-lang#72932 (Clarify the behaviour of Pattern when used with methods like str::contains)
 - rust-lang#73066 (Querify whether a type has structural equality (Take 2))
 - rust-lang#73194 (Prefer the associated constants for pattern matching error)
 - rust-lang#73241 (Add/update comments about MinGW late_link_args)
 - rust-lang#73267 (Use the built cargo for cargotest.)
 - rust-lang#73290 (Fix links when pinging notification groups)
 - rust-lang#73302 (Adjusted some doctests in libcore to use `should_panic`.)
 - rust-lang#73308 (pretty/asm.rs should only be tested for x86_64 and not AArch64)

Failed merges:

r? @ghost
@bors bors merged commit a879f9c into rust-lang:master Jun 13, 2020
@JakobDegen JakobDegen deleted the should-panic-documentation branch June 14, 2020 12:32
@cuviper cuviper added this to the 1.46 milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Different styles between examples that should panic
6 participants