Skip to content

Commit 144d1c2

Browse files
committed
Review nits.
1 parent 68b1ac9 commit 144d1c2

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed

src/librustc_driver/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,6 @@ pub fn run_compiler(
393393

394394
queries.ongoing_codegen()?;
395395

396-
// Drop GlobalCtxt after starting codegen to free memory
397-
mem::drop(queries.global_ctxt()?.take());
398-
399396
if sess.opts.debugging_opts.print_type_sizes {
400397
sess.code_stats.print_type_sizes();
401398
}

src/librustc_interface/queries.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ impl Linker {
317317

318318
impl Compiler {
319319
pub fn enter<F, T>(&self, f: F) -> T
320-
where F: for<'q> FnOnce(&'q Queries<'_>) -> T
320+
where F: FnOnce(&Queries<'_>) -> T
321321
{
322322
let queries = Queries::new(&self);
323323
f(&queries)
@@ -345,9 +345,6 @@ impl Compiler {
345345

346346
queries.ongoing_codegen()?;
347347

348-
// Drop GlobalCtxt after starting codegen to free memory.
349-
mem::drop(queries.global_ctxt()?.take());
350-
351348
let linker = queries.linker()?;
352349
Ok(Some(linker))
353350
})?;

src/librustdoc/core.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
343343
registry: rustc_driver::diagnostics_registry(),
344344
};
345345

346-
interface::run_compiler_in_existing_thread_pool(config, |compiler| { compiler.enter(|queries| {
346+
interface::run_compiler_in_existing_thread_pool(config, |compiler| compiler.enter(|queries| {
347347
let sess = compiler.session();
348348

349349
// We need to hold on to the complete resolver, so we cause everything to be
@@ -487,7 +487,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
487487

488488
(krate, ctxt.renderinfo.into_inner(), render_options)
489489
})
490-
}) })
490+
}))
491491
}
492492

493493
/// `DefId` or parameter index (`ty::ParamTy.index`) of a synthetic type parameter

src/librustdoc/test.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub fn run(options: Options) -> i32 {
8585
let mut test_args = options.test_args.clone();
8686
let display_warnings = options.display_warnings;
8787

88-
let tests = interface::run_compiler(config, |compiler| { compiler.enter(|queries| {
88+
let tests = interface::run_compiler(config, |compiler| compiler.enter(|queries| {
8989
let lower_to_hir = queries.lower_to_hir()?;
9090

9191
let mut opts = scrape_test_config(lower_to_hir.peek().0.borrow().krate());
@@ -119,7 +119,7 @@ pub fn run(options: Options) -> i32 {
119119

120120
let ret : Result<_, ErrorReported> = Ok(collector.tests);
121121
ret
122-
}) }).expect("compiler aborted in rustdoc!");
122+
})).expect("compiler aborted in rustdoc!");
123123

124124
test_args.insert(0, "rustdoctest".to_string());
125125

0 commit comments

Comments
 (0)