Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call format! through an unambiguous path #226

Merged
merged 1 commit into from Jun 20, 2022
Merged

Call format! through an unambiguous path #226

merged 1 commit into from Jun 20, 2022

Conversation

dtolnay
Copy link
Owner

@dtolnay dtolnay commented Jun 20, 2022

Repro:

use quote::format_ident;

macro_rules! format {
    () => {};
}

fn main() {
    let _ = format_ident!("foo");
}

Previously:

error: no rules expected the token `"foo"`
 --> src/main.rs:8:13
  |
3 | macro_rules! format {
  | ------------------- when calling this macro
...
8 |     let _ = format_ident!("foo");
  |             ^^^^^^^^^^^^^^^^^^^^ no rules expected this token in macro call
  |
  = note: this error originates in the macro `format_ident` (in Nightly builds, run with -Z macro-backtrace for more info)

Repro:

    use quote::format_ident;

    macro_rules! format {
        () => {};
    }

    fn main() {
        let _ = format_ident!("foo");
    }

Previously:

    error: no rules expected the token `"foo"`
     --> src/main.rs:8:13
      |
    3 | macro_rules! format {
      | ------------------- when calling this macro
    ...
    8 |     let _ = format_ident!("foo");
      |             ^^^^^^^^^^^^^^^^^^^^ no rules expected this token in macro call
      |
      = note: this error originates in the macro `format_ident` (in Nightly builds, run with -Z macro-backtrace for more info)
@dtolnay dtolnay merged commit 7286307 into master Jun 20, 2022
@dtolnay dtolnay deleted the format branch June 20, 2022 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant