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. 
This commit is contained in:
commit
a391d545cf
3 changed files with 7 additions and 15 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue