about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/astconv/errors.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-01-10 18:03:53 +0000
committerbors <bors@rust-lang.org>2024-01-10 18:03:53 +0000
commita2d9d73e608f1b24eba840c4fd2d68dbe3b65e01 (patch)
tree42523e01769059455f89af632b53b841b1401d69 /compiler/rustc_hir_analysis/src/astconv/errors.rs
parente9271846294c4ee5bd7706df68180320c0b5ff20 (diff)
parent700a3965202f4f403956fcce744ce5ba6adf2ddb (diff)
downloadrust-a2d9d73e608f1b24eba840c4fd2d68dbe3b65e01.tar.gz
rust-a2d9d73e608f1b24eba840c4fd2d68dbe3b65e01.zip
Auto merge of #119751 - nnethercote:error-api-fixes, r=oli-obk
Diagnostic API fixes

Some improvements to diagnostic APIs: improve some naming, use shortcuts in more places, and add a couple of missing methods.

r? `@compiler-errors`
Diffstat (limited to 'compiler/rustc_hir_analysis/src/astconv/errors.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/astconv/errors.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_hir_analysis/src/astconv/errors.rs b/compiler/rustc_hir_analysis/src/astconv/errors.rs
index 24b55461a42..fc2ed104b3d 100644
--- a/compiler/rustc_hir_analysis/src/astconv/errors.rs
+++ b/compiler/rustc_hir_analysis/src/astconv/errors.rs
@@ -7,7 +7,7 @@ use crate::fluent_generated as fluent;
 use crate::traits::error_reporting::report_object_safety_error;
 use rustc_data_structures::fx::{FxHashMap, FxIndexMap, FxIndexSet};
 use rustc_data_structures::unord::UnordMap;
-use rustc_errors::{pluralize, struct_span_err, Applicability, Diagnostic, ErrorGuaranteed};
+use rustc_errors::{pluralize, struct_span_code_err, Applicability, Diagnostic, ErrorGuaranteed};
 use rustc_hir as hir;
 use rustc_hir::def_id::{DefId, LocalDefId};
 use rustc_infer::traits::FulfillmentError;
@@ -346,7 +346,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
         candidates: Vec<DefId>,
         span: Span,
     ) -> ErrorGuaranteed {
-        let mut err = struct_span_err!(
+        let mut err = struct_span_code_err!(
             self.tcx().dcx(),
             name.span,
             E0034,
@@ -445,7 +445,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
                 String::new()
             };
 
-            let mut err = struct_span_err!(
+            let mut err = struct_span_code_err!(
                 tcx.dcx(),
                 name.span,
                 E0220,
@@ -697,7 +697,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
         let names = names.join(", ");
 
         trait_bound_spans.sort();
-        let mut err = struct_span_err!(
+        let mut err = struct_span_code_err!(
             tcx.dcx(),
             trait_bound_spans,
             E0191,