Closed
Description
Test program:
fn foo() { println!("foo") }
fn main() {
::foo()
}
This produces the following error messages:
error[E0425]: cannot find function `foo` in the crate root
--> src/main.rs:4:7
|
4 | ::foo()
| ^^^ not found in the crate root
help: possible candidate is found in another module, you can import it into scope
|
1 | use crate::foo;
|
Both the error and the help seem entirely unhelpful. The error suggests that it looked for a function foo
in the crate root, but in fact it looked for a crate foo
. The whole "possible candidate" help seems incorrect, and adding that line would lead to a compilation failure.