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

Weird error messages when I miss to define macro name. #127612

Closed
fortune0502 opened this issue Jul 11, 2024 · 2 comments
Closed

Weird error messages when I miss to define macro name. #127612

fortune0502 opened this issue Jul 11, 2024 · 2 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@fortune0502
Copy link

Code

macro_rules! {
    () => {};
}

Current output

error: cannot find macro `macro_rules` in this scope
 --> src/lib.rs:1:1
  |
1 | macro_rules! {
  | ^^^^^^^^^^^
  |

Desired output

error: missing name for `macro_rules!`
 --> src/lib.rs:1:1
  |
1 | macro_rules! {
  | ^^^^^^^^^^^
  |

Rationale and extra context

I am wondering if I should import something to use macro_rules! inside lib.rs.
The error output shows that rust compiler doesn't recognize macro_rules! macro so it should be imported from anywhere else.

Other cases

No response

Rust Version

rustc 1.79.0 (129f3b996 2024-06-10)
binary: rustc
commit-hash: 129f3b9964af4d4a709d1383930ade12dfe7c081
commit-date: 2024-06-10
host: x86_64-pc-windows-msvc
release: 1.79.0
LLVM version: 18.1.7

Anything else?

No response

@fortune0502 fortune0502 added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 11, 2024
@veera-sivarajan
Copy link
Contributor

Fixed in #118317 and #127557

@fmease
Copy link
Member

fmease commented Jul 11, 2024

Duplicate of #126694

@fmease fmease marked this as a duplicate of #126694 Jul 11, 2024
@fmease fmease closed this as not planned Won't fix, can't repro, duplicate, stale Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants