Cargo run finding main.rs in sub dir

rustc 1.36.0 (a53f9df32 2019-07-03)

Hello, I'm basically new to programming and Rust. While studying Vectors in Rust Standard Library Cookbook:

cd ~/projects/
cargo new --bin vectors ~/projects/
cd ~/projects/vectors/
cargo new --bin playground

Then copy the original lesson code into vectors/src/main.rs.

Then as a memory recall exercise write out the original code into vectors/playground/src/main.rs

Using vim; from playground/src/main.rs do :!cargo run, but the Rust compiler finds both main.rs files and prints their results to stdout.

Is this normal, or an anomaly?

After updating my system, rebooting and returning to the lesson Cargo run no longer finds the like named main.rs in the sub dir which is expected.

Prior to the updated and reboot I had closed out all vim sessions and reopened those files and the behavior persisted.

I have no idea how to reproduce the anomaly.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.