diff options
Diffstat (limited to 'crates/hir_ty/src/lib.rs')
-rw-r--r-- | crates/hir_ty/src/lib.rs | 11 |
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 | ||
577 | impl WhereClause { | 574 | impl 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 | } |