fix(transmute_ptr_to_ptr): add parens if `transmute` is receiver of a projection
Fixes https://github.com/rust-lang/rust-clippy/issues/15003
changelog: [transmute_ptr_to_ptr]: add parens if transmute is receiver of a projection
r? @y21
rustbot has assigned @y21. They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.
Use r? to explicitly pick a reviewer
This really applies to all the transmute lints that suggest as, doesn't it...
This really applies to all the
transmutelints that suggestas, doesn't it...
More than that even. I think we should have, at some point, something like:
- a function which, given an
HirIdchecks whether inserting something in place of this node might need to be parenthesized (even better if it returns an associativity level) - a function which, given a suggestion, checks whether it might need to get parentheses (even better if it returns an associativity level)
- a function which, given an
HirIdand a suggestion, returns an updated suggestion with added parentheses if this is necessary
:umbrella: The latest upstream changes (possibly 45168a79cda13bbc8de32d6b4e304a75f2afb075) made this pull request unmergeable. Please resolve the merge conflicts.
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.
Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.
I think we should have, at some point, something like
But until that, this PR should be merged, right?..
Reviewer on vacation, let's reroll
r? clippy