about summary refs log tree commit diff
path: root/compiler/rustc_driver_impl/src/lib.rs
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-11-04 18:02:31 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-11-05 16:29:15 +0000
commit1a1b10fa637e422a00af82941f9854928c12bf95 (patch)
tree87a33a80b0f831f6c1354f39c6cc52166af38c7a /compiler/rustc_driver_impl/src/lib.rs
parent992943dbaeee9d9829e82a95b788ab845ad38d0c (diff)
downloadrust-1a1b10fa637e422a00af82941f9854928c12bf95.tar.gz
rust-1a1b10fa637e422a00af82941f9854928c12bf95.zip
Don't steal the parse query when using --pretty
This is the only place aside from the global_ctxt query where it is
stolen.
Diffstat (limited to 'compiler/rustc_driver_impl/src/lib.rs')
-rw-r--r--compiler/rustc_driver_impl/src/lib.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs
index ee4337754a9..19e0a61e820 100644
--- a/compiler/rustc_driver_impl/src/lib.rs
+++ b/compiler/rustc_driver_impl/src/lib.rs
@@ -421,8 +421,12 @@ fn run_compiler(
                     // effects of writing the dep-info and reporting errors.
                     queries.global_ctxt()?.enter(|tcx| tcx.output_filenames(()));
                 } else {
-                    let krate = queries.parse()?.steal();
-                    pretty::print(sess, *ppm, pretty::PrintExtra::AfterParsing { krate });
+                    let krate = queries.parse()?;
+                    pretty::print(
+                        sess,
+                        *ppm,
+                        pretty::PrintExtra::AfterParsing { krate: &*krate.borrow() },
+                    );
                 }
                 trace!("finished pretty-printing");
                 return early_exit();