|
1 | 1 | //! Errors emitted by ast_passes.
|
2 | 2 |
|
3 | 3 | use rustc_ast::ParamKindOrd;
|
4 |
| -use rustc_errors::{codes::*, AddToDiagnostic, Applicability, Diagnostic, SubdiagnosticMessageOp}; |
| 4 | +use rustc_errors::{ |
| 5 | + codes::*, AddToDiagnostic, Applicability, DiagnosticBuilder, EmissionGuarantee, |
| 6 | + SubdiagnosticMessageOp, |
| 7 | +}; |
5 | 8 | use rustc_macros::{Diagnostic, Subdiagnostic};
|
6 | 9 | use rustc_span::{symbol::Ident, Span, Symbol};
|
7 | 10 |
|
@@ -372,7 +375,11 @@ pub struct EmptyLabelManySpans(pub Vec<Span>);
|
372 | 375 |
|
373 | 376 | // The derive for `Vec<Span>` does multiple calls to `span_label`, adding commas between each
|
374 | 377 | impl AddToDiagnostic for EmptyLabelManySpans {
|
375 |
| - fn add_to_diagnostic_with<F: SubdiagnosticMessageOp>(self, diag: &mut Diagnostic, _: F) { |
| 378 | + fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>( |
| 379 | + self, |
| 380 | + diag: &mut DiagnosticBuilder<'_, G>, |
| 381 | + _: F, |
| 382 | + ) { |
376 | 383 | diag.span_labels(self.0, "");
|
377 | 384 | }
|
378 | 385 | }
|
@@ -729,7 +736,11 @@ pub struct StableFeature {
|
729 | 736 | }
|
730 | 737 |
|
731 | 738 | impl AddToDiagnostic for StableFeature {
|
732 |
| - fn add_to_diagnostic_with<F: SubdiagnosticMessageOp>(self, diag: &mut Diagnostic, _: F) { |
| 739 | + fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>( |
| 740 | + self, |
| 741 | + diag: &mut DiagnosticBuilder<'_, G>, |
| 742 | + _: F, |
| 743 | + ) { |
733 | 744 | diag.arg("name", self.name);
|
734 | 745 | diag.arg("since", self.since);
|
735 | 746 | diag.help(fluent::ast_passes_stable_since);
|
|
0 commit comments