How does Rust's type inference work across multiple statements?

前端 未结 1 1397
你的背包
你的背包 2020-12-06 05:03

Rust performs type inference in fairly advanced situations. Could someone please explain (or point to) the rules that describe what can and cannot be inferred?

The f

相关标签:
1条回答
  • 2020-12-06 05:38

    Rust uses Hindley-Milner type system. It is a set of rules about establishing types of expressions based on their usage.

    Formal description and explanation for it can be found there:

    "What part of Hindley-Milner do you not understand?"

    0 讨论(0)
提交回复
热议问题