Skip to content

Inconsistent macro repeat operator leads to panic on nightly #61033

Closed
@birkenfeld

Description

@birkenfeld

Given this test file:

macro_rules! test {
    ($x:ident, $($tt:tt)*) => { $($tt)+ }
}

fn main() {
    test!(x,)
}

stable Rust errors like this:

error: this must repeat at least once
 --> x.rs:2:34
  |
2 |     ($x:ident, $($tt:tt)*) => { $($tt)+ }
  |                                  ^^^^^

error: aborting due to previous error

while on 1.36.0-nightly (50a0def 2019-05-21) running on x86_64-unknown-linux-gnu:

error: internal compiler error: this must repeat at least once
 --> x.rs:2:34
  |
2 |     ($x:ident, $($tt:tt)*) => { $($tt)+ }
  |                                  ^^^^^

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:572:9
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: aborting due to previous error

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions