[Pre-RFC] Inferred Enum Type

Ok, so direct comparison. What's different that you don't like in the proposed

match item {
    _::Fn(_ {
        sig: _ { ident, generics, inputs, output, .. },
        ..
    }) => todo!(),
    _ => bail!(),
}

where today I could write the following—with the exact same amount of type info (if not less)—and nobody would complain:

if let Some(item) = item.as_fn() {
    let ident = &item.sig.ident;
    let generics = &item.sig.generics;
    let inputs = &item.sig.inputs;
    let output = &item.sig.output;
    todo!()
} else {
    bail!()
}
2 Likes