You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
src\main.rs:2:34: 2:58 error: function calls in statics are limited to struct an
d enum constructors [E0015]
src\main.rs:2 static F : Box<Fn(i32) -> i32> = Box::new(move |x:i32| x);
^~~~~~~~~~~~~~~~~~~~~~~~
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/m
aster/CONTRIBUTING.md#bug-reports
note: run with RUST_BACKTRACE=1 for a backtrace
thread 'rustc' panicked at 'assertion failed: self.mode == Mode::Var', C:/bot/sl
ave/beta-dist-rustc-win-64/build/src/librustc\middle\check_const.rs:232
Could not compile hello_world.
To learn more, run the command again with --verbose.
The text was updated successfully, but these errors were encountered:
sfackler
added
the
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
label
Jun 29, 2015
Source is very simple.
//
//
static F : Box< Fn(i32) -> i32 > = Box::new(move |x:i32| x);
fn main() {
}
//
//
this code generate fault as follows.
src\main.rs:2:34: 2:58 error: function calls in statics are limited to struct an
d enum constructors [E0015]
src\main.rs:2 static F : Box<Fn(i32) -> i32> = Box::new(move |x:i32| x);
^~~~~~~~~~~~~~~~~~~~~~~~
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/m
aster/CONTRIBUTING.md#bug-reports
note: run with
RUST_BACKTRACE=1
for a backtracethread 'rustc' panicked at 'assertion failed: self.mode == Mode::Var', C:/bot/sl
ave/beta-dist-rustc-win-64/build/src/librustc\middle\check_const.rs:232
Could not compile
hello_world
.To learn more, run the command again with --verbose.
The text was updated successfully, but these errors were encountered: