Cargo run error message

As follows:

Compiling hello v0.1.0 (file:///home/rust/hello)                                   
error[E0658]: mod statements in files are unstable (see issue #44660)
 --> src/
1 | pub mod instrument;
  |         ^^^^^^^^^^
  = help: on stable builds, rename this file to sound/

error: aborting due to previous error

For more information about this error, try `rustc --explain E0658`.
error: Could not compile `hello`.

To learn more, run the command again with --verbose.
I am writing the code according to Separating Modules into Different Files in the official tutorial of the rust compiler language. Why is it wrong?

Are you using the 2018 edition? You can check by looking in your Cargo.toml file and seeing if you have a line edition = "2018". What does your file-system look like?

hi, welcome on the rust user forum!

I have never seen that error message before. Could you show a ls of you project and of the src folder, plus the content of your Cargo.toml?

Do you have the latest version of Rust?

This looks like a message from transitional period before the new modules were made available in December.

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