aboutsummaryrefslogtreecommitdiff
path: root/crates/hir
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-02-28 19:56:16 +0000
committerGitHub <[email protected]>2021-02-28 19:56:16 +0000
commit23d7dbfa5e7ba2cebf8c3f79b5d31285d79c1527 (patch)
treec99eee1f422e009f039bc5c1fd68120bc217d417 /crates/hir
parent2fc137b70f9d455676cc99a1a5c7e6e10c3e7cc2 (diff)
parenta3fd2faba5b0736fd51c7b94cae55e0a9609cdb0 (diff)
Merge #7814
7814: Turn Ty::Tuple variant into a tuple-variant r=Veykril a=Veykril bors r+ Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/hir')
-rw-r--r--crates/hir/src/code_model.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs
index cdb54eca2..1c31e29ac 100644
--- a/crates/hir/src/code_model.rs
+++ b/crates/hir/src/code_model.rs
@@ -1547,7 +1547,7 @@ impl Type {
1547 } 1547 }
1548 1548
1549 pub fn is_unit(&self) -> bool { 1549 pub fn is_unit(&self) -> bool {
1550 matches!(self.ty.value, Ty::Tuple { cardinality: 0, .. }) 1550 matches!(self.ty.value, Ty::Tuple(0, ..))
1551 } 1551 }
1552 pub fn is_bool(&self) -> bool { 1552 pub fn is_bool(&self) -> bool {
1553 matches!(self.ty.value, Ty::Scalar(Scalar::Bool)) 1553 matches!(self.ty.value, Ty::Scalar(Scalar::Bool))
@@ -1741,7 +1741,7 @@ impl Type {
1741 } 1741 }
1742 1742
1743 pub fn tuple_fields(&self, _db: &dyn HirDatabase) -> Vec<Type> { 1743 pub fn tuple_fields(&self, _db: &dyn HirDatabase) -> Vec<Type> {
1744 if let Ty::Tuple { substs, .. } = &self.ty.value { 1744 if let Ty::Tuple(_, substs) = &self.ty.value {
1745 substs.iter().map(|ty| self.derived(ty.clone())).collect() 1745 substs.iter().map(|ty| self.derived(ty.clone())).collect()
1746 } else { 1746 } else {
1747 Vec::new() 1747 Vec::new()