diff options
author | Florian Diebold <[email protected]> | 2021-04-08 12:51:04 +0100 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2021-04-08 13:23:17 +0100 |
commit | a838a60caaa5351d7543bcbebb1aa976b0b73f39 (patch) | |
tree | e17994fe7a56f78c4770f227d75e9913ea4766db /crates/hir_ty/src/display.rs | |
parent | f43edb2151408d0127201312ade7fef9d9328222 (diff) |
Fix missing match arms
Diffstat (limited to 'crates/hir_ty/src/display.rs')
-rw-r--r-- | crates/hir_ty/src/display.rs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/crates/hir_ty/src/display.rs b/crates/hir_ty/src/display.rs index e0ca96c6d..d7a3977e5 100644 --- a/crates/hir_ty/src/display.rs +++ b/crates/hir_ty/src/display.rs | |||
@@ -287,6 +287,8 @@ impl HirDisplay for GenericArg { | |||
287 | fn hir_fmt(&self, f: &mut HirFormatter) -> Result<(), HirDisplayError> { | 287 | fn hir_fmt(&self, f: &mut HirFormatter) -> Result<(), HirDisplayError> { |
288 | match self.interned() { | 288 | match self.interned() { |
289 | crate::GenericArgData::Ty(ty) => ty.hir_fmt(f), | 289 | crate::GenericArgData::Ty(ty) => ty.hir_fmt(f), |
290 | crate::GenericArgData::Lifetime(lt) => lt.hir_fmt(f), | ||
291 | crate::GenericArgData::Const(c) => c.hir_fmt(f), | ||
290 | } | 292 | } |
291 | } | 293 | } |
292 | } | 294 | } |
@@ -664,6 +666,8 @@ impl HirDisplay for Ty { | |||
664 | write!(f, "{{unknown}}")?; | 666 | write!(f, "{{unknown}}")?; |
665 | } | 667 | } |
666 | TyKind::InferenceVar(..) => write!(f, "_")?, | 668 | TyKind::InferenceVar(..) => write!(f, "_")?, |
669 | TyKind::Generator(..) => write!(f, "{{generator}}")?, | ||
670 | TyKind::GeneratorWitness(..) => write!(f, "{{generator witness}}")?, | ||
667 | } | 671 | } |
668 | Ok(()) | 672 | Ok(()) |
669 | } | 673 | } |
@@ -741,7 +745,7 @@ fn write_bounds_like_dyn_trait( | |||
741 | if !first { | 745 | if !first { |
742 | write!(f, " + ")?; | 746 | write!(f, " + ")?; |
743 | } | 747 | } |
744 | // We assume that the self type is $0 (i.e. the | 748 | // We assume that the self type is ^0.0 (i.e. the |
745 | // existential) here, which is the only thing that's | 749 | // existential) here, which is the only thing that's |
746 | // possible in actual Rust, and hence don't print it | 750 | // possible in actual Rust, and hence don't print it |
747 | write!(f, "{}", f.db.trait_data(trait_).name)?; | 751 | write!(f, "{}", f.db.trait_data(trait_).name)?; |
@@ -783,6 +787,10 @@ fn write_bounds_like_dyn_trait( | |||
783 | } | 787 | } |
784 | ty.hir_fmt(f)?; | 788 | ty.hir_fmt(f)?; |
785 | } | 789 | } |
790 | |||
791 | // FIXME implement these | ||
792 | WhereClause::LifetimeOutlives(_) => {} | ||
793 | WhereClause::TypeOutlives(_) => {} | ||
786 | } | 794 | } |
787 | first = false; | 795 | first = false; |
788 | } | 796 | } |
@@ -837,6 +845,10 @@ impl HirDisplay for WhereClause { | |||
837 | ty.hir_fmt(f)?; | 845 | ty.hir_fmt(f)?; |
838 | } | 846 | } |
839 | WhereClause::AliasEq(_) => write!(f, "{{error}}")?, | 847 | WhereClause::AliasEq(_) => write!(f, "{{error}}")?, |
848 | |||
849 | // FIXME implement these | ||
850 | WhereClause::TypeOutlives(..) => {} | ||
851 | WhereClause::LifetimeOutlives(..) => {} | ||
840 | } | 852 | } |
841 | Ok(()) | 853 | Ok(()) |
842 | } | 854 | } |
@@ -881,9 +893,11 @@ impl HirDisplay for DomainGoal { | |||
881 | DomainGoal::Holds(wc) => { | 893 | DomainGoal::Holds(wc) => { |
882 | write!(f, "Holds(")?; | 894 | write!(f, "Holds(")?; |
883 | wc.hir_fmt(f)?; | 895 | wc.hir_fmt(f)?; |
884 | write!(f, ")") | 896 | write!(f, ")")?; |
885 | } | 897 | } |
898 | _ => write!(f, "?")?, | ||
886 | } | 899 | } |
900 | Ok(()) | ||
887 | } | 901 | } |
888 | } | 902 | } |
889 | 903 | ||