From 3e7ab3a443a3c49d457226e7842a7256fe07933b Mon Sep 17 00:00:00 2001 From: Jed Davis Date: Fri, 4 Jan 2013 18:43:36 -0800 Subject: [PATCH] Add a test for nullary univariant enums. --- .../run-pass/const-nullary-univariant-enum.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/test/run-pass/const-nullary-univariant-enum.rs diff --git a/src/test/run-pass/const-nullary-univariant-enum.rs b/src/test/run-pass/const-nullary-univariant-enum.rs new file mode 100644 index 000000000000..e1db50d566b4 --- /dev/null +++ b/src/test/run-pass/const-nullary-univariant-enum.rs @@ -0,0 +1,19 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum Foo { + Bar = 0xDEADBEE +} + +const X: Foo = Bar; + +fn main() { + assert((X as uint) == 0xDEADBEE); +}