Skip to content

Commit

Permalink
Rollup merge of #88462 - petrochenkov:macstore, r=jyn514
Browse files Browse the repository at this point in the history
rustdoc: Stop using resolver for macro loading

r? `@jyn514`
  • Loading branch information
m-ou-se authored Aug 31, 2021
2 parents 7696aca + b8728e7 commit d47b7d7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/librustdoc/clean/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use rustc_hir as hir;
use rustc_hir::def::{DefKind, Res};
use rustc_hir::def_id::DefId;
use rustc_hir::Mutability;
use rustc_metadata::creader::LoadedMacro;
use rustc_metadata::creader::{CStore, LoadedMacro};
use rustc_middle::ty::{self, TyCtxt};
use rustc_span::hygiene::MacroKind;
use rustc_span::symbol::{kw, sym, Symbol};
Expand Down Expand Up @@ -179,7 +179,7 @@ crate fn record_extern_fqn(cx: &mut DocContext<'_>, did: DefId, kind: ItemType)
let fqn = if let ItemType::Macro = kind {
// Check to see if it is a macro 2.0 or built-in macro
if matches!(
cx.enter_resolver(|r| r.cstore().load_macro_untracked(did, cx.sess())),
CStore::from_tcx(cx.tcx).load_macro_untracked(did, cx.sess()),
LoadedMacro::MacroDef(def, _)
if matches!(&def.kind, ast::ItemKind::MacroDef(ast_def)
if !ast_def.macro_rules)
Expand Down Expand Up @@ -558,7 +558,7 @@ fn build_macro(
import_def_id: Option<DefId>,
) -> clean::ItemKind {
let imported_from = cx.tcx.crate_name(def_id.krate);
match cx.enter_resolver(|r| r.cstore().load_macro_untracked(def_id, cx.sess())) {
match CStore::from_tcx(cx.tcx).load_macro_untracked(def_id, cx.sess()) {
LoadedMacro::MacroDef(item_def, _) => {
if let ast::ItemKind::MacroDef(ref def) = item_def.kind {
clean::MacroItem(clean::Macro {
Expand Down

0 comments on commit d47b7d7

Please sign in to comment.