Skip to content

Commit 79d4f09

Browse files
JeanCASPARestebank
andauthored
Change fatal diagnostic to an error.
Co-authored-by: Esteban Kuber <[email protected]>
1 parent e89d4fc commit 79d4f09

File tree

1 file changed

+7
-1
lines changed
  • compiler/rustc_ast_lowering/src

1 file changed

+7
-1
lines changed

compiler/rustc_ast_lowering/src/expr.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
12641264
(Some(..), Some(..), HalfOpen) => hir::LangItem::Range,
12651265
(None, Some(..), Closed) => hir::LangItem::RangeToInclusive,
12661266
(Some(..), Some(..), Closed) => unreachable!(),
1267-
(_, None, Closed) => self.tcx.sess.emit_fatal(InclusiveRangeWithNoEnd { span }),
1267+
(start, None, Closed) => {
1268+
self.tcx.sess.emit_err(InclusiveRangeWithNoEnd { span });
1269+
match start {
1270+
Some(..) => hir::LangItem::RangeFrom,
1271+
None => hir::LangItem::RangeFull,
1272+
}
1273+
}
12681274
};
12691275

12701276
let fields = self.arena.alloc_from_iter(

0 commit comments

Comments
 (0)