W3cubDocs

/Rust

Inferred type

Syntax
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:

# #![allow(unused_variables)]
#fn main() {
let x: Vec<_> = (0..10).collect();
#}

© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/reference/types/inferred.html