Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use double quotes and full path for E0761 #84854

Merged
merged 2 commits into from
May 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions compiler/rustc_expand/src/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>),
}

Expand Down Expand Up @@ -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)),
}
}

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down