Auto merge of #124401 - oli-obk:some_hir_cleanups, r=cjgillot

Some hir cleanups

It seemed odd to not put `AnonConst` in the arena, compared with the other types that we did put into an arena. This way we can also give it a `Span` without growing a lot of other HIR data structures because of the extra field.

r? compiler
This commit is contained in:
bors 2024-05-04 00:32:27 +00:00
commit 3cdc951b0b

View File

@ -224,7 +224,7 @@ fn should_ignore(&mut self, expr: &Expr<'_>) -> bool {
})
}
pub fn eq_array_length(&mut self, left: ArrayLen, right: ArrayLen) -> bool {
pub fn eq_array_length(&mut self, left: ArrayLen<'_>, right: ArrayLen<'_>) -> bool {
match (left, right) {
(ArrayLen::Infer(..), ArrayLen::Infer(..)) => true,
(ArrayLen::Body(l_ct), ArrayLen::Body(r_ct)) => self.eq_body(l_ct.body, r_ct.body),
@ -1116,7 +1116,7 @@ pub fn hash_tykind(&mut self, ty: &TyKind<'_>) {
}
}
pub fn hash_array_length(&mut self, length: ArrayLen) {
pub fn hash_array_length(&mut self, length: ArrayLen<'_>) {
match length {
ArrayLen::Infer(..) => {},
ArrayLen::Body(anon_const) => self.hash_body(anon_const.body),