Skip to content

error: internal compiler error: argument to function with "rust-call" ABI is neither a tuple nor unit #21139

Closed
@Manishearth

Description

@Manishearth
Compiling hyper v0.1.1 (file:///home/manishearth/Mozilla/Git/hyper)
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. 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
thread 'rustc' panicked at 'assertion failed: !generic_bounds.has_escaping_regions()', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/librustc_typeck/check/mod.rs:2281

I was trying to use unboxed closures in Hyper, and I came across this.

Here's the commit where it got introduced.

The following MWE also causes the ICE:

#![feature(unboxed_closures)]

pub struct HttpConnector<T = NoSslVerify>(Option<T>);
pub struct NoSslVerify;

impl Fn(&mut u8) -> () for NoSslVerify {
    #[inline(always)]
    fn call(&self, _: (&mut u8)) {}
}

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