1
Fork 0

Move ConstArg::span to AnonConst::span

This commit is contained in:
Oli Scherer 2024-04-26 13:05:00 +00:00
parent 4dc46f7f17
commit 4a19711b25
4 changed files with 12 additions and 9 deletions

View file

@ -1592,6 +1592,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
def_id: anon_const,
hir_id: const_id,
body: const_body,
span,
})),
is_host_effect: true,
},

View file

@ -1187,11 +1187,11 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
hir_id: this.lower_node_id(node_id),
body: this
.lower_const_body(path_expr.span, Some(&path_expr)),
span,
})
});
return GenericArg::Const(ConstArg {
value: ct,
span,
is_desugared_from_effects: false,
});
}
@ -1203,7 +1203,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
}
ast::GenericArg::Const(ct) => GenericArg::Const(ConstArg {
value: self.lower_anon_const(ct),
span: self.lower_span(ct.value.span),
is_desugared_from_effects: false,
}),
}
@ -2349,6 +2348,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
def_id: this.local_def_id(c.id),
hir_id: this.lower_node_id(c.id),
body: this.lower_const_body(c.value.span, Some(&c.value)),
span: this.lower_span(c.value.span),
}))
}
@ -2656,8 +2656,7 @@ impl<'hir> GenericArgsCtor<'hir> {
lcx.children.push((def_id, hir::MaybeOwner::NonOwner(hir_id)));
self.args.push(hir::GenericArg::Const(hir::ConstArg {
value: lcx.arena.alloc(hir::AnonConst { def_id, hir_id, body }),
span,
value: lcx.arena.alloc(hir::AnonConst { def_id, hir_id, body, span }),
is_desugared_from_effects: true,
}))
}