Skip to content

Commit

Permalink
Rollup merge of #72752 - lcnr:remove-mk_bool, r=estebank
Browse files Browse the repository at this point in the history
remove mk_bool
  • Loading branch information
JohnTitor authored May 30, 2020
2 parents c20a97d + 25bafc2 commit 025058f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
5 changes: 0 additions & 5 deletions src/librustc_middle/ty/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
8 changes: 4 additions & 4 deletions src/librustc_typeck/check/op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand All @@ -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
}
}
}
Expand Down

0 comments on commit 025058f

Please sign in to comment.