Use {Local}ModDefId in many queries

This commit is contained in:
Nilstrieb
2023-04-26 20:53:51 +02:00
committed by Deadbeef
parent 40de40e094
commit c75fc573aa
26 changed files with 177 additions and 98 deletions

View File

@@ -355,8 +355,8 @@ impl TyCtxt<'_> {
#[inline]
#[track_caller]
pub fn local_parent(self, id: LocalDefId) -> LocalDefId {
self.parent(id.to_def_id()).expect_local()
pub fn local_parent(self, id: impl Into<LocalDefId>) -> LocalDefId {
self.parent(id.into().to_def_id()).expect_local()
}
pub fn is_descendant_of(self, mut descendant: DefId, ancestor: DefId) -> bool {