diff --git a/compiler/rustc_resolve/src/effective_visibilities.rs b/compiler/rustc_resolve/src/effective_visibilities.rs index 85399385d1fd..3a7d463a6258 100644 --- a/compiler/rustc_resolve/src/effective_visibilities.rs +++ b/compiler/rustc_resolve/src/effective_visibilities.rs @@ -107,7 +107,7 @@ impl<'r, 'a> EffectiveVisibilitiesVisitor<'r, 'a> { r.effective_visibilities.update_eff_vis( r.local_def_id(node_id), eff_vis, - ResolverTree(&r.definitions, &r.crate_loader), + ResolverTree(&r.definitions, r.crate_loader.cstore()), ) } } diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index 82f5d0f534a4..816dc4cb4dcc 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -1112,15 +1112,15 @@ impl<'a> AsMut> for Resolver<'a> { /// A minimal subset of resolver that can implemenent `DefIdTree`, sometimes /// required to satisfy borrow checker by avoiding borrowing the whole resolver. #[derive(Clone, Copy)] -struct ResolverTree<'a, 'b>(&'a Definitions, &'a CrateLoader<'b>); +struct ResolverTree<'a>(&'a Definitions, &'a CStore); -impl DefIdTree for ResolverTree<'_, '_> { +impl DefIdTree for ResolverTree<'_> { #[inline] fn opt_parent(self, id: DefId) -> Option { - let ResolverTree(definitions, crate_loader) = self; + let ResolverTree(definitions, cstore) = self; match id.as_local() { Some(id) => definitions.def_key(id).parent, - None => crate_loader.cstore().def_key(id).parent, + None => cstore.def_key(id).parent, } .map(|index| DefId { index, ..id }) } @@ -1129,7 +1129,7 @@ impl DefIdTree for ResolverTree<'_, '_> { impl<'a, 'b> DefIdTree for &'a Resolver<'b> { #[inline] fn opt_parent(self, id: DefId) -> Option { - ResolverTree(&self.definitions, &self.crate_loader).opt_parent(id) + ResolverTree(&self.definitions, self.cstore()).opt_parent(id) } }