Rust 1.67 发布
Rust 团队于近日发布了 Rust 1.67.0 新版本,1.67.0 稳定版中的主要更新内容如下: #[must_use] 对 async fn 有效 带有 #[must_use] 注释的 async 函数现在将该属性应用于返回的 impl Future 的输出。Future 特性本身已经带有 #[must_use] 注释,所以所有实现 Future 的类型都自动 #[must_use]。 在 1.67 版本中,如果输出没有以某种方式使用,编译器现在会发出警告。 #[must_use] async fn bar() -> u32 { 0 } async fn caller() { bar().await; } warning: unused output of future returned by `bar` that must be used --> src/lib.rs:5:5 | 5 | bar().await; | ^^^^^^^^^^^ | = note: `#[warn(unused_must_use)]` on by ...