I can reference std::f64::NEG_INFINITY in my main.rs and there is no problem. However, if another module references the same constant, the compiler complains: Use of undeclared type or module 'std::f64'.
Here is my main.rs:
mod bar;
fn main() {
println!("{}", std::f64::NEG_INFINITY);
}
Here is my bar.rs:
fn foo() {
println!("{}", std::f64::NEG_INFINITY);
}
main.rs and bar.rs are in the same folder.
What am I doing wrong?