From 69e5b2fde01e93a19a8102201ed1b1d2cab0661d Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Sat, 30 Apr 2022 22:02:11 +0200 Subject: [PATCH] Do not report overflow error. --- compiler/rustc_trait_selection/src/traits/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/rustc_trait_selection/src/traits/mod.rs b/compiler/rustc_trait_selection/src/traits/mod.rs index 8683de9fa744..81819534e8b3 100644 --- a/compiler/rustc_trait_selection/src/traits/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/mod.rs @@ -432,6 +432,9 @@ pub fn impossible_predicates<'tcx>( debug!("impossible_predicates(predicates={:?})", predicates); let result = tcx.infer_ctxt().enter(|infcx| { + // HACK: Set tainted by errors to gracefully exit in case of overflow. + infcx.set_tainted_by_errors(); + let param_env = ty::ParamEnv::reveal_all(); let mut selcx = SelectionContext::new(&infcx); let mut fulfill_cx = FulfillmentContext::new();