1
Fork 0

Make Diagnostic::span_fatal unconditionally raise an error

It had no callers which didn't immediately call `raise()`, and this
unifies the behavior with `Session`.
This commit is contained in:
Joshua Nelson 2021-03-27 22:45:01 -04:00
parent e49f4471aa
commit 96509b4835
5 changed files with 13 additions and 19 deletions

View file

@ -1236,9 +1236,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
(Some(..), Some(..), HalfOpen) => hir::LangItem::Range,
(None, Some(..), Closed) => hir::LangItem::RangeToInclusive,
(Some(..), Some(..), Closed) => unreachable!(),
(_, None, Closed) => {
self.diagnostic().span_fatal(span, "inclusive range with no end").raise()
}
(_, None, Closed) => self.diagnostic().span_fatal(span, "inclusive range with no end"),
};
let fields = self.arena.alloc_from_iter(