HomeCloud ComputingRust 1.89 underscores arguments to const generics

Rust 1.89 underscores arguments to const generics




pub fn all_false() -> [bool; LEN] {
  [false; _]
}

Just like the principles for when _ is permitted as a kind, _ will not be permitted as an argument to const generics when in a signature, the workforce wrote:


// This isn't allowed
pub const fn all_false() -> [bool; _] {
  [false; LEN]
}

// Neither is that this
pub const ALL_FALSE: [bool; _] = all_false::();

Additionally in Rust 1.89,  doctests now might be examined when working cargo take a look at --doc --target other_target. This may occasionally end in some quantity of breakage because of “would-be-failing” doctests now being examined. Failing assessments could be disabled by annotating the doctest with ignore-. The workforce offered this instance:


/// ```ignore-x86_64
/// panic!("one thing")
/// ```
pub fn my_function() { }

Rust 1.89 follows the June 26 launch of Rust 1.88, which featured help for bare features. Extra options in Rust 1.89 embrace:

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments