about summary refs log tree commit diff
path: root/compiler/rustc_mir_build/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-04-23 13:34:31 +0000
committerbors <bors@rust-lang.org>2023-04-23 13:34:31 +0000
commit3462f79e94f466a56ddaccfcdd3a3d44dd1dda9f (patch)
treed9290e986ca70199a6b61e4324a8206fc994374c /compiler/rustc_mir_build/src
parent9e540df7931a32ca286eb2e907afde78b718fd17 (diff)
parent334423263a347b38ed0040be788feb3a4197c056 (diff)
downloadrust-3462f79e94f466a56ddaccfcdd3a3d44dd1dda9f.tar.gz
rust-3462f79e94f466a56ddaccfcdd3a3d44dd1dda9f.zip
Auto merge of #108118 - oli-obk:lazy_typeck, r=cjgillot
Run various queries from other queries instead of explicitly in phases

These are just legacy leftovers from when rustc didn't have a query system. While there are more cleanups of this sort that can be done here, I want to land them in smaller steps.

This phased order of query invocations was already a lie, as any query that looks at types (e.g. the wf checks run before) can invoke e.g. const eval which invokes borrowck, which invokes typeck, ...
Diffstat (limited to 'compiler/rustc_mir_build/src')
-rw-r--r--compiler/rustc_mir_build/src/build/mod.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_mir_build/src/build/mod.rs b/compiler/rustc_mir_build/src/build/mod.rs
index b05c3056cba..82274318dcf 100644
--- a/compiler/rustc_mir_build/src/build/mod.rs
+++ b/compiler/rustc_mir_build/src/build/mod.rs
@@ -51,6 +51,13 @@ fn mir_build(tcx: TyCtxt<'_>, def: LocalDefId) -> Body<'_> {
             // of `mir_build`, so now we can steal it
             let thir = thir.steal();
 
+            tcx.ensure().check_match(def);
+            // this must run before MIR dump, because
+            // "not all control paths return a value" is reported here.
+            //
+            // maybe move the check to a MIR pass?
+            tcx.ensure().check_liveness(def);
+
             match thir.body_type {
                 thir::BodyTy::Fn(fn_sig) => construct_fn(tcx, def, &thir, expr, fn_sig),
                 thir::BodyTy::Const(ty) => construct_const(tcx, def, &thir, expr, ty),