diff options
| author | hi-rustin <rustin.liu@gmail.com> | 2021-05-03 18:57:48 +0800 | 
|---|---|---|
| committer | hi-rustin <rustin.liu@gmail.com> | 2021-05-03 18:57:48 +0800 | 
| commit | 461f52071d8065dbb7c57189e181dc1f72e8b10f (patch) | |
| tree | 2fc56ebe202ebd0b9d40ba325c24689dbf04a6b6 /compiler/rustc_expand/src/module.rs | |
| parent | f758eb664e99d84e77a3a2c8155243a82a9eb4dc (diff) | |
| download | rust-461f52071d8065dbb7c57189e181dc1f72e8b10f.tar.gz rust-461f52071d8065dbb7c57189e181dc1f72e8b10f.zip | |
use full path for E0761
Diffstat (limited to 'compiler/rustc_expand/src/module.rs')
| -rw-r--r-- | compiler/rustc_expand/src/module.rs | 12 | 
1 files changed, 5 insertions, 7 deletions
| diff --git a/compiler/rustc_expand/src/module.rs b/compiler/rustc_expand/src/module.rs index fd25b8f0440..993522d01d8 100644 --- a/compiler/rustc_expand/src/module.rs +++ b/compiler/rustc_expand/src/module.rs @@ -37,7 +37,7 @@ pub enum ModError<'a> { CircularInclusion(Vec<PathBuf>), ModInBlock(Option<Ident>), FileNotFound(Ident, PathBuf), - MultipleCandidates(Ident, String, String), + MultipleCandidates(Ident, PathBuf, PathBuf), ParserError(DiagnosticBuilder<'a>), } @@ -220,9 +220,7 @@ pub fn default_submod_path<'a>( dir_ownership: DirOwnership::Owned { relative: None }, }), (false, false) => Err(ModError::FileNotFound(ident, default_path)), - (true, true) => { - Err(ModError::MultipleCandidates(ident, default_path_str, secondary_path_str)) - } + (true, true) => Err(ModError::MultipleCandidates(ident, default_path, secondary_path)), } } @@ -264,15 +262,15 @@ impl ModError<'_> { )); err } - ModError::MultipleCandidates(ident, default_path_short, secondary_path_short) => { + ModError::MultipleCandidates(ident, default_path, secondary_path) => { let mut err = struct_span_err!( diag, span, E0761, "file for module `{}` found at both \"{}\" and \"{}\"", ident, - default_path_short, - secondary_path_short, + default_path.display(), + secondary_path.display(), ); err.help("delete or rename one of them to remove the ambiguity"); err | 
