1
Fork 0

Store a LocalDefId in hir::GenericParam.

This commit is contained in:
Camille GILLOT 2022-11-06 18:26:36 +00:00
parent e82c08f58e
commit 18482f7b23
19 changed files with 67 additions and 88 deletions

View file

@ -411,8 +411,7 @@ impl CheckAttrVisitor<'_> {
if let Some(generics) = tcx.hir().get_generics(tcx.hir().local_def_id(hir_id)) {
for p in generics.params {
let hir::GenericParamKind::Type { .. } = p.kind else { continue };
let param_id = tcx.hir().local_def_id(p.hir_id);
let default = tcx.object_lifetime_default(param_id);
let default = tcx.object_lifetime_default(p.def_id);
let repr = match default {
ObjectLifetimeDefault::Empty => "BaseDefault".to_owned(),
ObjectLifetimeDefault::Static => "'static".to_owned(),

View file

@ -500,7 +500,7 @@ impl<'a, 'tcx> Visitor<'tcx> for Annotator<'a, 'tcx> {
};
self.annotate(
self.tcx.hir().local_def_id(p.hir_id),
p.def_id,
p.span,
None,
kind,