内联 const 表达式

版本新特性 / Rust 1.79

// *** before: ***
// compile time arithmetic needed a named constant of its own
const BUF: usize = 16 * 4;
let buffer = [0u8; BUF];

// *** in version 1.79: ***
let buffer = [0u8; const { 16 * 4 }];

// in patterns as well
match len {
    const { usize::MAX } => println!("the limit"),
    _ => println!("an ordinary length"),
}