mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Rollup merge of #88462 - petrochenkov:macstore, r=jyn514
rustdoc: Stop using resolver for macro loading r? `@jyn514`
This commit is contained in:
commit
d47b7d77a4
@ -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};
|
||||
@ -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)
|
||||
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user