Skip to content

assert_eq! fails with const { .. } in Rust 2024 #133081

Closed
@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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-edition-2024Area: The 2024 editionA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.I-edition-triagedIssue: This issue has been reviewed and triaged by the Edition team.T-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions