Skip to content

Commit eb010df

Browse files
committed
Auto merge of #105603 - oli-obk:non_repeatable_queries, r=petrochenkov
Harden the pre-tyctxt query system against accidental recomputation While the current compiler has no issues where we `take` and then compute the query again, in rust-lang/rust#105462 I accidentally introduced such a case. I also took the opportunity to remove `peek_mut`, which is only ever used for `global_tcx` to then invoke `enter`. I added an `enter` method directly on the query.
2 parents 0f94521 + 71faf0a commit eb010df

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bin/miri.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
6161
) -> Compilation {
6262
compiler.session().abort_if_errors();
6363

64-
queries.global_ctxt().unwrap().peek_mut().enter(|tcx| {
64+
queries.global_ctxt().unwrap().enter(|tcx| {
6565
init_late_loggers(tcx);
6666
if !tcx.sess.crate_types().contains(&CrateType::Executable) {
6767
tcx.sess.fatal("miri only makes sense on bin crates");

0 commit comments

Comments
 (0)