Skip to content

Files

Latest commit

5a14e3e · Jan 8, 2025

History

History
25 lines (19 loc) · 610 Bytes

inferred.md

File metadata and controls

25 lines (19 loc) · 610 Bytes

r[type.inferred]

Inferred type

r[type.inferred.syntax]

Syntax
InferredType : _

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

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

It is often used in generic arguments:

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