Fix CrateLocationUnknownType error

This commit is contained in:
Steven Tang 2022-11-19 22:37:56 +11:00
parent c5d82ed7a4
commit 1e4adaf11f
No known key found for this signature in database
GPG Key ID: 1597520C734BAE66
2 changed files with 2 additions and 1 deletions

View File

@ -692,6 +692,7 @@ pub struct CrateLocationUnknownType<'a> {
#[primary_span]
pub span: Span,
pub path: &'a Path,
pub crate_name: Symbol,
}
#[derive(Diagnostic)]

View File

@ -1024,7 +1024,7 @@ impl CrateError {
if !locator.crate_rejections.via_filename.is_empty() {
let mismatches = locator.crate_rejections.via_filename.iter();
for CrateMismatch { path, .. } in mismatches {
sess.emit_err(CrateLocationUnknownType { span, path: &path });
sess.emit_err(CrateLocationUnknownType { span, path: &path, crate_name });
sess.emit_err(LibFilenameForm {
span,
dll_prefix: &locator.dll_prefix,