Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Manishearth opened this issue Jan 14, 2015 · 4 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@Manishearth
Copy link
Member

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)) {}
}
@kmcallister kmcallister added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Jan 14, 2015
@tamird
Copy link
Contributor

tamird commented Apr 21, 2015

@Manishearth this no longer compiles. Can you update the MWE?

@Manishearth
Copy link
Member Author

Not sure if I can, things seem to have changed a lot.

#![feature(unboxed_closures, core)]

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

impl<'a> FnOnce<&'a mut u8> for NoSslVerify {
    type Output = ();
    #[inline(always)]
    extern "rust-call" fn call_once(self, _: (&mut u8)) {}
}

produces a different ICE

error: internal compiler error: argument to function with "rust-call" ABI is neither a tuple nor unit
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:230

@arielb1
Copy link
Contributor

arielb1 commented Jul 8, 2015

dupe of #22565

@arielb1 arielb1 changed the title ICE: generic_bounds.has_escaping_regions() error: internal compiler error: argument to function with "rust-call" ABI is neither a tuple nor unit Jul 8, 2015
bltavares pushed a commit to bltavares/glacier that referenced this issue Oct 25, 2015
@steveklabnik
Copy link
Member

Triage: tracked by glacier. That said, pretty sure I agree with @arielb1 that this is a duplicate. Not 100% sure, so I'll keep it open; if anyone knows for sure, please feel free to close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

5 participants