assert_eq! fails with const { .. } in Rust 2024 · Issue #133081 · rust-lang/rust (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

@traviscross

Description

@traviscross

This code fails to compile in Rust 2024 when it should pass:

//@ edition:2024 fn main() { assert_eq!(0, const { 0 }); //~^ ERROR no rules expected keyword const }

This will be fixed, I expect, by migrating the standard library to Rust 2024, and when doing that, by using the :expr rather than :expr_2021 macro fragment specifier in assert_eq and similar macros.

cc @rust-lang/wg-macros @compiler-errors @ehuss