mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-16 10:35:22 +00:00
Merge pull request #1251 from Manishearth/fix_diverging_sub_expr
correctly traverse match expressions for diverging_sub_expr
This commit is contained in:
commit
9807c47e42
@ -104,7 +104,7 @@ impl<'a, 'tcx> DivergenceVisitor<'a, 'tcx> {
|
|||||||
self.visit_expr(guard);
|
self.visit_expr(guard);
|
||||||
}
|
}
|
||||||
// make sure top level arm expressions aren't linted
|
// make sure top level arm expressions aren't linted
|
||||||
walk_expr(self, &*arm.body);
|
self.maybe_walk_expr(&*arm.body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => walk_expr(self, e),
|
_ => walk_expr(self, e),
|
||||||
|
@ -31,6 +31,10 @@ fn foobar() {
|
|||||||
8 => break,
|
8 => break,
|
||||||
9 => diverge(),
|
9 => diverge(),
|
||||||
3 => (println!("moo"), diverge()), //~ ERROR sub-expression diverges
|
3 => (println!("moo"), diverge()), //~ ERROR sub-expression diverges
|
||||||
|
10 => match 42 {
|
||||||
|
99 => return,
|
||||||
|
_ => ((), panic!("boo")),
|
||||||
|
},
|
||||||
_ => (println!("boo"), break), //~ ERROR sub-expression diverges
|
_ => (println!("boo"), break), //~ ERROR sub-expression diverges
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user