Skip to content
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

ICE for incorrect "rust-call" ABI implementations #16039

Closed
alexchandel opened this issue Jul 28, 2014 · 2 comments
Closed

ICE for incorrect "rust-call" ABI implementations #16039

alexchandel opened this issue Jul 28, 2014 · 2 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@alexchandel
Copy link

This incorrect Fn implementation crashes the compiler:

struct Goal {
    pub msg: String
}

impl Fn<&'static str, Goal> for Goal {
    extern "rust-call" fn call(&self, args: &'static str) -> Goal {
        return Goal {
            msg: self.msg + args
        }
    }
}

with the error message:

error: internal compiler error: argument to function with "rust-call" ABI is neither a tuple nor unit
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'Box<Any>', /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/libsyntax/ast_util.rs:784
@sfackler sfackler added the I-ICE label Jul 28, 2014
@alexchandel alexchandel changed the title Compiler error for incorrect "rust-call" ABI implementations ICE for incorrect "rust-call" ABI implementations Jul 28, 2014
@alexchandel
Copy link
Author

Edit: added demo struct

@steveklabnik
Copy link
Member

This no longer ICEs for me.

bors added a commit to rust-lang-ci/rust that referenced this issue Dec 11, 2023
…-items-diagnostic-for-negative-impls, r=Veykril

fix: Don't emit "missing items" diagnostic for negative impls

Negative impls can't have items, so there is no reason for this diagnostic.

LMK if I should add a test somewhere. Also LMK if that's not how we usually check multiple things in an if in r-a.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

3 participants