IT资讯 Rust 1.72.0 发布,未来支持版本最低为 Windows 10

vegard · 2023-08-28 12:00:11 · 热度: 14

Rust 1.72.0 稳定版已发布。

主要变化:

  • 在错误中报告可能有用的cfg禁用项

现在支持使用 cfg 有条件地启用 Rust 代码,例如仅通过某些 crate 功能或仅在特定平台上提供某些功能。

以前,以这种方式禁用的项目实际上对编译器来说是不可见的。不过现在,编译器会记住这些项目的名称和 cfg 条件,因此它可以报告尝试调用的函数是否不可用。

  Compiling my-project v0.1.0 (/tmp/my-project)
error[E0432]: unresolved import `rustix::io_uring`
   --> src/main.rs:1:5
    |
1   | use rustix::io_uring;
    |     ^^^^^^^^^^^^^^^^ no `io_uring` in the root
    |
note: found an item that was configured out
   --> /home/username/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustix-0.38.8/src/lib.rs:213:9
    |
213 | pub mod io_uring;
    |         ^^^^^^^^
    = note: the item is gated behind the `io_uring` feature

For more information about this error, try `rustc --explain E0432`.
error: could not compile `my-project` (bin "my-project") due to previous error

最后,在未来的版本中,Rust 团队计划将支持的最低 Windows 版本提升至 Windows 10。编译器 MCP 651 中接受的建议是 Rust 1.75 将是最后一个正式支持 Windows 7、8 和 8.1 的版本。

当 Rust 1.76 于 2024 年 2 月发布时,仅支持 Windows 10 及更高版本作为 tire-1 target。此变更将同时适用于主机编译器和编译 target。

详情查看发布公告

为您推荐与 rust 相关的帖子:

暂无回复。
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册