about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2020-05-30 12:39:24 +0900
committerGitHub <noreply@github.com>2020-05-30 12:39:24 +0900
commit025058f2aa5bcc890d1db8cc71ff63f690b8df0f (patch)
tree6bd52d61abaa0eab87137167ee3d8e8556670858 /src
parentc20a97dd532ca719e9ec1232af057cd169d24d14 (diff)
parent25bafc24db9559db2fb3688d824a2a41ada150e5 (diff)
downloadrust-025058f2aa5bcc890d1db8cc71ff63f690b8df0f.tar.gz
rust-025058f2aa5bcc890d1db8cc71ff63f690b8df0f.zip
Rollup merge of #72752 - lcnr:remove-mk_bool, r=estebank
remove mk_bool
Diffstat (limited to 'src')
-rw-r--r--src/librustc_middle/ty/context.rs5
-rw-r--r--src/librustc_typeck/check/op.rs8
2 files changed, 4 insertions, 9 deletions
diff --git a/src/librustc_middle/ty/context.rs b/src/librustc_middle/ty/context.rs
index 0298f3d8442..3a08d202ea3 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
             }
         }
     }