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

FnOnce internal compiler bug #29321

Closed
KalitaAlexey opened this issue Oct 26, 2015 · 1 comment
Closed

FnOnce internal compiler bug #29321

KalitaAlexey opened this issue Oct 26, 2015 · 1 comment

Comments

@KalitaAlexey
Copy link
Contributor

It fails to compile FnOnce impl.
Code that does not compile

#![feature(unboxed_closures)]
#![feature(core)]

struct Data {
    identifier: String,
}

impl FnOnce<u64> for Data {
    type Output = u64;

    extern "rust-call" fn call_once(self, arg: u64) -> Self::Output {
        arg
    }
}

fn main() {
}

Code that compiles

#![feature(unboxed_closures)]
#![feature(core)]

struct Data {
    identifier: String,
}

impl FnOnce<(u64,)> for Data {
    type Output = u64;

    extern "rust-call" fn call_once(self, args: (u64,)) -> Self::Output {
        args.0
    }
}

fn main() {
}

Error message is not helpful.

@apasel422
Copy link
Contributor

This ICEs with error: internal compiler error: argument to function with "rust-call" ABI is neither a tuple nor unit, which is a duplicate of #22565 and #21139.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants