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

Avoid unused Option::map results #71534

Merged
merged 1 commit into from
Apr 25, 2020
Merged

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Apr 24, 2020

These are changes that would be needed if we add #[must_use] to Option::map, per #71484.

r? @Mark-Simulacrum

These are changes that would be needed if we add `#[must_use]` to
`Option::map`, per rust-lang#71484.
@cuviper
Copy link
Member Author

cuviper commented Apr 24, 2020

Note: this only addresses the errors from ./x.py check with that #[must_use] in place. I didn't do a complete test run, and that attribute is not included in this PR. I'm just submitting this as an example of how far that would reach, and the changes mostly do look fine to me anyway.

@Mark-Simulacrum
Copy link
Member

@bors r+

I agree that all of these seem good regardless of whether we add must_use, but the quantity leads me to believe that just adding it isn't likely to be feasible -- there's just too much impact.

@bors
Copy link
Contributor

bors commented Apr 24, 2020

📌 Commit 2325c20 has been approved by Mark-Simulacrum

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Apr 24, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 24, 2020
Rollup of 8 pull requests

Successful merges:

 - rust-lang#69456 (fix misleading type annotation diagonstics)
 - rust-lang#71330 (Only run dataflow for const qualification if type-based check would fail)
 - rust-lang#71480 (Improve PanicInfo examples readability)
 - rust-lang#71485 (Add BinaryHeap::retain as suggested in rust-lang#42849)
 - rust-lang#71512 (Remove useless "" args)
 - rust-lang#71527 (Miscellaneous cleanup in `check_consts`)
 - rust-lang#71534 (Avoid unused Option::map results)
 - rust-lang#71535 (Fix typos in docs for keyword "in")

Failed merges:

r? @ghost
@bors bors merged commit d0db0a8 into rust-lang:master Apr 25, 2020
@cuviper cuviper deleted the unused-option-map branch May 30, 2020 21:55
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.

3 participants