1
Fork 0

Auto merge of #139234 - compiler-errors:query-tweak, r=oli-obk

Misc query tweaks

Remove some redundant work around `cache_on_disk` and `ensure_ok`, since `Result<(), ErrorGuaranteed>` queries don't need to cache or recompute their "value" if they are only used for their result.
This commit is contained in:
bors 2025-04-03 00:13:54 +00:00
commit 3658060890
5 changed files with 8 additions and 11 deletions

View file

@ -48,11 +48,11 @@ pub(crate) fn closure_saved_names_of_captured_variables<'tcx>(
/// this directly; instead use the cached version via `mir_built`.
pub fn build_mir<'tcx>(tcx: TyCtxt<'tcx>, def: LocalDefId) -> Body<'tcx> {
tcx.ensure_done().thir_abstract_const(def);
if let Err(e) = tcx.check_match(def) {
if let Err(e) = tcx.ensure_ok().check_match(def) {
return construct_error(tcx, def, e);
}
if let Err(err) = tcx.check_tail_calls(def) {
if let Err(err) = tcx.ensure_ok().check_tail_calls(def) {
return construct_error(tcx, def, err);
}