]>
Commit | Line | Data |
---|---|---|
b7449926 | 1 | // run-pass |
0bf4aa26 | 2 | #![allow(unused_variables)] |
85aaf69f | 3 | // Regression test for issue 7660 |
1a4d82fc | 4 | // rvalue lifetime too short when equivalent `match` works |
223e47cc | 5 | |
c34b1796 AL |
6 | // pretty-expanded FIXME #23616 |
7 | ||
1a4d82fc | 8 | use std::collections::HashMap; |
223e47cc | 9 | |
c34b1796 | 10 | struct A(isize, isize); |
223e47cc | 11 | |
1a4d82fc | 12 | pub fn main() { |
c34b1796 | 13 | let mut m: HashMap<isize, A> = HashMap::new(); |
1a4d82fc | 14 | m.insert(1, A(0, 0)); |
223e47cc | 15 | |
c34b1796 AL |
16 | let A(ref _a, ref _b) = m[&1]; |
17 | let (a, b) = match m[&1] { A(ref _a, ref _b) => (_a, _b) }; | |
223e47cc | 18 | } |