Skip to content

ICE: LLVM Assertion with Unboxed Closures #18661

Closed
@cristicbz

Description

@cristicbz

Minimal test case:

#![feature(unboxed_closures)]

pub fn deeper<C: Fn<(), ()>>(deepest: C) { deepest.call(()); }
pub fn deep<C: Fn<(), ()>>(_ignored: C) { deeper(|&:| -> () {}); }
fn main() { deep(|&:| -> () {}); }

Gives

rustc: /build/rust-git/src/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

Rust Playpen

Things that don't affect it:

  • Changing the Fn type (Once, Mut, move etc.).
  • Calling deep's argument instead of ignoring it.

Things that DO stop it from happening:

  • Instead of ignoring _ignored, passing it to deeper as an arg.
  • Removing the body of any of the functions.

Only have access to playpen so I can't give backtrace, sorry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-closuresArea: Closures (`|…| { … }`)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