Skip to content

Commit 09c807e

Browse files
committed
Add two useful comments.
1 parent cf56190 commit 09c807e

File tree

1 file changed

+4
-0
lines changed
  • compiler/rustc_driver_impl/src

1 file changed

+4
-0
lines changed

compiler/rustc_driver_impl/src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,8 @@ fn run_compiler(
455455

456456
let ongoing_codegen = queries.ongoing_codegen()?;
457457

458+
// This must run after monomorphization so that all generic types
459+
// have been instantiated.
458460
if sess.opts.unstable_opts.print_type_sizes {
459461
sess.code_stats.print_type_sizes();
460462
}
@@ -469,6 +471,8 @@ fn run_compiler(
469471
Ok(Some(linker))
470472
})?;
471473

474+
// Linking is done outside the `compiler.enter()` so that the
475+
// `GlobalCtxt` within `Queries` can be freed as early as possible.
472476
if let Some(linker) = linker {
473477
let _timer = sess.timer("link");
474478
linker.link(sess, codegen_backend)?

0 commit comments

Comments
 (0)