summaryrefslogtreecommitdiffstats
path: root/src/doc/reference/src/types/inferred.md
blob: c33ebd91c15f8192360c151be80983e22f80e41e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Inferred type

> **<sup>Syntax</sup>**\
> _InferredType_ : `_`

The inferred type asks the compiler to infer the type if possible based on the
surrounding information available. It cannot be used in item signatures. It is
often used in generic arguments:

```rust
let x: Vec<_> = (0..10).collect();
```

<!--
  What else should be said here?
  The only documentation I am aware of is https://rustc-dev-guide.rust-lang.org/type-inference.html
  There should be a broader discussion of type inference somewhere.
-->