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

Lint casting integers to pointers #2177

Open
oli-obk opened this issue Oct 26, 2017 · 1 comment
Open

Lint casting integers to pointers #2177

oli-obk opened this issue Oct 26, 2017 · 1 comment
Labels
A-lint Area: New lints good-first-issue These issues are a good way to get started with Clippy T-middle Type: Probably requires verifiying types

Comments

@oli-obk
Copy link
Contributor

oli-obk commented Oct 26, 2017

rust-lang/rust#45527 gives us std::ptr::dangling which allows replacing 1 as _ with std::ptr::dangling(). Once that is stable, it should be a warn lint. Until then an allow lint is ok.

Should probably live together with the zero_ptr lint

@oli-obk oli-obk added good-first-issue These issues are a good way to get started with Clippy A-lint Area: New lints T-middle Type: Probably requires verifiying types labels Oct 26, 2017
@Rua
Copy link
Contributor

Rua commented Apr 30, 2024

Is anyone still interested in implementing this? Even if there is no fix that Clippy can propose, just giving the user the ability to track down such casts is already useful. Note that such casts create a pointer with no provenance, which can be particularly objectionable for future development of Rust code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints good-first-issue These issues are a good way to get started with Clippy T-middle Type: Probably requires verifiying types
Projects
None yet
Development

No branches or pull requests

2 participants