Rust 1.69


The Rust team is pleased to announce the release of a new version of the Rust language, 1.69.0. Rust is a programming language that allows everyone to create reliable and efficient software.

Cargo now offers automatic fixes for some warnings.

Rust 1.69.0 added command cargo fixto automatically fix some simple compiler warnings. In addition, support has been added to automatically fix some simple Clippy warnings. To draw more attention to these opportunities, Cargo will now offer to launch cargo fix or cargo clippy --fix when auto-correcting warnings are found:

warning: unused import: `std::hash::Hash`
 --> src/main.rs:1:5
  |
1 | use std::hash::Hash;
  |     ^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default
  
  warning: `foo` (bin "foo") generated 1 warning (run `cargo fix --bin "foo"` to apply 1 suggestion)

Note that the full Cargo call shown above is only necessary if you want to accurately apply fixes to a single crate. If you want to apply patches to all crates from the default workspace, then simply use the command cargo fix (no additional arguments).

Debug information is no longer included in build scripts by default.

To improve compilation speed, Cargo no longer displays debug information in build scripts by default. This will not have a noticeable effect if the build scripts run successfully, but the stack traces in the build scripts will contain less information.

If you want to debug a build script, you can add an options snippet to your Cargo.tomlto print debug information again:

[profile.dev.build-override]
debug = true
[profile.release.build-override]
debug = true

API converted to stable:

API data can now be used in static contexts. The given constant “const”, which determines whether the API data can be used instead of constants in any context. This “const” attribute is applied to functions.

  • SocketAddr::new

  • SocketAddr::ip

  • SocketAddr::port

  • SocketAddr::is_ipv4

  • SocketAddr::is_ipv6

  • SocketAddrV4::new

  • SocketAddrV4::ip

  • SocketAddrV4::port

  • SocketAddrV6::new

  • SocketAddrV6::ip

  • SocketAddrV6::port

  • SocketAddrV6::flowinfo

  • SocketAddrV6::scope_id

All other changes can be found here: Rust, Cargo, clippy.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *