Skip to content

Commit 025058f

Browse files
authored
Rollup merge of rust-lang#72752 - lcnr:remove-mk_bool, r=estebank
remove mk_bool
2 parents c20a97d + 25bafc2 commit 025058f

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

src/librustc_middle/ty/context.rs

-5
Original file line numberDiff line numberDiff line change
@@ -2251,11 +2251,6 @@ impl<'tcx> TyCtxt<'tcx> {
22512251
if self.features().never_type_fallback { self.types.never } else { self.types.unit }
22522252
}
22532253

2254-
#[inline]
2255-
pub fn mk_bool(self) -> Ty<'tcx> {
2256-
self.mk_ty(Bool)
2257-
}
2258-
22592254
#[inline]
22602255
pub fn mk_fn_def(self, def_id: DefId, substs: SubstsRef<'tcx>) -> Ty<'tcx> {
22612256
self.mk_ty(FnDef(def_id, substs))

src/librustc_typeck/check/op.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
121121
let tcx = self.tcx;
122122
match BinOpCategory::from(op) {
123123
BinOpCategory::Shortcircuit => {
124-
self.demand_suptype(*lhs_span, tcx.mk_bool(), lhs_ty);
125-
self.demand_suptype(*rhs_span, tcx.mk_bool(), rhs_ty);
126-
tcx.mk_bool()
124+
self.demand_suptype(*lhs_span, tcx.types.bool, lhs_ty);
125+
self.demand_suptype(*rhs_span, tcx.types.bool, rhs_ty);
126+
tcx.types.bool
127127
}
128128

129129
BinOpCategory::Shift => {
@@ -140,7 +140,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
140140
BinOpCategory::Comparison => {
141141
// both LHS and RHS and result will have the same type
142142
self.demand_suptype(*rhs_span, lhs_ty, rhs_ty);
143-
tcx.mk_bool()
143+
tcx.types.bool
144144
}
145145
}
146146
}

0 commit comments

Comments
 (0)