Skip to content

Commit

Permalink
Change fatal diagnostic to an error.
Browse files Browse the repository at this point in the history
Co-authored-by: Esteban Kuber <[email protected]>
  • Loading branch information
JeanCASPAR and estebank authored Aug 30, 2022
1 parent e89d4fc commit 79d4f09
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion compiler/rustc_ast_lowering/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1264,7 +1264,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
(Some(..), Some(..), HalfOpen) => hir::LangItem::Range,
(None, Some(..), Closed) => hir::LangItem::RangeToInclusive,
(Some(..), Some(..), Closed) => unreachable!(),
(_, None, Closed) => self.tcx.sess.emit_fatal(InclusiveRangeWithNoEnd { span }),
(start, None, Closed) => {
self.tcx.sess.emit_err(InclusiveRangeWithNoEnd { span });
match start {
Some(..) => hir::LangItem::RangeFrom,
None => hir::LangItem::RangeFull,
}
}
};

let fields = self.arena.alloc_from_iter(
Expand Down

0 comments on commit 79d4f09

Please sign in to comment.