Skip to content

FnOnce internal compiler bug #29321

Closed
Closed
@KalitaAlexey

Description

@KalitaAlexey

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions