-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Fix unused_unsafe
around await
#86517
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
r? @varkor (rust-highfive has picked a reviewer for you, use r? to override) |
I can probably review this, r? @LeSeulArtichaut |
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.
Okay, I see what went wrong in #85421. Let's add a couple comments to prevent future mistakes.
106517a
to
b07bb6d
Compare
All comments addressed. |
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.
r=me once CI passes
@bors r+ |
📌 Commit b07bb6d has been approved by |
…eSeulArtichaut Fix `unused_unsafe` around `await` Enables `unused_unsafe` lint for `unsafe { future.await }`. The existing test for this is `unsafe { println!() }`, so I assume that `println!` used to contain compiler-generated unsafe but this is no longer true, and so the existing test is broken. I replaced the test with `unsafe { ...await }`. I believe `await` is currently the only instance of compiler-generated unsafe. Reverts some parts of rust-lang#85421, but the issue predates that PR.
…eSeulArtichaut Fix `unused_unsafe` around `await` Enables `unused_unsafe` lint for `unsafe { future.await }`. The existing test for this is `unsafe { println!() }`, so I assume that `println!` used to contain compiler-generated unsafe but this is no longer true, and so the existing test is broken. I replaced the test with `unsafe { ...await }`. I believe `await` is currently the only instance of compiler-generated unsafe. Reverts some parts of rust-lang#85421, but the issue predates that PR.
Rollup of 6 pull requests Successful merges: - rust-lang#86393 (Add regression test for issue rust-lang#52025) - rust-lang#86402 (rustdoc: add optional woff2 versions of Source Serif and Source Code) - rust-lang#86451 (Resolve intra-doc links in summary desc) - rust-lang#86501 (Cleanup handling of `crate_name` for doctests) - rust-lang#86517 (Fix `unused_unsafe` around `await`) - rust-lang#86537 (Mark some edition tests as check-pass) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Enables
unused_unsafe
lint forunsafe { future.await }
.The existing test for this is
unsafe { println!() }
, so I assume thatprintln!
used to contain compiler-generated unsafe but this is no longer true, and so the existing test is broken. I replaced the test withunsafe { ...await }
. I believeawait
is currently the only instance of compiler-generated unsafe.Reverts some parts of #85421, but the issue predates that PR.