E0583: Include secondary path in error message
This commit is contained in:
parent
45ccf91070
commit
4617b03316
9 changed files with 13 additions and 12 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue