rust/tests/target/issue-1397.rs
Jon Gjengset f96e56c3a0 Avoid extra comma in vertical single-field struct patterns (#1403)
* Add (failing) test for #1397

* Fix for #1397

Specifically, we end up double-adding a trailing comma for single-member
struct patterns that are arranged vertically. One is added by write_list
(since such structs return true for needs_trailing_separator), and
another is added by the if in the old code.
2017-03-26 18:16:45 +13:00

23 lines
478 B
Rust

pub enum TransactionState {
Committed(i64),
}
pub enum Packet {
Transaction { state: TransactionState },
}
fn baz(p: Packet) {
loop {
loop {
loop {
loop {
if let Packet::Transaction {
state: TransactionState::Committed(ts, ..), ..
} = p {
unreachable!()
}
}
}
}
}
}