Add test for passing on ref expectations

This commit is contained in:
Marcus Klaas de Vries 2019-01-30 21:14:26 +01:00
parent 3daca3eb4d
commit 13cb4a1b37
3 changed files with 15 additions and 8 deletions

View file

@ -615,10 +615,10 @@ impl ExprCollector {
.map(|arm| MatchArm {
pats: arm.pats().map(|p| self.collect_pat(p)).collect(),
expr: self.collect_expr_opt(arm.expr()),
guard: arm.guard().map(|guard| {
let e = guard.expr().expect("every guard should have an expr");
self.collect_expr(e)
}),
guard: arm
.guard()
.and_then(|guard| guard.expr())
.map(|e| self.collect_expr(e)),
})
.collect()
} else {