8000 clippy: -D unnecessary_cast by bradjc · Pull Request #3633 · tock/tock · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

clippy: -D unnecessary_cast #3633

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
Aug 25, 2023
Merged

clippy: -D unnecessary_cast #3633

merged 1 commit into from
Aug 25, 2023

Conversation

bradjc
Copy link
Contributor
@bradjc bradjc commented Aug 21, 2023

Pull Request Overview

This pull request updates the tock source so that we pass the unnecessary_cast lint.

Testing Strategy

travis

TODO or Help Wanted

n/a

Documentation Updated

  • Updated the relevant files in /docs, or no updates are required.

Formatting

  • Ran make prepush.

@github-actions github-actions bot added kernel sam4l Change pertains to the SAM4L MCU. nrf Change pertains to the nRF5x family of MCUs. tock-libraries This affects libraries supported by the Tock project HIL This affects a Tock HIL interface. risc-v RISC-V architecture WG-OpenTitan In the purview of the OpenTitan working group. stm32 Change pertains to the stm32 family of MCUSs labels Aug 21, 2023
Copy link
Member
@ppannuto ppannuto left a comment

Choose a reason for hiding this comment

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

I swear once upon a compiler a lot of these were required.

I kinda liked the intentionality of type conversion Rust asked for once upon a time, but the ergonomics of implicit conversion of unambiguous casts is admittedly nice.

@lschuermann
Copy link
Member

I kinda liked the intentionality of type conversion Rust asked for once upon a time, but the ergonomics of implicit conversion of unambiguous casts is admittedly nice.

I could be wrong, I don't think that's what's happening here. Rust only implicitly assumes an integer time for literals which aren't otherwise "driven to a type" (e.g. through the 1_usize). I believe many of these cases are just ones where we've changed the actual type underneath, such that our casts have literally become unnecessary.

@ppannuto ppannuto added the last-call Final review period for a pull request. label Aug 23, 2023
@alevy alevy added this pull request to the merge queue Aug 25, 2023
Merged via the queue into master with commit aa1259e Aug 25, 2023
@alevy alevy deleted the clippy-D-unnecessary_cast branch August 25, 2023 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HIL This affects a Tock HIL interface. kernel last-call Final review period for a pull request. nrf Change pertains to the nRF5x family of MCUs. risc-v RISC-V architecture sam4l Change pertains to the SAM4L MCU. stm32 Change pertains to the stm32 family of MCUSs tock-libraries This affects libraries supported by the Tock project WG-OpenTitan In the purview of the OpenTitan working group.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0