1
Fork 0

Rollup merge of #72752 - lcnr:remove-mk_bool, r=estebank

remove mk_bool
This commit is contained in:
Yuki Okushi 2020-05-30 12:39:24 +09:00 committed by GitHub
commit 025058f2aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 9 deletions

View file

@ -2251,11 +2251,6 @@ impl<'tcx> TyCtxt<'tcx> {
if self.features().never_type_fallback { self.types.never } else { self.types.unit }
}
#[inline]
pub fn mk_bool(self) -> Ty<'tcx> {
self.mk_ty(Bool)
}
#[inline]
pub fn mk_fn_def(self, def_id: DefId, substs: SubstsRef<'tcx>) -> Ty<'tcx> {
self.mk_ty(FnDef(def_id, substs))

View file

@ -121,9 +121,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
let tcx = self.tcx;
match BinOpCategory::from(op) {
BinOpCategory::Shortcircuit => {
self.demand_suptype(*lhs_span, tcx.mk_bool(), lhs_ty);
self.demand_suptype(*rhs_span, tcx.mk_bool(), rhs_ty);
tcx.mk_bool()
self.demand_suptype(*lhs_span, tcx.types.bool, lhs_ty);
self.demand_suptype(*rhs_span, tcx.types.bool, rhs_ty);
tcx.types.bool
}
BinOpCategory::Shift => {
@ -140,7 +140,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
BinOpCategory::Comparison => {
// both LHS and RHS and result will have the same type
self.demand_suptype(*rhs_span, lhs_ty, rhs_ty);
tcx.mk_bool()
tcx.types.bool
}
}
}