use full path for E0761
This commit is contained in:
parent
f758eb664e
commit
461f52071d
2 changed files with 6 additions and 8 deletions
|
@ -37,7 +37,7 @@ pub enum ModError<'a> {
|
||||||
CircularInclusion(Vec<PathBuf>),
|
CircularInclusion(Vec<PathBuf>),
|
||||||
ModInBlock(Option<Ident>),
|
ModInBlock(Option<Ident>),
|
||||||
FileNotFound(Ident, PathBuf),
|
FileNotFound(Ident, PathBuf),
|
||||||
MultipleCandidates(Ident, String, String),
|
MultipleCandidates(Ident, PathBuf, PathBuf),
|
||||||
ParserError(DiagnosticBuilder<'a>),
|
ParserError(DiagnosticBuilder<'a>),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -220,9 +220,7 @@ pub fn default_submod_path<'a>(
|
||||||
dir_ownership: DirOwnership::Owned { relative: None },
|
dir_ownership: DirOwnership::Owned { relative: None },
|
||||||
}),
|
}),
|
||||||
(false, false) => Err(ModError::FileNotFound(ident, default_path)),
|
(false, false) => Err(ModError::FileNotFound(ident, default_path)),
|
||||||
(true, true) => {
|
(true, true) => Err(ModError::MultipleCandidates(ident, default_path, secondary_path)),
|
||||||
Err(ModError::MultipleCandidates(ident, default_path_str, secondary_path_str))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -264,15 +262,15 @@ impl ModError<'_> {
|
||||||
));
|
));
|
||||||
err
|
err
|
||||||
}
|
}
|
||||||
ModError::MultipleCandidates(ident, default_path_short, secondary_path_short) => {
|
ModError::MultipleCandidates(ident, default_path, secondary_path) => {
|
||||||
let mut err = struct_span_err!(
|
let mut err = struct_span_err!(
|
||||||
diag,
|
diag,
|
||||||
span,
|
span,
|
||||||
E0761,
|
E0761,
|
||||||
"file for module `{}` found at both \"{}\" and \"{}\"",
|
"file for module `{}` found at both \"{}\" and \"{}\"",
|
||||||
ident,
|
ident,
|
||||||
default_path_short,
|
default_path.display(),
|
||||||
secondary_path_short,
|
secondary_path.display(),
|
||||||
);
|
);
|
||||||
err.help("delete or rename one of them to remove the ambiguity");
|
err.help("delete or rename one of them to remove the ambiguity");
|
||||||
err
|
err
|
||||||
|
|
|
@ -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
|
--> $DIR/mod_file_disambig.rs:1:1
|
||||||
|
|
|
|
||||||
LL | mod mod_file_disambig_aux;
|
LL | mod mod_file_disambig_aux;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue