Skip to content

Commit

Permalink
Remove an unnecessary delayed_span_bug in `PatCtxt::lower_pattern_r…
Browse files Browse the repository at this point in the history
…ange`.

It's impossible for a syntactically invalid `..` pattern to reach this
far into compilation.
  • Loading branch information
nnethercote committed Feb 20, 2024
1 parent a85e5d1 commit 939277d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_mir_build/src/thir/pattern/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
) -> Result<PatKind<'tcx>, ErrorGuaranteed> {
if lo_expr.is_none() && hi_expr.is_none() {
let msg = "found twice-open range pattern (`..`) outside of error recovery";
return Err(self.tcx.dcx().span_delayed_bug(span, msg));
self.tcx.dcx().span_bug(span, msg);
}

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

0 comments on commit 939277d

Please sign in to comment.