Skip to content

Missing parenthesis for tuple in enum variant #86481

Closed

Description

Given the following code:

fn main() {
    let s = Some("hello", "world");
}

The current output is:

   Compiling playground v0.0.1 (/playground)
error[E0061]: this function takes 1 argument but 2 arguments were supplied
 --> src/main.rs:2:13
  |
2 |     let s = Some("hello", "world");
  |             ^^^^ -------  ------- supplied 2 arguments
  |             |
  |             expected 1 argument

error: aborting due to previous error

For more information about this error, try `rustc --explain E0061`.
error: could not compile `playground`

Ideally the output should should say "struct" rather than function or better, suggest adding the missing ( instead since it is a tuple.

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=418656a98e80500393928f9833e15d3d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.D-papercutDiagnostics: An error or lint that needs small tweaks.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