about summary refs log tree commit diff
path: root/tests/ui/issues/issue-30081.rs
blob: 538e89f224697c4268f1a68f628d213097c935f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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();
}