rust-clippy icon indicating copy to clipboard operation
rust-clippy copied to clipboard

Clean up transmute lints' documentation

Open felix91gr opened this issue 5 months ago • 4 comments

  1. Converted example calls of transmute from core::intrinsics::transmute to std::mem::transmute.
  2. Added missing unsafe block for transmute_ptr_to_ref's example
  3. Added more context to useless_transmute's example
  4. Added a missing space in a doc comment
  5. Added MSRV handling to transmute_ptr_to_ref, such that it handles const contexts gracefully. This fixes its known and documented problem of giving the wrong suggestion prior to 1.58 and 1.83 for transmutation of *const and *mut pointers, respectively.

changelog: transmute_ptr_to_ref fixed FP in const contexts, where under low values of MSRV, alternatives to transmutation didn't exist.

felix91gr avatar Sep 19 '25 01:09 felix91gr

r? @Jarcho

rustbot has assigned @Jarcho. 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

rustbot avatar Sep 19 '25 01:09 rustbot

Documentation changes don't need changelog lines in the PR description.

View changes since this review

Oh thank god, this is so much better! Thx, Jason!

felix91gr avatar Sep 25 '25 17:09 felix91gr

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.

rustbot avatar Nov 17 '25 22:11 rustbot

:umbrella: The latest upstream changes (possibly 06ded880d28bbac87affd8fac3ac72a216021b60) made this pull request unmergeable. Please resolve the merge conflicts.

rustbot avatar Dec 10 '25 15:12 rustbot