1
Fork 0

UPDATE - rename AddSubdiagnostic trait to AddToDiagnostic

This commit is contained in:
Jhonny Bill Mena 2022-09-18 11:46:16 -04:00
parent 19b348fed4
commit 191fac6826
11 changed files with 23 additions and 23 deletions

View file

@ -1,4 +1,4 @@
use rustc_errors::{fluent, AddSubdiagnostic, IntoDiagnostic, ErrorGuaranteed, Handler};
use rustc_errors::{fluent, AddToDiagnostic, IntoDiagnostic, ErrorGuaranteed, Handler};
use rustc_macros::{DiagnosticHandler, SessionSubdiagnostic};
use rustc_session::lint::Level;
use rustc_span::{Span, Symbol};
@ -22,7 +22,7 @@ pub enum OverruledAttributeSub {
CommandLineSource,
}
impl AddSubdiagnostic for OverruledAttributeSub {
impl AddToDiagnostic for OverruledAttributeSub {
fn add_to_diagnostic(self, diag: &mut rustc_errors::Diagnostic) {
match self {
OverruledAttributeSub::DefaultSource { id } => {
@ -87,7 +87,7 @@ pub struct RequestedLevel {
pub lint_name: String,
}
impl AddSubdiagnostic for RequestedLevel {
impl AddToDiagnostic for RequestedLevel {
fn add_to_diagnostic(self, diag: &mut rustc_errors::Diagnostic) {
diag.note(fluent::lint::requested_level);
diag.set_arg(

View file

@ -372,7 +372,7 @@ declare_tool_lint! {
declare_tool_lint! {
pub rustc::DIAGNOSTIC_OUTSIDE_OF_IMPL,
Allow,
"prevent creation of diagnostics outside of `DiagnosticHandler`/`AddSubdiagnostic` impls",
"prevent creation of diagnostics outside of `DiagnosticHandler`/`AddToDiagnostic` impls",
report_in_external_macro: true
}