Nit: E0599 help suggests removing arguments instead of argument list #129133
Open
Description
opened on Aug 15, 2024
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