about summary refs log tree commit diff
path: root/compiler/rustc_expand/src/module.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-05-06 15:19:39 +0000
committerbors <bors@rust-lang.org>2021-05-06 15:19:39 +0000
commitd44f647ffcff0e1ff2c0f45b6a0ce9796d80f1ca (patch)
tree11e72654b4a65b93a5c4249357b092a0c4293f26 /compiler/rustc_expand/src/module.rs
parent109248a4eb99bc83684c94ca4ef36f2fadc17e2a (diff)
parentccc820e1f8eb8d8d142bd93d578bb5c7d9bb6775 (diff)
Auto merge of #84982 - Dylan-DPC:rollup-q4cbec2, r=Dylan-DPC
Rollup of 8 pull requests

Successful merges:

 - #83507 (Implement RFC 2951: Native link modifiers)
 - #84328 (Stablize {HashMap,BTreeMap}::into_{keys,values})
 - #84712 (Simplify chdir implementation and minimize unsafe block)
 - #84851 (:arrow_up: rust-analyzer)
 - #84923 (Only compute Obligation `cache_key` once  in `register_obligation_at`)
 - #84945 (E0583: Include secondary path in error message)
 - #84949 (Fix typo in `MaybeUninit::array_assume_init` safety comment)
 - #84950 (Revert PR 83866)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_expand/src/module.rs')
-rw-r--r--compiler/rustc_expand/src/module.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/rustc_expand/src/module.rs b/compiler/rustc_expand/src/module.rs
index 993522d01d8..4d777049f0d 100644
--- a/compiler/rustc_expand/src/module.rs
+++ b/compiler/rustc_expand/src/module.rs
@@ -36,7 +36,7 @@ crate struct ParsedExternalMod {
 pub enum ModError<'a> {
     CircularInclusion(Vec<PathBuf>),
     ModInBlock(Option<Ident>),
-    FileNotFound(Ident, PathBuf),
+    FileNotFound(Ident, PathBuf, PathBuf),
     MultipleCandidates(Ident, PathBuf, PathBuf),
     ParserError(DiagnosticBuilder<'a>),
 }
@@ -219,7 +219,7 @@ pub fn default_submod_path<'a>(
             file_path: secondary_path,
             dir_ownership: DirOwnership::Owned { relative: None },
         }),
-        (false, false) => Err(ModError::FileNotFound(ident, default_path)),
+        (false, false) => Err(ModError::FileNotFound(ident, default_path, secondary_path)),
         (true, true) => Err(ModError::MultipleCandidates(ident, default_path, secondary_path)),
     }
 }
@@ -247,7 +247,7 @@ impl ModError<'_> {
                 }
                 err
             }
-            ModError::FileNotFound(ident, default_path) => {
+            ModError::FileNotFound(ident, default_path, secondary_path) => {
                 let mut err = struct_span_err!(
                     diag,
                     span,
@@ -256,9 +256,10 @@ impl ModError<'_> {
                     ident,
                 );
                 err.help(&format!(
-                    "to create the module `{}`, create file \"{}\"",
+                    "to create the module `{}`, create file \"{}\" or \"{}\"",
                     ident,
                     default_path.display(),
+                    secondary_path.display(),
                 ));
                 err
             }