diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-02-28 13:36:44 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-02-28 13:36:44 +0000 |
commit | 803ff2e55eeb6bd1d9028fbbffe34721f0e6d459 (patch) | |
tree | c0df3cba7d22fe49e1ea33dde6ed8d4c9e0f663f /crates/hir/src | |
parent | 7f57a01b3d524a5ed85a30265b8aee2c81118f15 (diff) | |
parent | 7c2dd85a32e320fd412a720ea5b847c66bf246ae (diff) |
Merge #7804
7804: Introduce TypeCtor::Scalar r=lnicola a=Veykril
`TypeCtor::Int(..) | TypeCtor::Float(..) | TypeCtor::Char | TypeCtor::Bool` => `TypeCtor::Scalar(..)`, in this case we can actually just straight up use `chalk_ir::Scalar` already since its just a POD without any IDs or anything.
Co-authored-by: Lukas Wirth <[email protected]>
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 { |