aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/lib.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-03-20 10:23:55 +0000
committerGitHub <[email protected]>2021-03-20 10:23:55 +0000
commit5ac0290f533eed295c6e92564d7530d41cf45d6e (patch)
treeebdcea14c479ddfca358bbeabdde1da8f45b2423 /crates/hir_ty/src/lib.rs
parent3901c3b566a6834c64e029bd6f4fdaaf8b26f809 (diff)
parent8e7e405f6ab0c1ee10bfdd3d55a97628fe4cd6dd (diff)
Merge #8116
8116: Remove WhereClause::Error r=flodiebold a=flodiebold Chalk doesn't have it, and judging from the removed code, it wasn't useful anyway. Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/hir_ty/src/lib.rs')
-rw-r--r--crates/hir_ty/src/lib.rs11
1 files changed, 1 insertions, 10 deletions
diff --git a/crates/hir_ty/src/lib.rs b/crates/hir_ty/src/lib.rs
index 5c4d5a7d7..8de2d422f 100644
--- a/crates/hir_ty/src/lib.rs
+++ b/crates/hir_ty/src/lib.rs
@@ -569,16 +569,9 @@ pub enum WhereClause {
569 Implemented(TraitRef), 569 Implemented(TraitRef),
570 /// An associated type bindings like in `Iterator<Item = T>`. 570 /// An associated type bindings like in `Iterator<Item = T>`.
571 AliasEq(AliasEq), 571 AliasEq(AliasEq),
572 /// We couldn't resolve the trait reference. (If some type parameters can't
573 /// be resolved, they will just be Unknown).
574 Error,
575} 572}
576 573
577impl WhereClause { 574impl WhereClause {
578 pub fn is_error(&self) -> bool {
579 matches!(self, WhereClause::Error)
580 }
581
582 pub fn is_implemented(&self) -> bool { 575 pub fn is_implemented(&self) -> bool {
583 matches!(self, WhereClause::Implemented(_)) 576 matches!(self, WhereClause::Implemented(_))
584 } 577 }
@@ -589,7 +582,7 @@ impl WhereClause {
589 WhereClause::AliasEq(AliasEq { alias: AliasTy::Projection(proj), .. }) => { 582 WhereClause::AliasEq(AliasEq { alias: AliasTy::Projection(proj), .. }) => {
590 Some(proj.trait_ref(db)) 583 Some(proj.trait_ref(db))
591 } 584 }
592 WhereClause::AliasEq(_) | WhereClause::Error => None, 585 WhereClause::AliasEq(_) => None,
593 } 586 }
594 } 587 }
595} 588}
@@ -599,7 +592,6 @@ impl TypeWalk for WhereClause {
599 match self { 592 match self {
600 WhereClause::Implemented(trait_ref) => trait_ref.walk(f), 593 WhereClause::Implemented(trait_ref) => trait_ref.walk(f),
601 WhereClause::AliasEq(alias_eq) => alias_eq.walk(f), 594 WhereClause::AliasEq(alias_eq) => alias_eq.walk(f),
602 WhereClause::Error => {}
603 } 595 }
604 } 596 }
605 597
@@ -611,7 +603,6 @@ impl TypeWalk for WhereClause {
611 match self { 603 match self {
612 WhereClause::Implemented(trait_ref) => trait_ref.walk_mut_binders(f, binders), 604 WhereClause::Implemented(trait_ref) => trait_ref.walk_mut_binders(f, binders),
613 WhereClause::AliasEq(alias_eq) => alias_eq.walk_mut_binders(f, binders), 605 WhereClause::AliasEq(alias_eq) => alias_eq.walk_mut_binders(f, binders),
614 WhereClause::Error => {}
615 } 606 }
616 } 607 }
617} 608}