pub fn all_false() -> [bool; LEN] {
[false; _]
}
Similar to the rules for when _
is permitted as a type, _
is not permitted as an argument to const generics when in a signature, the team wrote:
// This is not allowed
pub const fn all_false() -> [bool; _] {
[false; LEN]
}
// Neither is this
pub const ALL_FALSE: [bool; _] = all_false::();
Also in Rust 1.89, doctests now will be tested when running cargo test --doc --target other_target
. This may result in some amount of breakage due to “would-be-failing” doctests now being tested. Failing tests can be disabled by annotating the doctest with ignore-
. The team provided this example:
/// ```ignore-x86_64
/// panic!("something")
/// ```
pub fn my_function() { }
Rust 1.89 follows the June 26 release of Rust 1.88, which featured support for naked functions. Additional features in Rust 1.89 include: