Skip to content

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

Closed
@alexchandel

Description

@alexchandel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions