Stream: t-lang

Topic: Why aren't `extern "C" fn` declarations checked for FFI s...


Lokathor (Feb 03 2020 at 09:15, on Zulip):

Given an example function declaration like

#[no_mangle]
pub extern "C" fn echo(words: &str) -> &str {
  words
}

Rust doesn't report the function as using types that aren't safe for FFI. Really, it should.

Is this some sort of intentionally decided gap in the linting?

rkruppe (Feb 03 2020 at 11:33, on Zulip):

That was added recently and it had too many (arguably) false positives in real world code so it was reverted for now

rkruppe (Feb 03 2020 at 11:34, on Zulip):

https://github.com/rust-lang/rust/issues/66220

Last update: Jun 07 2020 at 10:00UTC