diff options
| author | JeanCASPAR <55629512+JeanCASPAR@users.noreply.github.com> | 2022-08-30 14:26:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-30 14:26:09 +0200 |
| commit | 79d4f09942a2fc6f96f56f7ae85196c4aa7df56c (patch) | |
| tree | 9973caa13fb997a22f2d2b12357e05c064d15b86 /compiler/rustc_ast_lowering/src/expr.rs | |
| parent | e89d4fcc7d99bcf76464d9c0994d54d12e00dfb7 (diff) | |
| download | rust-79d4f09942a2fc6f96f56f7ae85196c4aa7df56c.tar.gz rust-79d4f09942a2fc6f96f56f7ae85196c4aa7df56c.zip | |
Change fatal diagnostic to an error.
Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
Diffstat (limited to 'compiler/rustc_ast_lowering/src/expr.rs')
| -rw-r--r-- | compiler/rustc_ast_lowering/src/expr.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/rustc_ast_lowering/src/expr.rs b/compiler/rustc_ast_lowering/src/expr.rs index 6d8ce62d913..17604761688 100644 --- a/compiler/rustc_ast_lowering/src/expr.rs +++ b/compiler/rustc_ast_lowering/src/expr.rs @@ -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( |
