aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/infer.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-04-06 20:11:41 +0100
committerGitHub <[email protected]>2021-04-06 20:11:41 +0100
commit1643d1534b92eef1cf55631aba3ca9289c3cea72 (patch)
tree8db339ad4a14cde9a63235d7616f648d4e560e56 /crates/hir_ty/src/infer.rs
parent5df65e5066a534cfb1e0d5ff494b1cd775d5dd90 (diff)
parent768ee3e47a140e354575154f431421375b0b5203 (diff)
Merge #8385
8385: Align `InferenceVar` to Chalk r=flodiebold a=flodiebold Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/hir_ty/src/infer.rs')
-rw-r--r--crates/hir_ty/src/infer.rs19
1 files changed, 0 insertions, 19 deletions
diff --git a/crates/hir_ty/src/infer.rs b/crates/hir_ty/src/infer.rs
index efe9198cc..75d633c96 100644
--- a/crates/hir_ty/src/infer.rs
+++ b/crates/hir_ty/src/infer.rs
@@ -683,25 +683,6 @@ impl<'a> InferenceContext<'a> {
683 } 683 }
684} 684}
685 685
686/// The kinds of placeholders we need during type inference. There's separate
687/// values for general types, and for integer and float variables. The latter
688/// two are used for inference of literal values (e.g. `100` could be one of
689/// several integer types).
690#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
691pub struct InferenceVar {
692 index: u32,
693}
694
695impl InferenceVar {
696 fn to_inner(self) -> unify::TypeVarId {
697 unify::TypeVarId(self.index)
698 }
699
700 fn from_inner(unify::TypeVarId(index): unify::TypeVarId) -> Self {
701 InferenceVar { index }
702 }
703}
704
705/// When inferring an expression, we propagate downward whatever type hint we 686/// When inferring an expression, we propagate downward whatever type hint we
706/// are able in the form of an `Expectation`. 687/// are able in the form of an `Expectation`.
707#[derive(Clone, PartialEq, Eq, Debug)] 688#[derive(Clone, PartialEq, Eq, Debug)]