Closed
Description
Code:
pub type TypeWithLifetime<'a> = Box<Fn() -> () + 'a>;
static static_closure : TypeWithLifetime<'static> = Box::new(|| {
panic!()
});
fn main() {}
Error:
6:3 error: function calls in statics are limited to struct and enum constructors [E0015]
<anon>:4 static static_closure : TypeWithLifetime<'static> = Box::new(|| {
<anon>:5 panic!()
<anon>:6 });
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
Metadata
Metadata
Assignees
Labels
No labels