rust/tests/ui/macros/std-2024-macros.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
399 B
Rust
Raw Normal View History

// Tests a small handful of macros in the standard library how they handle the
// new behavior introduced in 2024 that allows `const{}` expressions.
2025-02-11 23:20:06 +00:00
//@ check-pass
fn main() {
assert_eq!(0, const { 0 });
assert_eq!(const { 0 }, const { 0 });
assert_eq!(const { 0 }, 0);
let _: Vec<Vec<String>> = vec![const { vec![] }];
let _: Vec<Vec<String>> = vec![const { vec![] }; 10];
}