From 7353c96be899f02f52455f61bfaf49b80022a182 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Wed, 9 Aug 2023 20:28:00 +0800 Subject: rustc: Move `features` from `Session` to `GlobalCtxt` Removes two pieces of mutable state. Follow up to #114622. --- src/librustdoc/clean/inline.rs | 4 ++-- src/librustdoc/html/format.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs index 384010034e6..389bac0f09d 100644 --- a/src/librustdoc/clean/inline.rs +++ b/src/librustdoc/clean/inline.rs @@ -200,7 +200,7 @@ pub(crate) fn record_extern_fqn(cx: &mut DocContext<'_>, did: DefId, kind: ItemT let fqn = if let ItemType::Macro = kind { // Check to see if it is a macro 2.0 or built-in macro if matches!( - CStore::from_tcx(cx.tcx).load_macro_untracked(did, cx.sess()), + CStore::from_tcx(cx.tcx).load_macro_untracked(did, cx.tcx), LoadedMacro::MacroDef(def, _) if matches!(&def.kind, ast::ItemKind::MacroDef(ast_def) if !ast_def.macro_rules) @@ -680,7 +680,7 @@ fn build_macro( import_def_id: Option, macro_kind: MacroKind, ) -> clean::ItemKind { - match CStore::from_tcx(cx.tcx).load_macro_untracked(def_id, cx.sess()) { + match CStore::from_tcx(cx.tcx).load_macro_untracked(def_id, cx.tcx) { LoadedMacro::MacroDef(item_def, _) => match macro_kind { MacroKind::Bang => { if let ast::ItemKind::MacroDef(ref def) = item_def.kind { diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index eb5d3c88570..58022046294 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -604,7 +604,7 @@ fn generate_macro_def_id_path( } // Check to see if it is a macro 2.0 or built-in macro. // More information in . - let is_macro_2 = match cstore.load_macro_untracked(def_id, tcx.sess) { + 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) -- cgit 1.4.1-3-g733a5