Closed
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)()
| ++
The fix suggested by the compiler still has the problem, because the parentheses-to-call are added outside of the parentheses in the code.
Ideally the output should look like:
help: use parentheses to call the method
|
5 | (a.unwrap())
| ++
This is similar to the recently fixed #88803, but differs in that the input code cannot be fixed solely by removing parentheses.