diff --git a/src/librustc_middle/ty/context.rs b/src/librustc_middle/ty/context.rs index 0298f3d8442a6..3a08d202ea385 100644 --- a/src/librustc_middle/ty/context.rs +++ b/src/librustc_middle/ty/context.rs @@ -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)) diff --git a/src/librustc_typeck/check/op.rs b/src/librustc_typeck/check/op.rs index 00ff2af82e303..d89993e354768 100644 --- a/src/librustc_typeck/check/op.rs +++ b/src/librustc_typeck/check/op.rs @@ -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 } } }