mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Remove TyCtxt::hir_krate
.
It's a trivial wrapper around the `hir_crate` query with a small number of uses.
This commit is contained in:
parent
661f99ba03
commit
f666361caa
@ -294,7 +294,7 @@ pub fn print<'tcx>(sess: &Session, ppm: PpMode, ex: PrintExtra<'tcx>) {
|
||||
}
|
||||
HirTree => {
|
||||
debug!("pretty printing HIR tree");
|
||||
format!("{:#?}", ex.tcx().hir_krate())
|
||||
format!("{:#?}", ex.tcx().hir_crate(()))
|
||||
}
|
||||
Mir => {
|
||||
let mut out = Vec::new();
|
||||
|
@ -165,12 +165,6 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||
self.hir_node(self.parent_hir_id(hir_id))
|
||||
}
|
||||
|
||||
/// Best avoided in favour of more targeted methods. See the comment on the `hir_crate` query.
|
||||
#[inline]
|
||||
pub fn hir_krate(self) -> &'tcx Crate<'tcx> {
|
||||
self.hir_crate(())
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn hir_root_module(self) -> &'tcx Mod<'tcx> {
|
||||
match self.hir_owner_node(CRATE_OWNER_ID) {
|
||||
@ -414,7 +408,7 @@ impl<'hir> Map<'hir> {
|
||||
where
|
||||
V: Visitor<'hir>,
|
||||
{
|
||||
let krate = self.tcx.hir_krate();
|
||||
let krate = self.tcx.hir_crate(());
|
||||
for info in krate.owners.iter() {
|
||||
if let MaybeOwner::Owner(info) = info {
|
||||
for attrs in info.attrs.map.values() {
|
||||
|
@ -378,7 +378,7 @@ pub(crate) fn run_global_ctxt(
|
||||
ctxt.external_traits.insert(sized_trait_did, sized_trait);
|
||||
}
|
||||
|
||||
debug!("crate: {:?}", tcx.hir_krate());
|
||||
debug!("crate: {:?}", tcx.hir_crate(()));
|
||||
|
||||
let mut krate = tcx.sess.time("clean_crate", || clean::krate(&mut ctxt));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user