Skip to content

funny suggestion with generic macros™ #118335

Closed
@matthiaskrgr

Description

@matthiaskrgr

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

Metadata

Metadata

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyD-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.T-compilerRelevant to the compiler 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