-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Given the following code:
fn main() {
let a = Some(42);
println!(
"The value is {}.",
(a.unwrap)()
);
}
The current output is:
error[E0615]: attempted to take value of method `unwrap` on type `Option<{integer}>`
--> src/main.rs:5:12
|
5 | (a.unwrap)()
| ^^^^^^ method, not a field
|
help: use parentheses to call the method
|
5 | (a.unwrap)()()
| ++
Ideally the output should look like:
help: remove these parentheses
(a.unwrap)()
^^^^^^^^^^
But at least adding parentheses right next to the method name would be an improvement:
help: use parentheses to call the method
|
5 | (a.unwrap())()
| ++
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.