diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-30081.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-30081.rs b/src/test/ui/issues/issue-30081.rs new file mode 100644 index 000000000..e7fca96ed --- /dev/null +++ b/src/test/ui/issues/issue-30081.rs @@ -0,0 +1,15 @@ +// run-pass +// This used to segfault #30081 + +pub enum Instruction { + Increment(i8), + Loop(Box<Box<()>>), +} + +fn main() { + let instrs: Option<(u8, Box<Instruction>)> = None; + instrs.into_iter() + .map(|(_, instr)| instr) + .map(|instr| match *instr { _other => {} }) + .last(); +} |