aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty/src')
-rw-r--r--crates/hir_ty/src/display.rs18
-rw-r--r--crates/hir_ty/src/infer/unify.rs1
-rw-r--r--crates/hir_ty/src/traits.rs1
-rw-r--r--crates/hir_ty/src/walk.rs2
4 files changed, 20 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
diff --git a/crates/hir_ty/src/infer/unify.rs b/crates/hir_ty/src/infer/unify.rs
index ffa324b6d..648af4ebf 100644
--- a/crates/hir_ty/src/infer/unify.rs
+++ b/crates/hir_ty/src/infer/unify.rs
@@ -116,6 +116,7 @@ impl<'a, 'b> Canonicalizer<'a, 'b> {
116 DomainGoal::Holds(wc) => { 116 DomainGoal::Holds(wc) => {
117 DomainGoal::Holds(self.do_canonicalize(wc, DebruijnIndex::INNERMOST)) 117 DomainGoal::Holds(self.do_canonicalize(wc, DebruijnIndex::INNERMOST))
118 } 118 }
119 _ => unimplemented!(),
119 }; 120 };
120 self.into_canonicalized(InEnvironment { goal: result, environment: obligation.environment }) 121 self.into_canonicalized(InEnvironment { goal: result, environment: obligation.environment })
121 } 122 }
diff --git a/crates/hir_ty/src/traits.rs b/crates/hir_ty/src/traits.rs
index cc1d2ca18..de1d37e17 100644
--- a/crates/hir_ty/src/traits.rs
+++ b/crates/hir_ty/src/traits.rs
@@ -81,6 +81,7 @@ pub(crate) fn trait_solve_query(
81 db.trait_data(it.hir_trait_id()).name.to_string() 81 db.trait_data(it.hir_trait_id()).name.to_string()
82 } 82 }
83 DomainGoal::Holds(WhereClause::AliasEq(_)) => "alias_eq".to_string(), 83 DomainGoal::Holds(WhereClause::AliasEq(_)) => "alias_eq".to_string(),
84 _ => "??".to_string(),
84 }); 85 });
85 log::info!("trait_solve_query({})", goal.value.goal.display(db)); 86 log::info!("trait_solve_query({})", goal.value.goal.display(db));
86 87
diff --git a/crates/hir_ty/src/walk.rs b/crates/hir_ty/src/walk.rs
index 28875dbe0..57343fd61 100644
--- a/crates/hir_ty/src/walk.rs
+++ b/crates/hir_ty/src/walk.rs
@@ -93,6 +93,7 @@ impl TypeWalk for GenericArg {
93 GenericArgData::Ty(ty) => { 93 GenericArgData::Ty(ty) => {
94 ty.walk(f); 94 ty.walk(f);
95 } 95 }
96 _ => {}
96 } 97 }
97 } 98 }
98} 99}
@@ -122,6 +123,7 @@ impl TypeWalk for WhereClause {
122 match self { 123 match self {
123 WhereClause::Implemented(trait_ref) => trait_ref.walk(f), 124 WhereClause::Implemented(trait_ref) => trait_ref.walk(f),
124 WhereClause::AliasEq(alias_eq) => alias_eq.walk(f), 125 WhereClause::AliasEq(alias_eq) => alias_eq.walk(f),
126 _ => {}
125 } 127 }
126 } 128 }
127} 129}