errors: generate typed identifiers in each crate
Instead of loading the Fluent resources for every crate in `rustc_error_messages`, each crate generates typed identifiers for its own diagnostics and creates a static which are pulled together in the `rustc_driver` crate and provided to the diagnostic emitter. Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
parent
f9216b7564
commit
d1fcf61117
151 changed files with 1721 additions and 1440 deletions
|
@ -1,4 +1,5 @@
|
|||
use rustc_errors::{fluent, ErrorGuaranteed, Handler, IntoDiagnostic};
|
||||
use crate::fluent_generated as fluent;
|
||||
use rustc_errors::{ErrorGuaranteed, Handler, IntoDiagnostic};
|
||||
use rustc_macros::Diagnostic;
|
||||
use rustc_middle::ty::{self, PolyTraitRef, Ty};
|
||||
use rustc_span::{Span, Symbol};
|
||||
|
@ -69,19 +70,19 @@ impl IntoDiagnostic<'_> for NegativePositiveConflict<'_> {
|
|||
diag.code(rustc_errors::error_code!(E0751));
|
||||
match self.negative_impl_span {
|
||||
Ok(span) => {
|
||||
diag.span_label(span, fluent::negative_implementation_here);
|
||||
diag.span_label(span, fluent::trait_selection_negative_implementation_here);
|
||||
}
|
||||
Err(cname) => {
|
||||
diag.note(fluent::negative_implementation_in_crate);
|
||||
diag.note(fluent::trait_selection_negative_implementation_in_crate);
|
||||
diag.set_arg("negative_impl_cname", cname.to_string());
|
||||
}
|
||||
}
|
||||
match self.positive_impl_span {
|
||||
Ok(span) => {
|
||||
diag.span_label(span, fluent::positive_implementation_here);
|
||||
diag.span_label(span, fluent::trait_selection_positive_implementation_here);
|
||||
}
|
||||
Err(cname) => {
|
||||
diag.note(fluent::positive_implementation_in_crate);
|
||||
diag.note(fluent::trait_selection_positive_implementation_in_crate);
|
||||
diag.set_arg("positive_impl_cname", cname.to_string());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue