Skip to content

funny suggestion with generic macros™ #118335

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

Closed
matthiaskrgr opened this issue Nov 26, 2023 · 0 comments · Fixed by #118342
Closed

funny suggestion with generic macros™ #118335

matthiaskrgr opened this issue Nov 26, 2023 · 0 comments · Fixed by #118342
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-resolve Area: Name/path resolution done by `rustc_resolve` specifically D-invalid-suggestion Diagnostics: A structured suggestion resulting in incorrect code. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

Code

pub fn main() {
    let zero = assert_eq::<()>();
}

Current output

error[E0423]: expected function, found macro `assert_eq`
 --> src/main.rs:2:16
  |
2 |     let zero = assert_eq::<()>();
  |                ^^^^^^^^^^^^^^^ not a function
  |
help: use `!` to invoke the macro
  |
2 |     let zero = assert_eq::<()>!();
  |                               +

For more information about this error, try `rustc --explain E0423`.
error: could not compile `playground` (bin "playground") due to previous error

Desired output

No response

Rationale and extra context

No response

Other cases

No response

Anything else?

No response

@matthiaskrgr matthiaskrgr 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 Nov 26, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 26, 2023
@fmease fmease added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. A-resolve Area: Name/path resolution done by `rustc_resolve` specifically D-invalid-suggestion Diagnostics: A structured suggestion resulting in incorrect code. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. labels Nov 26, 2023
@compiler-errors compiler-errors self-assigned this Nov 26, 2023
@bors bors closed this as completed in 5e7f770 Nov 29, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Nov 29, 2023
Rollup merge of rust-lang#118342 - compiler-errors:macro-generic-bang, r=estebank

Dont suggest `!` for path in function call if it has generic args

Fixes rust-lang#118335
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 A-resolve Area: Name/path resolution done by `rustc_resolve` specifically D-invalid-suggestion Diagnostics: A structured suggestion resulting in incorrect code. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants