We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rustfmt seems to be unable to deal with sub-modules in directories without mod.rs:
foo.rs
foo/mod.rs
foo/bar.rs
I'm getting rustfmt errors for my project:
rustfmt
$ rustup show Default host: x86_64-apple-darwin installed toolchains -------------------- stable-x86_64-apple-darwin (default) nightly-x86_64-apple-darwin active toolchain ---------------- stable-x86_64-apple-darwin (default) rustc 1.34.0 (91856ed52 2019-04-10) $ rustfmt --version rustfmt 1.0.3-stable (d6829d62 2019-02-14) $ cargo run Compiling rustfmttest v0.1.0 (/Users/sethwm/Desktop/rustfmttest) Finished dev [unoptimized + debuginfo] target(s) in 0.36s Running `target/debug/rustfmttest` Hello, world! HELLO WORLD 1 Hello World 2 $ rustfmt src/foo.rs error[E0583]: file not found for module `bar` --> /Users/sethwm/Desktop/rustfmttest/src/foo.rs:1:9 | 1 | pub mod bar; | ^^^ | = help: name the file either bar.rs or bar/mod.rs inside the directory "/Users/sethwm/Desktop/rustfmttest/src"
Here is the source:
$ find . | grep -v git . ./Cargo.lock ./Cargo.toml ./src ./src/foo ./src/foo/bar.rs ./src/foo.rs ./src/main.rs $ cat src/main.rs mod foo; use crate::foo::bar::*; use crate::foo::*; fn main() { println!("Hello, world!"); foo_fn(); bar_fn(); } $ cat src/foo.rs pub mod bar; pub fn foo_fn() { println!("HELLO WORLD 1"); } $ cat src/foo/bar.rs pub fn bar_fn() { println!("Hello World 2"); }
The text was updated successfully, but these errors were encountered:
This is fixed in 1.2.0, but has not reached the stable release yet.
Sorry, something went wrong.
No branches or pull requests
Rustfmt seems to be unable to deal with sub-modules in directories without mod.rs:
foo.rs
orfoo/mod.rs
to support submodules likefoo/bar.rs
rust#45385I'm getting
rustfmt
errors for my project:Here is the source:
The text was updated successfully, but these errors were encountered: