Skip to content

ICE with unboxed and diverging closure #20105

Closed

Description

fn main() {
    std::task::spawn(move || panic!("A")); // OK
    std::thread::Thread::spawn(move || panic!("B")).detach(); // Can't infer the return type
}

This makes the deprecation process of task::spawn() non-trivial.

Thread::spawn::<(), FnOnce()+Send>(move || panic!("B")).detach(); did not work, either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: 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