宣布 Rust 1.85.0 和 Rust 2024 | Rust 博客

  • Rust 1.85.0 is announced with the 2024 edition stabilized. It's a programming language for reliable and efficient software.

    • To get 1.85.0 with rustup, use rustup update stable. Or get rustup from the website and check release notes.
    • For testing future releases, update to beta or nightly channels and report bugs.
  • In 1.85.0 stable:

    • Rust 2024 Edition:

      • Language changes like RPIT lifetime capture rules, if let temporary scope, etc.
      • Standard library changes like adding Future to prelude and changing iterator behavior.
      • Cargo changes like the resolver and table key names.
      • Rustdoc changes like combined tests and nested include!.
      • Rustfmt changes like style editions and various formatting fixes.
      • Migration instructions are in the guide. cargo fix can automate some changes.
    • async closures: Support for async || {} returning futures and analogous traits. Examples show differences from regular closures.
    • Hiding trait implementations from diagnostics: Use #[diagnostic::do_not_recommend] attribute.
    • FromIterator and Extend for tuples: Extended to more tuple lengths.
    • Updates to std::env::home_dir(): Deprecated function's behavior updated as a bug fix; subsequent release will remove deprecation.
    • Stabilized APIs: Many APIs are now stable in const contexts.
  • Other changes: Check the release notes for changes in Rust, Cargo, and Clippy.
  • Contributors: Many people contributed to Rust 1.85.0. Thanks!
阅读 7
0 条评论