diff options
Diffstat (limited to 'tests/ui/statics/enum-with-static-str-variant-13214.rs')
| -rw-r--r-- | tests/ui/statics/enum-with-static-str-variant-13214.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/statics/enum-with-static-str-variant-13214.rs b/tests/ui/statics/enum-with-static-str-variant-13214.rs new file mode 100644 index 00000000000..1db37da632d --- /dev/null +++ b/tests/ui/statics/enum-with-static-str-variant-13214.rs @@ -0,0 +1,24 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/13214 + +//@ build-pass +#![allow(dead_code)] +// defining static with struct that contains enum +// with &'static str variant used to cause ICE + + +pub enum Foo { + Bar, + Baz(&'static str), +} + +pub static TEST: Test = Test { + foo: Foo::Bar, + c: 'a' +}; + +pub struct Test { + foo: Foo, + c: char, +} + +fn main() {} |
