From 5183c9f08345c664237ae138e86f96ff46714f15 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Sun, 28 Feb 2021 01:20:04 +0100 Subject: Introduce TypeCtor::Scalar --- crates/hir/src/code_model.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'crates/hir/src/code_model.rs') diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs index b3218833d..4109b2ea8 100644 --- a/crates/hir/src/code_model.rs +++ b/crates/hir/src/code_model.rs @@ -32,8 +32,8 @@ use hir_ty::{ method_resolution, traits::{FnTrait, Solution, SolutionVariables}, ApplicationTy, BoundVar, CallableDefId, Canonical, DebruijnIndex, FnSig, GenericPredicate, - InEnvironment, Obligation, ProjectionPredicate, ProjectionTy, Substs, TraitEnvironment, Ty, - TyDefId, TyKind, TypeCtor, + InEnvironment, Obligation, ProjectionPredicate, ProjectionTy, Scalar, Substs, TraitEnvironment, + Ty, TyDefId, TyKind, TypeCtor, }; use rustc_hash::FxHashSet; use stdx::{format_to, impl_from}; @@ -1553,7 +1553,10 @@ impl Type { ) } pub fn is_bool(&self) -> bool { - matches!(self.ty.value, Ty::Apply(ApplicationTy { ctor: TypeCtor::Bool, .. })) + matches!( + self.ty.value, + Ty::Apply(ApplicationTy { ctor: TypeCtor::Scalar(Scalar::Bool), .. }) + ) } pub fn is_mutable_reference(&self) -> bool { -- cgit v1.2.3