Skip to content

Downgrade known buggy pointer cast suggestions to MaybeIncorrect. #15138

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

briansmith
Copy link

@briansmith briansmith commented Jun 25, 2025

See issues #12882 and #13910.

borrow_as_ptr was not changed since it does try to detect temporaries and initial testing did not find obvious bugs.

ptr_cast_constness was not changed since it isn't doing a reference-to-pointer conversion.

changelog: [cast_slice_from_raw_parts]: Disable --fix due to known soundness issues with suggestion.
changelog: [ptr_as_ptr.rs ]: Disable --fix due to known soundness issues with suggestion.
changelog: [ptr_cast_constness]: Disable --fix due to known soundness issues with suggestion.
changelog: [ref_as_ptr]: Disable --fix due to known soundness issues with suggestion.

@rustbot
Copy link
Collaborator

rustbot commented Jun 25, 2025

r? @samueltardieu

rustbot has assigned @samueltardieu.
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 rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jun 25, 2025
@rustbot

This comment has been minimized.

`borrow_as_ptr` was not changed since it does try to detect
temporaries and initial testing did not find obvious bugs.

`ptr_cast_constness` was not changed since it isn't doing a
reference-to-pointer conversion.
@briansmith briansmith force-pushed the b/as_ptr_maybeincorrect branch from e40f37c to 590949e Compare June 25, 2025 16:44
@briansmith
Copy link
Author

I noticed that CI passed even though I didn't modify any tests. So I guess this means we're not testing the MachineApplicability of these lints. And/or perhaps we're not testing the MachineApplicability of lints in general? It does seem like such tests would be useful to add since the goal is to ensure that such suggestions aren't applied by --fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants