diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-11-06 18:26:36 +0000 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-11-13 14:05:30 +0000 |
| commit | 18482f7b2341fcabdbb854e3d4fe9a724726aa97 (patch) | |
| tree | 9badca8e44f1260d0a799ec649c8319c3b99bd83 /compiler/rustc_passes/src | |
| parent | e82c08f58e18078361a1d404cefebc3ed4c9d24a (diff) | |
| download | rust-18482f7b2341fcabdbb854e3d4fe9a724726aa97.tar.gz rust-18482f7b2341fcabdbb854e3d4fe9a724726aa97.zip | |
Store a LocalDefId in hir::GenericParam.
Diffstat (limited to 'compiler/rustc_passes/src')
| -rw-r--r-- | compiler/rustc_passes/src/check_attr.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_passes/src/stability.rs | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index f3fc26e4784..3afe609bd0f 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -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(), diff --git a/compiler/rustc_passes/src/stability.rs b/compiler/rustc_passes/src/stability.rs index 78afa2f25f8..172a948b372 100644 --- a/compiler/rustc_passes/src/stability.rs +++ b/compiler/rustc_passes/src/stability.rs @@ -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, |
