rustc_trait_selection: adopt let else in more places

This commit is contained in:
est31 2022-02-19 00:48:31 +01:00
parent b8c56fa8c3
commit dab5c44800
10 changed files with 75 additions and 117 deletions

View file

@ -148,7 +148,7 @@ impl<'tcx> AutoTraitFinder<'tcx> {
// traits::project will see that 'T: SomeTrait' is in our ParamEnv, allowing
// SelectionContext to return it back to us.
let (new_env, user_env) = match self.evaluate_predicates(
let Some((new_env, user_env)) = self.evaluate_predicates(
&infcx,
trait_did,
ty,
@ -156,9 +156,8 @@ impl<'tcx> AutoTraitFinder<'tcx> {
orig_env,
&mut fresh_preds,
false,
) {
Some(e) => e,
None => return AutoTraitResult::NegativeImpl,
) else {
return AutoTraitResult::NegativeImpl;
};
let (full_env, full_user_env) = self