introduce LateParamRegionKind

This commit is contained in:
lcnr
2024-12-06 14:46:28 +01:00
parent 3378a5e084
commit 085d931810
19 changed files with 157 additions and 59 deletions

View File

@@ -39,14 +39,14 @@ impl<'a> DescriptionCtx<'a> {
}
}
ty::ReLateParam(ref fr) => {
if !fr.bound_region.is_named()
if !fr.kind.is_named()
&& let Some((ty, _)) = find_anon_type(tcx, generic_param_scope, region)
{
(Some(ty.span), "defined_here", String::new())
} else {
let scope = fr.scope.expect_local();
match fr.bound_region {
ty::BoundRegionKind::Named(_, name) => {
match fr.kind {
ty::LateParamRegionKind::Named(_, name) => {
let span = if let Some(param) = tcx
.hir()
.get_generics(scope)
@@ -62,7 +62,7 @@ impl<'a> DescriptionCtx<'a> {
(Some(span), "as_defined", name.to_string())
}
}
ty::BoundRegionKind::Anon => {
ty::LateParamRegionKind::Anon(_) => {
let span = Some(tcx.def_span(scope));
(span, "defined_here", String::new())
}