aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/types.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty/src/types.rs')
-rw-r--r--crates/hir_ty/src/types.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/crates/hir_ty/src/types.rs b/crates/hir_ty/src/types.rs
index eac1b7900..c25bc2d6a 100644
--- a/crates/hir_ty/src/types.rs
+++ b/crates/hir_ty/src/types.rs
@@ -490,14 +490,16 @@ pub struct AliasEq {
490} 490}
491 491
492#[derive(Clone, Debug, PartialEq, Eq)] 492#[derive(Clone, Debug, PartialEq, Eq)]
493pub struct SolutionVariables(pub Canonical<Substitution>); 493pub struct ConstrainedSubst {
494 pub subst: Substitution,
495}
494 496
495#[derive(Clone, Debug, PartialEq, Eq)] 497#[derive(Clone, Debug, PartialEq, Eq)]
496/// A (possible) solution for a proposed goal. 498/// A (possible) solution for a proposed goal.
497pub enum Solution { 499pub enum Solution {
498 /// The goal indeed holds, and there is a unique value for all existential 500 /// The goal indeed holds, and there is a unique value for all existential
499 /// variables. 501 /// variables.
500 Unique(SolutionVariables), 502 Unique(Canonical<ConstrainedSubst>),
501 503
502 /// The goal may be provable in multiple ways, but regardless we may have some guidance 504 /// The goal may be provable in multiple ways, but regardless we may have some guidance
503 /// for type inference. In this case, we don't return any lifetime 505 /// for type inference. In this case, we don't return any lifetime
@@ -513,12 +515,12 @@ pub enum Guidance {
513 /// The existential variables *must* have the given values if the goal is 515 /// The existential variables *must* have the given values if the goal is
514 /// ever to hold, but that alone isn't enough to guarantee the goal will 516 /// ever to hold, but that alone isn't enough to guarantee the goal will
515 /// actually hold. 517 /// actually hold.
516 Definite(SolutionVariables), 518 Definite(Canonical<Substitution>),
517 519
518 /// There are multiple plausible values for the existentials, but the ones 520 /// There are multiple plausible values for the existentials, but the ones
519 /// here are suggested as the preferred choice heuristically. These should 521 /// here are suggested as the preferred choice heuristically. These should
520 /// be used for inference fallback only. 522 /// be used for inference fallback only.
521 Suggested(SolutionVariables), 523 Suggested(Canonical<Substitution>),
522 524
523 /// There's no useful information to feed back to type inference 525 /// There's no useful information to feed back to type inference
524 Unknown, 526 Unknown,