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.
This commit is contained in:
Guillaume Gomez
2023-12-09 14:05:11 +01:00
committed by GitHub
3 changed files with 6 additions and 5 deletions

View File

@@ -1679,7 +1679,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
duplicated_lifetime_node_id,
lifetime.ident.name,
DefKind::LifetimeParam,
lifetime.ident.span,
self.lower_span(lifetime.ident.span),
);
captured_to_synthesized_mapping.insert(old_def_id, duplicated_lifetime_def_id);
// FIXME: Instead of doing this, we could move this whole loop
@@ -1688,7 +1688,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
synthesized_lifetime_definitions.push((
duplicated_lifetime_node_id,
duplicated_lifetime_def_id,
lifetime.ident,
self.lower_ident(lifetime.ident),
));
// 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> {
match c.value.kind {
ExprKind::Underscore => {
if self.tcx.features().generic_arg_infer {
hir::ArrayLen::Infer(self.lower_node_id(c.id), c.value.span)
hir::ArrayLen::Infer(self.lower_node_id(c.id), self.lower_span(c.value.span))
} else {
feature_err(
&self.tcx.sess.parse_sess,