summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_metadata/src/errors.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_metadata/src/errors.rs')
-rw-r--r--compiler/rustc_metadata/src/errors.rs21
1 files changed, 8 insertions, 13 deletions
diff --git a/compiler/rustc_metadata/src/errors.rs b/compiler/rustc_metadata/src/errors.rs
index 70daee291..206c15edd 100644
--- a/compiler/rustc_metadata/src/errors.rs
+++ b/compiler/rustc_metadata/src/errors.rs
@@ -308,14 +308,9 @@ pub struct FailCreateFileEncoder {
}
#[derive(Diagnostic)]
-#[diag(metadata_fail_seek_file)]
-pub struct FailSeekFile {
- pub err: Error,
-}
-
-#[derive(Diagnostic)]
#[diag(metadata_fail_write_file)]
-pub struct FailWriteFile {
+pub struct FailWriteFile<'a> {
+ pub path: &'a Path,
pub err: Error,
}
@@ -503,9 +498,9 @@ pub(crate) struct MultipleCandidates {
impl IntoDiagnostic<'_> for MultipleCandidates {
fn into_diagnostic(
self,
- handler: &'_ rustc_errors::Handler,
+ dcx: &'_ rustc_errors::DiagCtxt,
) -> rustc_errors::DiagnosticBuilder<'_, ErrorGuaranteed> {
- let mut diag = handler.struct_err(fluent::metadata_multiple_candidates);
+ let mut diag = dcx.struct_err(fluent::metadata_multiple_candidates);
diag.set_arg("crate_name", self.crate_name);
diag.set_arg("flavor", self.flavor);
diag.code(error_code!(E0464));
@@ -602,9 +597,9 @@ impl IntoDiagnostic<'_> for InvalidMetadataFiles {
#[track_caller]
fn into_diagnostic(
self,
- handler: &'_ rustc_errors::Handler,
+ dcx: &'_ rustc_errors::DiagCtxt,
) -> rustc_errors::DiagnosticBuilder<'_, ErrorGuaranteed> {
- let mut diag = handler.struct_err(fluent::metadata_invalid_meta_files);
+ let mut diag = dcx.struct_err(fluent::metadata_invalid_meta_files);
diag.set_arg("crate_name", self.crate_name);
diag.set_arg("add_info", self.add_info);
diag.code(error_code!(E0786));
@@ -632,9 +627,9 @@ impl IntoDiagnostic<'_> for CannotFindCrate {
#[track_caller]
fn into_diagnostic(
self,
- handler: &'_ rustc_errors::Handler,
+ dcx: &'_ rustc_errors::DiagCtxt,
) -> rustc_errors::DiagnosticBuilder<'_, ErrorGuaranteed> {
- let mut diag = handler.struct_err(fluent::metadata_cannot_find_crate);
+ let mut diag = dcx.struct_err(fluent::metadata_cannot_find_crate);
diag.set_arg("crate_name", self.crate_name);
diag.set_arg("current_crate", self.current_crate);
diag.set_arg("add_info", self.add_info);