Closed
Description
Taking a real-life example from #rust today:
fn main() {
let mut guess = String::new();
std::io::stdin.read_line(&mut guess);
}
Yields the following error message:
<anon>:3:20: 3:41 error: no method named `read_line` found for type `fn() -> std::io::stdio::Stdin {std::io::stdio::stdin}` in the current scope
<anon>:3 std::io::stdin.read_line(&mut guess);
^~~~~~~~~~~~~~~~~~~~~
The problem is that the code should read stdin().read_line
rather than stdin.read_line
, but the error message only hints at that. How hard would it be to add a note to all "no method found" errors when the type is callable?