Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 655 Bytes

File metadata and controls

26 lines (21 loc) · 655 Bytes

r[type.inferred]

Inferred type

r[type.inferred.syntax]

InferredType -> `_`

r[type.inferred.intro] The inferred type asks the compiler to infer the type if possible based on the surrounding information available.

[!EXAMPLE] The inferred type is often used in generic arguments:

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

r[type.inferred.constraint] The inferred type cannot be used in item signatures.