Skip to content

Compiler crashes with "Calling a function with a bad signature" #9382

Closed
@bytbox

Description

@bytbox

The following code crashes the compiler

trait A {
}
struct S {
    x: int
}
impl A for S {

}
fn new() -> Result<&A, ~str> {
    Err(~"")
}
fn main() {}


rustc hello.rs 
rustc: /home/s/misc/rust/src/llvm/lib/IR/Instructions.cpp:281: void llvm::CallInst::init(llvm::Value*, llvm::ArrayRef<llvm::Value*>, const llvm::Twine&): Assertion `(i >= FTy->getNumParams() || FTy->getParamType(i) == Args[i]->getType()) && "Calling a function with a bad signature!"' failed.
Aborted (core dumped)

The crash does not occur if "&A" is replaced by "@A" or "~A".

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.P-mediumMedium priority

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions