diff options
| author | Kevin Atkinson <kevina@cs.utah.edu> | 2012-01-10 14:55:54 -0700 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2012-01-10 15:59:57 -0800 |
| commit | 1dc3debdafbf29c6ac4ff3cf336da62e13e1871e (patch) | |
| tree | 76319cdf2c1b7b41ce098a1605f08f8a340e8776 /src/test/compile-fail | |
| parent | 08abf8d37fa549ebc67f80d80530f4aa43d716e4 (diff) | |
| download | rust-1dc3debdafbf29c6ac4ff3cf336da62e13e1871e.tar.gz rust-1dc3debdafbf29c6ac4ff3cf336da62e13e1871e.zip | |
Add support for casting enum-like tags to scalar values.
Diffstat (limited to 'src/test/compile-fail')
| -rw-r--r-- | src/test/compile-fail/tag-variant-cast-non-nullary.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/compile-fail/tag-variant-cast-non-nullary.rs b/src/test/compile-fail/tag-variant-cast-non-nullary.rs new file mode 100644 index 00000000000..ecc518e75a1 --- /dev/null +++ b/src/test/compile-fail/tag-variant-cast-non-nullary.rs @@ -0,0 +1,12 @@ +//error-pattern: non-scalar cast +// black and white have the same discriminator value ... + +tag non_nullary { + nullary; + other(int); +} + +fn main() { + let v = nullary; + let val = v as int; +} |
