Skip to content

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

Merged
merged 1 commit into from
Jun 22, 2021
Merged

Conversation

camsteffen
Copy link
Contributor

@camsteffen camsteffen commented Jun 21, 2021

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 #85421, but the issue predates that PR.

@rust-highfive
Copy link
Contributor

r? @varkor

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 21, 2021
@LeSeulArtichaut
Copy link
Contributor

I can probably review this, r? @LeSeulArtichaut

Copy link
Contributor

@LeSeulArtichaut LeSeulArtichaut left a 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.

@camsteffen camsteffen force-pushed the unused-unsafe-async branch from 106517a to b07bb6d Compare June 21, 2021 22:26
@camsteffen
Copy link
Contributor Author

All comments addressed.

Copy link
Contributor

@LeSeulArtichaut LeSeulArtichaut left a 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

@LeSeulArtichaut
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Jun 21, 2021

📌 Commit b07bb6d has been approved by LeSeulArtichaut

@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 21, 2021
fee1-dead added a commit to fee1-dead-contrib/rust that referenced this pull request Jun 22, 2021
…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.
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Jun 22, 2021
…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.
This was referenced Jun 22, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 22, 2021
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
@bors bors merged commit 8ec4e7d into rust-lang:master Jun 22, 2021
@rustbot rustbot added this to the 1.55.0 milestone Jun 22, 2021
# for free to join this conversation on GitHub. Already have an account? # 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.

6 participants