-
Notifications
You must be signed in to change notification settings - Fork 13k
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
str as extern "C" arg causes compiler panic #80125
Comments
Here is a working example-
Note I made a new library project, and didnt modify Cargo.toml, just paste and run. |
Issue: rust-lang/rust#80125
A bit more minimized: type ExternCallback = extern "C" fn(*const u8, u32, str);
pub struct Struct(ExternCallback);
#[no_mangle]
pub extern "C" fn register_something(bind: ExternCallback) -> Struct {
Struct(bind)
} Errors:
|
Issue: rust-lang/rust#80125
This does not cause an ICE on an M1 Mac:
|
The ICE shows this as the ICEing file: Note that it's in the ABI file for x86-64, so it's not triggered on ARM. |
Triage: ICE has been fixed, marking as E-needs-test |
…xxx, r=fmease add some ice tests 5xxxx to 9xxxx Fixes rust-lang#98842 Fixes rust-lang#90691 Fixes rust-lang#88421 Fixes rust-lang#88212 Fixes rust-lang#83056 Fixes rust-lang#80125 Fixes rust-lang#64784 Fixes rust-lang#52334
…xxx, r=fmease add some ice tests 5xxxx to 9xxxx Fixes rust-lang#98842 Fixes rust-lang#90691 Fixes rust-lang#88421 Fixes rust-lang#88212 Fixes rust-lang#83056 Fixes rust-lang#80125 Fixes rust-lang#64784 Fixes rust-lang#52334
…x, r=fmease add some ice tests 5xxxx to 9xxxx Fixes rust-lang#98842 Fixes rust-lang#90691 Fixes rust-lang#88421 Fixes rust-lang#88212 Fixes rust-lang#83056 Fixes rust-lang#80125 Fixes rust-lang#64784 Fixes rust-lang#52334
add some ice tests 5xxxx to 9xxxx Fixes rust-lang/rust#98842 Fixes rust-lang/rust#90691 Fixes rust-lang/rust#88421 Fixes rust-lang/rust#88212 Fixes rust-lang/rust#83056 Fixes rust-lang/rust#80125 Fixes rust-lang/rust#64784 Fixes rust-lang/rust#52334
…x, r=fmease add some ice tests 5xxxx to 9xxxx Fixes rust-lang#98842 Fixes rust-lang#90691 Fixes rust-lang#88421 Fixes rust-lang#88212 Fixes rust-lang#83056 Fixes rust-lang#80125 Fixes rust-lang#64784 Fixes rust-lang#52334
Code
I am still getting used to Rust, and making plenty of mistakes, and I did the silly move of putting a str type as an argument for an external function. I understand this isn't correct rust and rewriting for correctness fixes the compiler panic.
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: