Change fatal diagnostic to an error.

Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
This commit is contained in:
JeanCASPAR 2022-08-30 14:26:09 +02:00 committed by GitHub
parent e89d4fcc7d
commit 79d4f09942
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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(