diff options
| author | Bastian Kauschke <bastian_kauschke@hotmail.de> | 2020-05-29 20:41:26 +0200 |
|---|---|---|
| committer | Bastian Kauschke <bastian_kauschke@hotmail.de> | 2020-05-29 20:41:26 +0200 |
| commit | 25bafc24db9559db2fb3688d824a2a41ada150e5 (patch) | |
| tree | ef29946b10df51e41cb9d66af2f1ea5187960603 | |
| parent | 96dd4690c3aa70ec312448c3f2d50e6dc6fb87df (diff) | |
| download | rust-25bafc24db9559db2fb3688d824a2a41ada150e5.tar.gz rust-25bafc24db9559db2fb3688d824a2a41ada150e5.zip | |
remove mk_bool
| -rw-r--r-- | src/librustc_middle/ty/context.rs | 5 | ||||
| -rw-r--r-- | src/librustc_typeck/check/op.rs | 8 |
2 files changed, 4 insertions, 9 deletions
diff --git a/src/librustc_middle/ty/context.rs b/src/librustc_middle/ty/context.rs index 7a200144841..49d751ea8ae 100644 --- a/src/librustc_middle/ty/context.rs +++ b/src/librustc_middle/ty/context.rs @@ -2252,11 +2252,6 @@ impl<'tcx> TyCtxt<'tcx> { } #[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 00ff2af82e3..d89993e3547 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 } } } |
