From d2afab4d60d393bcaead85b051a33b8fddeaf5a6 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Sun, 8 Jun 2025 22:40:40 -0400 Subject: [PATCH] Dont make ObligationCtxts with diagnostics unnecessarily --- compiler/rustc_const_eval/src/check_consts/check.rs | 2 +- compiler/rustc_ty_utils/src/ty.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_const_eval/src/check_consts/check.rs b/compiler/rustc_const_eval/src/check_consts/check.rs index 6167f8cd4b511..9719d4052590a 100644 --- a/compiler/rustc_const_eval/src/check_consts/check.rs +++ b/compiler/rustc_const_eval/src/check_consts/check.rs @@ -395,7 +395,7 @@ impl<'mir, 'tcx> Checker<'mir, 'tcx> { } let (infcx, param_env) = tcx.infer_ctxt().build_with_typing_env(self.body.typing_env(tcx)); - let ocx = ObligationCtxt::new_with_diagnostics(&infcx); + let ocx = ObligationCtxt::new(&infcx); let body_id = self.body.source.def_id().expect_local(); let host_polarity = match self.const_kind() { diff --git a/compiler/rustc_ty_utils/src/ty.rs b/compiler/rustc_ty_utils/src/ty.rs index e39fd6b947b47..4dc27622d235a 100644 --- a/compiler/rustc_ty_utils/src/ty.rs +++ b/compiler/rustc_ty_utils/src/ty.rs @@ -319,7 +319,7 @@ fn impl_self_is_guaranteed_unsized<'tcx>(tcx: TyCtxt<'tcx>, impl_def_id: DefId) let infcx = tcx.infer_ctxt().ignoring_regions().build(ty::TypingMode::non_body_analysis()); - let ocx = traits::ObligationCtxt::new_with_diagnostics(&infcx); + let ocx = traits::ObligationCtxt::new(&infcx); let cause = traits::ObligationCause::dummy(); let param_env = tcx.param_env(impl_def_id);