diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/consts/const-enum-byref-self.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/consts/const-enum-byref-self.rs b/src/test/ui/consts/const-enum-byref-self.rs new file mode 100644 index 000000000..b7e14bfb7 --- /dev/null +++ b/src/test/ui/consts/const-enum-byref-self.rs @@ -0,0 +1,18 @@ +// run-pass +#![allow(dead_code)] + +enum E { V, VV(isize) } +static C: E = E::V; + +impl E { + pub fn method(&self) { + match *self { + E::V => {} + E::VV(..) => panic!() + } + } +} + +pub fn main() { + C.method() +} |