Skip to content

Commit

Permalink
Remove unnecessary call to queries.crate_name()
Browse files Browse the repository at this point in the history
It's much more complicated than just going through the TyCtxt.
  • Loading branch information
jyn514 committed Jun 21, 2021
1 parent e82b650 commit 9224b6f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/librustdoc/doctest.rs
Expand Up @@ -4,6 +4,7 @@ use rustc_data_structures::sync::Lrc;
use rustc_errors::{ColorConfig, ErrorReported};
use rustc_hir as hir;
use rustc_hir::intravisit;
use rustc_hir::def_id::LOCAL_CRATE;
use rustc_hir::{HirId, CRATE_HIR_ID};
use rustc_interface::interface;
use rustc_middle::hir::map::Map;
Expand Down Expand Up @@ -111,8 +112,6 @@ crate fn run(options: Options) -> Result<(), ErrorReported> {
let res = interface::run_compiler(config, |compiler| {
compiler.enter(|queries| {
let _lower_to_hir = queries.lower_to_hir()?;

let crate_name = queries.crate_name()?.peek().to_string();
let mut global_ctxt = queries.global_ctxt()?.take();

let collector = global_ctxt.enter(|tcx| {
Expand All @@ -123,7 +122,7 @@ crate fn run(options: Options) -> Result<(), ErrorReported> {
opts.display_warnings |= options.display_warnings;
let enable_per_target_ignores = options.enable_per_target_ignores;
let mut collector = Collector::new(
crate_name,
tcx.crate_name(LOCAL_CRATE).to_string(),
options,
false,
opts,
Expand Down

0 comments on commit 9224b6f

Please sign in to comment.