Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[MIR] Make sure candidates are reversed before match_candidates.
  • Loading branch information
luqmana committed Dec 25, 2015
1 parent 4ce1daf commit 0a09ae6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/librustc_mir/build/matches/mod.rs
Expand Up @@ -512,7 +512,10 @@ impl<'a,'tcx> Builder<'a,'tcx> {
let otherwise: Vec<_> =
target_blocks.into_iter()
.zip(target_candidates)
.flat_map(|(target_block, target_candidates)| {
.flat_map(|(target_block, mut target_candidates)| {
// We need to preserve the fact that the candidates
// are in the reversed order compared to the source.
target_candidates.reverse();
self.match_candidates(span,
arm_blocks,
target_candidates,
Expand Down

0 comments on commit 0a09ae6

Please sign in to comment.