]> git.proxmox.com Git - rustc.git/blob - src/doc/reference/src/types/inferred.md
New upstream version 1.41.1+dfsg1
[rustc.git] / src / doc / reference / src / types / inferred.md
1 # Inferred type
2
3 > **<sup>Syntax</sup>**\
4 > _InferredType_ : `_`
5
6 The inferred type asks the compiler to infer the type if possible based on the
7 surrounding information available. It cannot be used in item signatures. It is
8 often used in generic arguments:
9
10 ```rust
11 let x: Vec<_> = (0..10).collect();
12 ```
13
14 <!--
15 What else should be said here?
16 The only documentation I am aware of is https://rust-lang.github.io/rustc-guide/type-inference.html
17 There should be a broader discussion of type inference somewhere.
18 -->