Skip to content

Commit a1e9fcb

Browse files
committed
paper over the ICE
1 parent 3130990 commit a1e9fcb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

compiler/rustc_mir_transform/src/instsimplify.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ impl<'tcx> MirPass<'tcx> for InstSimplify {
4545
};
4646
let preserve_ub_checks =
4747
attr::contains_name(tcx.hir().krate_attrs(), sym::rustc_preserve_ub_checks);
48-
let remove_ub_checks = tcx.has_attr(def_id, sym::rustc_no_ubchecks);
48+
// FIXME(async_closures) tcx.has_attr on async closures seems to ICE. Not sure why.
49+
let remove_ub_checks = if tcx.is_coroutine(def_id) {
50+
false
51+
} else {
52+
tcx.has_attr(def_id, sym::rustc_no_ubchecks)
53+
};
4954
for block in body.basic_blocks.as_mut() {
5055
for statement in block.statements.iter_mut() {
5156
match statement.kind {

0 commit comments

Comments
 (0)