|
1 | 1 | use super::errors::{
|
2 | 2 | AsyncGeneratorsNotSupported, AsyncNonMoveClosureNotSupported, AwaitOnlyInAsyncFnAndBlocks,
|
3 | 3 | BaseExpressionDoubleDot, ClosureCannotBeStatic, FunctionalRecordUpdateDestructuringAssignemnt,
|
4 |
| - GeneratorTooManyParameters, NotSupportedForLifetimeBinderAsyncClosure, RustcBoxAttributeError, |
5 |
| - UnderscoreExprLhsAssign, |
| 4 | + GeneratorTooManyParameters, InclusiveRangeWithNoEnd, NotSupportedForLifetimeBinderAsyncClosure, |
| 5 | + RustcBoxAttributeError, UnderscoreExprLhsAssign, |
6 | 6 | };
|
7 | 7 | use super::ResolverAstLoweringExt;
|
8 | 8 | use super::{ImplTraitContext, LoweringContext, ParamMode, ParenthesizedGenericArgs};
|
@@ -1264,7 +1264,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
1264 | 1264 | (Some(..), Some(..), HalfOpen) => hir::LangItem::Range,
|
1265 | 1265 | (None, Some(..), Closed) => hir::LangItem::RangeToInclusive,
|
1266 | 1266 | (Some(..), Some(..), Closed) => unreachable!(),
|
1267 |
| - (_, None, Closed) => self.diagnostic().span_fatal(span, "inclusive range with no end"), |
| 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 | + } |
1268 | 1274 | };
|
1269 | 1275 |
|
1270 | 1276 | let fields = self.arena.alloc_from_iter(
|
|
0 commit comments