Skip to content

Nit: E0599 help suggests removing arguments instead of argument list #129133

Open
@lolbinarycat

Description

Code

#[allow(dead_code)]
fn main() {
    struct X {
        y: bool,
    }
    let y = true;
    let _ = X{ y }.y();
}

Current output

Compiling playground v0.0.1 (/playground)
error[E0599]: no method named `y` found for struct `X` in the current scope
 --> src/main.rs:7:20
  |
3 |     struct X {
  |     -------- method `y` not found for this struct
...
7 |     let _ = X{ y }.y();
  |                    ^-- help: remove the arguments
  |                    |
  |                    field, not a method

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

Desired output

Compiling playground v0.0.1 (/playground)
error[E0599]: no method named `y` found for struct `X` in the current scope
 --> src/main.rs:7:20
  |
3 |     struct X {
  |     -------- method `y` not found for this struct
...
7 |     let _ = X{ y }.y();
  |                    ^-- help: remove the argument list
  |                    |
  |                    field, not a method

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

Rationale and extra context

the arguments are the individual elements of the arguments list, this is technically incorrect.

Other cases

No response

Rust Version

1.80.1

Anything else?

No response

Activity

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

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsT-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