Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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