1
Fork 0

Rollup merge of #92022 - woodenarrow:br_expected_bool, r=estebank

Eliminate duplicate codes of expected_found_bool

The function expected_found_bool is the same as ExpectedFound::new. So use ExpectedFound::new to replace expected_found_bool to eliminate duplicate codes.

![image](https://user-images.githubusercontent.com/95843988/146486722-c910eccd-a36c-4dc5-8b36-214aab058e38.png)
This commit is contained in:
Matthias Krüger 2021-12-18 11:28:06 +01:00 committed by GitHub
commit a391d545cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 15 deletions

View file

@ -36,8 +36,8 @@ use rustc_infer::infer;
use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
use rustc_infer::infer::InferOk;
use rustc_middle::ty::adjustment::{Adjust, Adjustment, AllowTwoPhase};
use rustc_middle::ty::error::ExpectedFound;
use rustc_middle::ty::error::TypeError::{FieldMisMatch, Sorts};
use rustc_middle::ty::relate::expected_found_bool;
use rustc_middle::ty::subst::SubstsRef;
use rustc_middle::ty::{self, AdtKind, Ty, TypeFoldable};
use rustc_session::parse::feature_err;
@ -1493,7 +1493,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
&self.misc(base_expr.span),
adt_ty,
base_ty,
Sorts(expected_found_bool(true, adt_ty, base_ty)),
Sorts(ExpectedFound::new(true, adt_ty, base_ty)),
)
.emit();
}