diff options
| author | Orion Gonzalez <ardi@ardis.dev> | 2024-08-27 20:04:47 +0200 |
|---|---|---|
| committer | Orion Gonzalez <ardi@ardis.dev> | 2024-08-28 13:11:02 +0200 |
| commit | a007d349a1ccd6f998049e3acbf99e0df17a5c49 (patch) | |
| tree | 1790cb8fca2a2af744e23aee1d4c29d9879cd001 /compiler/rustc_driver_impl | |
| parent | b218623ea030885e88730413c61e3d47ed2905da (diff) | |
| download | rust-a007d349a1ccd6f998049e3acbf99e0df17a5c49.tar.gz rust-a007d349a1ccd6f998049e3acbf99e0df17a5c49.zip | |
clarify a few things
Diffstat (limited to 'compiler/rustc_driver_impl')
| -rw-r--r-- | compiler/rustc_driver_impl/src/lib.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs index 76bff6a87f3..f7755147536 100644 --- a/compiler/rustc_driver_impl/src/lib.rs +++ b/compiler/rustc_driver_impl/src/lib.rs @@ -391,13 +391,17 @@ fn run_compiler( let linker = compiler.enter(|queries| { let early_exit = || early_exit().map(|_| None); + + // Parse the crate root source code (doesn't parse submodules yet) + // Everything else is parsed during macro expansion. queries.parse()?; - if let Some(ppm) = &sess.opts.pretty { - if ppm.needs_ast_map() { + // If pretty printing is requested: Figure out the representation, print it and exit + if let Some(pp_mode) = sess.opts.pretty { + if pp_mode.needs_ast_map() { queries.global_ctxt()?.enter(|tcx| { tcx.ensure().early_lint_checks(()); - pretty::print(sess, *ppm, pretty::PrintExtra::NeedsAstMap { tcx }); + pretty::print(sess, pp_mode, pretty::PrintExtra::NeedsAstMap { tcx }); Ok(()) })?; @@ -408,7 +412,7 @@ fn run_compiler( let krate = queries.parse()?; pretty::print( sess, - *ppm, + pp_mode, pretty::PrintExtra::AfterParsing { krate: &*krate.borrow() }, ); } |
