diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2021-05-03 15:08:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-03 15:08:09 +0200 |
| commit | 377722103e2bb4035ae2d91c090d022a7372fb47 (patch) | |
| tree | 683101b51a001add697a0e96bb1e599069f93447 | |
| parent | ed1646a785f28306e01a7d505a40e5a40371e733 (diff) | |
| parent | 461f52071d8065dbb7c57189e181dc1f72e8b10f (diff) | |
| download | rust-377722103e2bb4035ae2d91c090d022a7372fb47.tar.gz rust-377722103e2bb4035ae2d91c090d022a7372fb47.zip | |
Rollup merge of #84854 - hi-rustin:rustin-patch-E0761, r=varkor
use double quotes and full path for E0761 close https://github.com/rust-lang/rust/issues/84828
| -rw-r--r-- | compiler/rustc_expand/src/module.rs | 14 | ||||
| -rw-r--r-- | src/test/ui/modules_and_files_visibility/mod_file_disambig.stderr | 2 |
2 files changed, 7 insertions, 9 deletions
diff --git a/compiler/rustc_expand/src/module.rs b/compiler/rustc_expand/src/module.rs index c5ce0baaa8f..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 {}", + "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 diff --git a/src/test/ui/modules_and_files_visibility/mod_file_disambig.stderr b/src/test/ui/modules_and_files_visibility/mod_file_disambig.stderr index 3a3d2e2dddd..a2c99396987 100644 --- a/src/test/ui/modules_and_files_visibility/mod_file_disambig.stderr +++ b/src/test/ui/modules_and_files_visibility/mod_file_disambig.stderr @@ -1,4 +1,4 @@ -error[E0761]: file for module `mod_file_disambig_aux` found at both mod_file_disambig_aux.rs and mod_file_disambig_aux/mod.rs +error[E0761]: file for module `mod_file_disambig_aux` found at both "$DIR/mod_file_disambig_aux.rs" and "$DIR/mod_file_disambig_aux/mod.rs" --> $DIR/mod_file_disambig.rs:1:1 | LL | mod mod_file_disambig_aux; |
