Skip to content

LLVM assert on associated type with trait object. #21426

Closed
@KokaKiwi

Description

@KokaKiwi

The following code:

pub fn handle(_data: &[u8]) {}

pub fn handle_opt(iter: &mut Iterator<Item = &[u8]>) {
    for data in *iter {
        handle(data);
    }
}

give the following LLVM assert error:

$ rustc --crate-type lib lib.rs
rustc: /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/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.

I really have no idea what's the LLVM IR code generated which cause this error, as I don't know how to disable LLVM IR checks at compile-time :/

My Rust version:

$ rustc -Vv
rustc 1.0.0-nightly (f4f10dba2 2015-01-17 20:31:08 +0000)
binary: rustc
commit-hash: f4f10dba2975b51c2d2c92157018db3ac13d4d4a
commit-date: 2015-01-17 20:31:08 +0000
host: x86_64-unknown-linux-gnu
release: 1.0.0-nightly

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.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