Created
December 7, 2013 03:23
-
-
Save agrif/7836892 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| enum Expression { | |
| Symbol(~str), | |
| Compound(~str, ~[Expression]) | |
| } | |
| fn standard_form(expr: &Expression) -> ~str { | |
| match (*expr) { | |
| Compound(~"List", ref items) => ~"list", | |
| Compound(~"Blank", []) => ~"_", | |
| _ => ~"default" | |
| } | |
| } | |
| fn main() { | |
| let x = ~Symbol(~"x"); | |
| println(standard_form(x)); | |
| } | |
| // error: internal compiler error: sequence_element_type called on non-sequence value | |
| // 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 | |
| // task 'rustc' failed at 'explicit failure', /var/tmp/portage/dev-lang/rust-9999/work/rust-9999/src/libsyntax/diagnostic.rs:102 | |
| // task '<main>' failed at 'explicit failure', /var/tmp/portage/dev-lang/rust-9999/work/rust-9999/src/librustc/lib.rs:394 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment