]> git.lizzy.rs Git - rust.git/commit
rustc: Don't lint about isize/usize in FFI
authorAlex Crichton <alex@alexcrichton.com>
Wed, 30 Sep 2015 21:31:01 +0000 (14:31 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 30 Sep 2015 21:31:01 +0000 (14:31 -0700)
commitbd6758a2b5781599d1e4eb48a897616d1b0cf8a0
tree8e30dc43b8cf7a38f0f7bbe8a5c99a42dcb828a1
parent3e6d7243ae9749eff27fd320cb422e42291e79d4
rustc: Don't lint about isize/usize in FFI

This lint warning was originally intended to help against misuse of the old Rust
`int` and `uint` types in FFI bindings where the Rust `int` was not equal to the
C `int`. This confusion no longer exists (as Rust's types are now `isize` and
`usize`), and as a result the need for this lint has become much less over time.

Additionally, starting with [the RFC for libc][rfc] it's likely that `isize` and
`usize` will be quite common in FFI bindings (e.g. they're the definition of
`size_t` and `ssize_t` on many platforms).

[rfc]: https://github.com/rust-lang/rfcs/pull/1291

This commit disables these lints to instead consider `isize` and `usize` valid
types to have in FFI signatures.
src/librustc_lint/types.rs
src/test/compile-fail/issue-16250.rs
src/test/compile-fail/lint-ctypes.rs
src/test/compile-fail/warn-foreign-int-types.rs [deleted file]
src/test/run-pass/foreign-int-types.rs [new file with mode: 0644]