推断类型

语法
推断类型 : _

推断类型要求编译器在可能的情况下根据周围可用信息来推断类型。

它不能用于项签名中。

它常用于泛型参数中

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