1 // We used to ICE if you had a single match arm with multiple
2 // candidate patterns with `ref mut` identifiers used in the arm's
5 // Also, this test expands on the original bug's example by actually
6 // trying to double check that we are matching against the right part
7 // of the input data based on which candidate pattern actually fired.
11 fn foo(x: &mut Result<(u32, u32), (u32, u32)>) -> u32 {
13 Ok((ref mut v, _)) | Err((_, ref mut v)) if *v > 0 => { *v }
19 assert_eq!(foo(&mut Ok((3, 4))), 3);
20 assert_eq!(foo(&mut Err((3, 4))), 4);