Skip to content

Commit 9224b6f

Browse files
committed
Remove unnecessary call to queries.crate_name()
It's much more complicated than just going through the TyCtxt.
1 parent e82b650 commit 9224b6f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/librustdoc/doctest.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use rustc_data_structures::sync::Lrc;
44
use rustc_errors::{ColorConfig, ErrorReported};
55
use rustc_hir as hir;
66
use rustc_hir::intravisit;
7+
use rustc_hir::def_id::LOCAL_CRATE;
78
use rustc_hir::{HirId, CRATE_HIR_ID};
89
use rustc_interface::interface;
910
use rustc_middle::hir::map::Map;
@@ -111,8 +112,6 @@ crate fn run(options: Options) -> Result<(), ErrorReported> {
111112
let res = interface::run_compiler(config, |compiler| {
112113
compiler.enter(|queries| {
113114
let _lower_to_hir = queries.lower_to_hir()?;
114-
115-
let crate_name = queries.crate_name()?.peek().to_string();
116115
let mut global_ctxt = queries.global_ctxt()?.take();
117116

118117
let collector = global_ctxt.enter(|tcx| {
@@ -123,7 +122,7 @@ crate fn run(options: Options) -> Result<(), ErrorReported> {
123122
opts.display_warnings |= options.display_warnings;
124123
let enable_per_target_ignores = options.enable_per_target_ignores;
125124
let mut collector = Collector::new(
126-
crate_name,
125+
tcx.crate_name(LOCAL_CRATE).to_string(),
127126
options,
128127
false,
129128
opts,

0 commit comments

Comments
 (0)