Skip to content

Commit 12a1b55

Browse files
committed
better ICE than sorry
1 parent d34e15e commit 12a1b55

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs

+3
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ struct ConstToPat<'tcx> {
6666
}
6767

6868
/// This error type signals that we encountered a non-struct-eq situation.
69+
/// We will fall back to calling `PartialEq::eq` on such patterns,
70+
/// and exhaustiveness checking will consider them as matching nothing.
6971
#[derive(Debug)]
7072
struct FallbackToOpaqueConst;
7173

@@ -411,6 +413,7 @@ impl<'tcx> ConstToPat<'tcx> {
411413
let err = TypeNotStructural { span, non_sm_ty: *pointee_ty };
412414
tcx.sess.emit_err(err);
413415
}
416+
tcx.sess.delay_span_bug(span, "`saw_const_match_error` set but no error?");
414417
// We errored, so the pattern we generate is irrelevant.
415418
PatKind::Wild
416419
}

0 commit comments

Comments
 (0)