diff --git a/compiler/rustc_trait_selection/src/solve/project_goals/opaques.rs b/compiler/rustc_trait_selection/src/solve/project_goals/opaques.rs index 26dd63b70ff7..4f2f27c5c3e1 100644 --- a/compiler/rustc_trait_selection/src/solve/project_goals/opaques.rs +++ b/compiler/rustc_trait_selection/src/solve/project_goals/opaques.rs @@ -55,16 +55,19 @@ impl<'tcx> EvalCtxt<'_, 'tcx> { } let expected = match self.try_normalize_ty(goal.param_env, expected) { - Some(ty) => if ty.is_ty_var() { - return self.evaluate_added_goals_and_make_canonical_response( - Certainty::AMBIGUOUS, - ) - } else { - ty - }, - None => return self.evaluate_added_goals_and_make_canonical_response( - Certainty::OVERFLOW, - ), + Some(ty) => { + if ty.is_ty_var() { + return self.evaluate_added_goals_and_make_canonical_response( + Certainty::AMBIGUOUS, + ); + } else { + ty + } + } + None => { + return self + .evaluate_added_goals_and_make_canonical_response(Certainty::OVERFLOW); + } }; // Otherwise, define a new opaque type