1
Fork 0

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 09cd00fea4
16 changed files with 89 additions and 87 deletions

View file

@ -74,9 +74,12 @@ fn gen_args(cx: &LateContext<'_>, segment: &PathSegment<'_>) -> String {
GenericArg::Type(ty) => {
cx.tcx.sess.source_map().span_to_snippet(ty.span).unwrap_or_else(|_| "_".into())
}
GenericArg::Const(c) => {
cx.tcx.sess.source_map().span_to_snippet(c.span).unwrap_or_else(|_| "_".into())
}
GenericArg::Const(c) => cx
.tcx
.sess
.source_map()
.span_to_snippet(c.value.span)
.unwrap_or_else(|_| "_".into()),
GenericArg::Infer(_) => String::from("_"),
})
.collect::<Vec<_>>();