aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-03-27 22:43:34 +0000
committerGitHub <[email protected]>2021-03-27 22:43:34 +0000
commitce6bb5ccca48b177f6cd12b42b4c52f3e1b44e0c (patch)
treec247f9c8f8b91d4fa701213e597297dcde5b708f
parent84f1660a37fa28c4ca4e7e75db5715b12904061a (diff)
parentc9e479870ba34a04ed91fb8055721b4c3d00a26c (diff)
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 <[email protected]>
-rw-r--r--crates/ide/src/diagnostics/unlinked_file.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ide/src/diagnostics/unlinked_file.rs b/crates/ide/src/diagnostics/unlinked_file.rs
index 019b0b440..e174fb767 100644
--- a/crates/ide/src/diagnostics/unlinked_file.rs
+++ b/crates/ide/src/diagnostics/unlinked_file.rs
@@ -63,7 +63,7 @@ impl DiagnosticWithFix for UnlinkedFile {
63 // - `$dir.rs` in the parent folder, where `$dir` is the directory containing `self.file_id` 63 // - `$dir.rs` in the parent folder, where `$dir` is the directory containing `self.file_id`
64 let parent = our_path.parent()?; 64 let parent = our_path.parent()?;
65 let mut paths = 65 let mut paths =
66 vec![parent.join("mod.rs")?, parent.join("main.rs")?, parent.join("lib.rs")?]; 66 vec![parent.join("mod.rs")?, parent.join("lib.rs")?, parent.join("main.rs")?];
67 67
68 // `submod/bla.rs` -> `submod.rs` 68 // `submod/bla.rs` -> `submod.rs`
69 if let Some(newmod) = (|| { 69 if let Some(newmod) = (|| {