about summary refs log tree commit diff
path: root/compiler/rustc_session/src
diff options
context:
space:
mode:
authorJakub Beránek <berykubik@gmail.com>2025-06-02 15:19:19 +0200
committerGitHub <noreply@github.com>2025-06-02 15:19:19 +0200
commitf8e756b0eb5a6ed95d888e4c2429aae5eaca9126 (patch)
tree7c586e47f66579469778018c45b6a943bcd249b0 /compiler/rustc_session/src
parentaeb72a0669fda604b63ad43c924b93503646970a (diff)
parent1e169d8dc406ff2eb5cd38b35053e2f50cbb0f54 (diff)
downloadrust-f8e756b0eb5a6ed95d888e4c2429aae5eaca9126.tar.gz
rust-f8e756b0eb5a6ed95d888e4c2429aae5eaca9126.zip
Rollup merge of #141865 - Nadrieril:dont-steal-thir, r=oli-obk
Optionally don't steal the THIR

The THIR being stolen is a recurrent pain for authors of rustc drivers. This makes it optional, so that the `thir_body` query can still be used after analysis of the crate has completed.
Diffstat (limited to 'compiler/rustc_session/src')
-rw-r--r--compiler/rustc_session/src/options.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs
index 5b4068740a1..12fa05118ca 100644
--- a/compiler/rustc_session/src/options.rs
+++ b/compiler/rustc_session/src/options.rs
@@ -2366,6 +2366,8 @@ options! {
         "run LLVM in non-parallel mode (while keeping codegen-units and ThinLTO)"),
     no_profiler_runtime: bool = (false, parse_no_value, [TRACKED],
         "prevent automatic injection of the profiler_builtins crate"),
+    no_steal_thir: bool = (false, parse_bool, [UNTRACKED],
+        "don't steal the THIR when we're done with it; useful for rustc drivers (default: no)"),
     no_trait_vptr: bool = (false, parse_no_value, [TRACKED],
         "disable generation of trait vptr in vtable for upcasting"),
     no_unique_section_names: bool = (false, parse_bool, [TRACKED],