mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 11:07:42 +00:00
Merge #8221
8221: Prefer adding `mod` declaration to lib.rs over file.rs in UnlinkedFile fix r=Veykril a=Veykril When there is a `lib.rs` and `main.rs` in one crate, one usually wants the `lib.rs` file to declare the modules. bors r+ Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
commit
ce6bb5ccca
@ -63,7 +63,7 @@ impl DiagnosticWithFix for UnlinkedFile {
|
|||||||
// - `$dir.rs` in the parent folder, where `$dir` is the directory containing `self.file_id`
|
// - `$dir.rs` in the parent folder, where `$dir` is the directory containing `self.file_id`
|
||||||
let parent = our_path.parent()?;
|
let parent = our_path.parent()?;
|
||||||
let mut paths =
|
let mut paths =
|
||||||
vec![parent.join("mod.rs")?, parent.join("main.rs")?, parent.join("lib.rs")?];
|
vec![parent.join("mod.rs")?, parent.join("lib.rs")?, parent.join("main.rs")?];
|
||||||
|
|
||||||
// `submod/bla.rs` -> `submod.rs`
|
// `submod/bla.rs` -> `submod.rs`
|
||||||
if let Some(newmod) = (|| {
|
if let Some(newmod) = (|| {
|
||||||
|
Loading…
Reference in New Issue
Block a user