Skip to content

ICE: "global closures can't capture anything" #37550

Closed
@aidanhs

Description

@aidanhs
#![feature(const_fn)]
fn main() {}
const fn x() {
    let t = true;
    let x = || t;
}

https://is.gd/JFNOLu

rustc 1.14.0-nightly (3f4408347 2016-10-27)
error: internal compiler error: unexpected panic

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

thread 'rustc' panicked at 'global closures can't capture anything', ../src/librustc_passes/consts.rs:587
note: Run with `RUST_BACKTRACE=1` for a backtrace.

(const fn tracking issue #24111)

Metadata

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.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