Skip to content

"ctypes" lint name is confusing #14704

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

Closed
brson opened this issue Jun 6, 2014 · 6 comments
Closed

"ctypes" lint name is confusing #14704

brson opened this issue Jun 6, 2014 · 6 comments
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@brson
Copy link
Contributor

brson commented Jun 6, 2014

I just wrote #[allow(ctypes)] which means "allow non-c types".

@brson
Copy link
Contributor Author

brson commented Jun 6, 2014

ffi_rust_types is more accurate.

@nathantypanski
Copy link
Contributor

Aren't they literally "types from C", or "C-compatible data types"?

I think it's an analogy to the ctypes Python module.

@brson
Copy link
Contributor Author

brson commented Jun 17, 2014

@nathantypanski yes, but the problem is not with the meaning of "ctypes" but with the pairing of "allow" and "ctypes".

When you read the words "allow ctypes" you intuitively think, "by typing these words I am allowed to use C types", but that is not what #[allow(ctypes)] means: it means "allow me to not use C types".

@Rdbaker
Copy link

Rdbaker commented Jun 27, 2014

So would one just need to change every occurrence of CTYPES in src/librustc/lint/builtin.rs to FFI_RUST_TYPES?

@Rdbaker
Copy link

Rdbaker commented Jul 1, 2014

@brson I realize this probably isn't high on the priority list, but I would really appreciate if you took a look at my PR

@steveklabnik steveklabnik added the A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. label Feb 11, 2015
@Manishearth
Copy link
Member

This is now called improper_ctypes.

bors added a commit to rust-lang-ci/rust that referenced this issue Jun 5, 2023
bors added a commit to rust-lang-ci/rust that referenced this issue Jun 5, 2023
Fix evaluating negative for floating point types

fix rust-lang#14704
Unary operators was missed from rust-lang#14705
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants