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

Add lint for publically constructable Unsafe types #13664

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

Conversation

GnomedDev
Copy link
Contributor

This is a pretty dangerous mistake that I feel like is really easy to run into with this pattern, and someone did recently on the Rust community discord (although with Unprotected instead of Unsafe), so let's get this linted against.

changelog: [constructable_unsafe_type]: Add lint for publically constructable Unsafe types

@rustbot
Copy link
Collaborator

rustbot commented Nov 8, 2024

r? @Alexendoo

rustbot has assigned @Alexendoo.
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 Nov 8, 2024
@GnomedDev GnomedDev force-pushed the public-unsafe-token branch from a4ff175 to 0743df2 Compare November 8, 2024 01:27
@GnomedDev
Copy link
Contributor Author

I just got the suggestion to change this from linting based on type name to linting if the only function constructors are unsafe, which sounds like a better idea.

@GnomedDev GnomedDev marked this pull request as draft November 8, 2024 01:40
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