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
{{ message }}
Repository navigation
Static mutable enum variables break the compiler. #11516
I was playing around with Rust recently trying to develop a module that needed to maintain some internal state, and came across what appears to be a lack of support for static variables for anything besides primitive types.
Here's my example program (list definition taken from the tutorial):
And here's the error that trying to compile this code generates with RUST_LOG=rustc=1, minus some dead code warnings:
task 'rustc' failed at 'assertion failed: !is_undef(wrapped)', /opt/rust/src/librustc/middle/trans/adt.rs:773
error: internal compiler error: unexpected failure
This message reflects a bug in the Rust compiler.
We would appreciate a bug report: https://github.com/mozilla/rust/wiki/HOWTO-submit-a-Rust-bug-report
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1 to get further details and report the results to github.com/mozilla/rust/issues
task '<main>' failed at 'explicit failure', /opt/rust/src/librustc/lib.rs:453
Activity
alexcrichton commentedon Mar 3, 2014
Closed by #11979, types with destructors aren't allowed in mutable statics.
Auto merge of rust-lang#11516 - mojave2:issue-11458, r=giraffate
Merge rust-lang#11516