Skip to content

Commit bdad5b9

Browse files
committed
Remove an unnecessary delayed_span_bug in PatCtxt::lower_pattern_range.
It's impossible for a syntactically invalid `..` pattern to reach this far into compilation.
1 parent af2b232 commit bdad5b9

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_mir_build/src/thir/pattern

1 file changed

+1
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
175175
) -> Result<PatKind<'tcx>, ErrorGuaranteed> {
176176
if lo_expr.is_none() && hi_expr.is_none() {
177177
let msg = "found twice-open range pattern (`..`) outside of error recovery";
178-
return Err(self.tcx.dcx().span_delayed_bug(span, msg));
178+
self.tcx.dcx().span_bug(span, msg);
179179
}
180180

181181
let (lo, lo_ascr, lo_inline) = self.lower_pattern_range_endpoint(lo_expr)?;

0 commit comments

Comments
 (0)