Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
359bfa901b9d8eddbed7b88b6716dbb77b7bfb95
rust/tests/ui/extern/issue-16250.rs

10 lines
133 B
Rust
Raw Normal View History

Use a visitor to look for non-FFI-safe types Fixes #16250.
2014-09-03 19:03:25 -07:00
#![deny(warnings)]
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.
2015-09-30 14:31:01 -07:00
pub struct Foo;
Update tests for extern block linting
2020-09-01 17:12:52 -04:00
extern "C" {
Refactor "not FFI-safe" diagnostic
2019-09-10 22:29:31 +01:00
pub fn foo(x: (Foo)); //~ ERROR `extern` block uses type `Foo`
Use a visitor to look for non-FFI-safe types Fixes #16250.
2014-09-03 19:03:25 -07:00
}
Update tests for extern block linting
2020-09-01 17:12:52 -04:00
fn main() {}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 4652ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API