Skip to content

Commit fd60c5a

Browse files
Rollup merge of #118766 - compiler-errors:lower-spans, r=spastorino
Lower some forgotten spans I wrote a HIR visitor that visited all of the spans in the HIR, and made it ICE when we have a unlowered span. That led me to discover these unlowered spans.
2 parents a1c252f + c980fae commit fd60c5a

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

compiler/rustc_ast_lowering/src/expr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
634634
// Resume argument type: `ResumeTy`
635635
let unstable_span = self.mark_span_with_reason(
636636
DesugaringKind::Async,
637-
span,
637+
self.lower_span(span),
638638
Some(self.allow_gen_future.clone()),
639639
);
640640
let resume_ty = hir::QPath::LangItem(hir::LangItem::ResumeTy, unstable_span);
@@ -766,7 +766,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
766766
// Resume argument type: `ResumeTy`
767767
let unstable_span = self.mark_span_with_reason(
768768
DesugaringKind::Async,
769-
span,
769+
self.lower_span(span),
770770
Some(self.allow_gen_future.clone()),
771771
);
772772
let resume_ty = hir::QPath::LangItem(hir::LangItem::ResumeTy, unstable_span);

compiler/rustc_ast_lowering/src/item.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1382,6 +1382,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
13821382
let host_param_parts = if let Const::Yes(span) = constness
13831383
&& self.tcx.features().effects
13841384
{
1385+
let span = self.lower_span(span);
13851386
let param_node_id = self.next_node_id();
13861387
let hir_id = self.next_id();
13871388
let def_id = self.create_def(

compiler/rustc_ast_lowering/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1679,7 +1679,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
16791679
duplicated_lifetime_node_id,
16801680
lifetime.ident.name,
16811681
DefKind::LifetimeParam,
1682-
lifetime.ident.span,
1682+
self.lower_span(lifetime.ident.span),
16831683
);
16841684
captured_to_synthesized_mapping.insert(old_def_id, duplicated_lifetime_def_id);
16851685
// FIXME: Instead of doing this, we could move this whole loop
@@ -1688,7 +1688,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
16881688
synthesized_lifetime_definitions.push((
16891689
duplicated_lifetime_node_id,
16901690
duplicated_lifetime_def_id,
1691-
lifetime.ident,
1691+
self.lower_ident(lifetime.ident),
16921692
));
16931693

16941694
// Now make an arg that we can use for the generic params of the opaque tykind.
@@ -2253,7 +2253,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
22532253
match c.value.kind {
22542254
ExprKind::Underscore => {
22552255
if self.tcx.features().generic_arg_infer {
2256-
hir::ArrayLen::Infer(self.lower_node_id(c.id), c.value.span)
2256+
hir::ArrayLen::Infer(self.lower_node_id(c.id), self.lower_span(c.value.span))
22572257
} else {
22582258
feature_err(
22592259
&self.tcx.sess.parse_sess,

0 commit comments

Comments
 (0)