diff options
author | Lukas Wirth <[email protected]> | 2021-02-28 00:20:04 +0000 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2021-02-28 00:20:04 +0000 |
commit | 5183c9f08345c664237ae138e86f96ff46714f15 (patch) | |
tree | a0e660cb49fd67951ee2209d9fc75a2108243df7 /crates/hir/src | |
parent | 2a4076c14d0e3f7ae03908c2b9cd1a52851d401c (diff) |
Introduce TypeCtor::Scalar
Diffstat (limited to 'crates/hir/src')
-rw-r--r-- | crates/hir/src/code_model.rs | 9 |
1 files changed, 6 insertions, 3 deletions
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::{ | |||
32 | method_resolution, | 32 | method_resolution, |
33 | traits::{FnTrait, Solution, SolutionVariables}, | 33 | traits::{FnTrait, Solution, SolutionVariables}, |
34 | ApplicationTy, BoundVar, CallableDefId, Canonical, DebruijnIndex, FnSig, GenericPredicate, | 34 | ApplicationTy, BoundVar, CallableDefId, Canonical, DebruijnIndex, FnSig, GenericPredicate, |
35 | InEnvironment, Obligation, ProjectionPredicate, ProjectionTy, Substs, TraitEnvironment, Ty, | 35 | InEnvironment, Obligation, ProjectionPredicate, ProjectionTy, Scalar, Substs, TraitEnvironment, |
36 | TyDefId, TyKind, TypeCtor, | 36 | Ty, TyDefId, TyKind, TypeCtor, |
37 | }; | 37 | }; |
38 | use rustc_hash::FxHashSet; | 38 | use rustc_hash::FxHashSet; |
39 | use stdx::{format_to, impl_from}; | 39 | use stdx::{format_to, impl_from}; |
@@ -1553,7 +1553,10 @@ impl Type { | |||
1553 | ) | 1553 | ) |
1554 | } | 1554 | } |
1555 | pub fn is_bool(&self) -> bool { | 1555 | pub fn is_bool(&self) -> bool { |
1556 | matches!(self.ty.value, Ty::Apply(ApplicationTy { ctor: TypeCtor::Bool, .. })) | 1556 | matches!( |
1557 | self.ty.value, | ||
1558 | Ty::Apply(ApplicationTy { ctor: TypeCtor::Scalar(Scalar::Bool), .. }) | ||
1559 | ) | ||
1557 | } | 1560 | } |
1558 | 1561 | ||
1559 | pub fn is_mutable_reference(&self) -> bool { | 1562 | pub fn is_mutable_reference(&self) -> bool { |