You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<anon>:2:15: 2:26 warning: found type without foreign-function-safe representation annotation in foreign module, consider adding a #[repr(...)] attribute to the type, #[warn(improper_ctypes)] on by default
<anon>:2 fn foo(x: Option<str>);
^~~~~~~~~~~
<anon>:2:5: 2:28 warning: foreign function is never used: `foo`, #[warn(dead_code)] on by default
<anon>:2 fn foo(x: Option<str>);
^~~~~~~~~~~~~~~~~~~~~~~
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Unexpected type returned from struct_tail: core::option::Option<str> for ty=core::option::Option<str>', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/librustc_trans/trans/type_of.rs:354
Between this and #25581, I'm increasingly believing that Rust should firmly disallow non-C-compatible types in extern functions, not merely lint on them. extern "C" means to use the C ABI, and there is no C ABI support for passing slices, strs, etc. around.
The text was updated successfully, but these errors were encountered:
huonw
added
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
A-DSTs
Area: Dynamically-sized types (DSTs)
labels
May 20, 2015
The following code ICEs in nightly on play.rust-lang.org, as well as in 1.0 stable:
Between this and #25581, I'm increasingly believing that Rust should firmly disallow non-C-compatible types in
extern
functions, not merely lint on them.extern "C"
means to use the C ABI, and there is no C ABI support for passing slices,str
s, etc. around.The text was updated successfully, but these errors were encountered: