Mark the exit of infinite loops as unreachable
This commit is contained in:
parent
d130acc0d0
commit
6d3e89e33c
|
@ -264,6 +264,10 @@ pub fn trans_loop<'a>(bcx:&'a Block<'a>,
|
||||||
|
|
||||||
fcx.pop_loop_cleanup_scope(loop_id);
|
fcx.pop_loop_cleanup_scope(loop_id);
|
||||||
|
|
||||||
|
if ty::type_is_bot(node_id_type(bcx, loop_id)) {
|
||||||
|
Unreachable(next_bcx_in);
|
||||||
|
}
|
||||||
|
|
||||||
return next_bcx_in;
|
return next_bcx_in;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue