Closed
Description
If I try to create a const &'static Fn(u32)
, I trigger an ICE:
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
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'assertion failed: self.mode == Mode::Var', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/librustc/middle/check_const.rs:254
error code 101
A small example code snippet is on the playpen (see http://is.gd/U0DmxV):
const x: &'static Fn() = &|| println!("ICE here"); //ICE
fn main() {}