diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2024-10-26 18:51:15 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2024-10-26 22:08:55 +0300 |
| commit | b93a2dd0efeb00238543fd199ebdb8bb0f96bad7 (patch) | |
| tree | 8c91bdd763e91395d89b311df1393cb8371d6d3f /src/librustdoc/html/format.rs | |
| parent | 9260be36b2dbd896c6b233d60d1c429a75a0081a (diff) | |
| download | rust-b93a2dd0efeb00238543fd199ebdb8bb0f96bad7.tar.gz rust-b93a2dd0efeb00238543fd199ebdb8bb0f96bad7.zip | |
expand: Stop using artificial `ast::Item` for macros loaded from metadata
Diffstat (limited to 'src/librustdoc/html/format.rs')
| -rw-r--r-- | src/librustdoc/html/format.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index ea2f930ab83..8e8e5c6ade8 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -16,6 +16,7 @@ use itertools::Itertools; use rustc_attr::{ConstStability, StabilityLevel, StableSince}; use rustc_data_structures::captures::Captures; use rustc_data_structures::fx::FxHashSet; +use rustc_hir as hir; use rustc_hir::def::DefKind; use rustc_hir::def_id::{DefId, LOCAL_CRATE}; use rustc_metadata::creader::{CStore, LoadedMacro}; @@ -25,7 +26,6 @@ use rustc_span::symbol::kw; use rustc_span::{Symbol, sym}; use rustc_target::spec::abi::Abi; use tracing::{debug, trace}; -use {rustc_ast as ast, rustc_hir as hir}; use super::url_parts_builder::{UrlPartsBuilder, estimate_item_path_byte_length}; use crate::clean::types::ExternalLocation; @@ -554,10 +554,8 @@ fn generate_macro_def_id_path( // Check to see if it is a macro 2.0 or built-in macro. // More information in <https://rust-lang.github.io/rfcs/1584-macros.html>. let is_macro_2 = match cstore.load_macro_untracked(def_id, tcx) { - LoadedMacro::MacroDef(def, _) => { - // If `ast_def.macro_rules` is `true`, then it's not a macro 2.0. - matches!(&def.kind, ast::ItemKind::MacroDef(ast_def) if !ast_def.macro_rules) - } + // If `def.macro_rules` is `true`, then it's not a macro 2.0. + LoadedMacro::MacroDef { def, .. } => !def.macro_rules, _ => false, }; |
