1
Fork 0

add: lints for errors.rs

This commit is contained in:
Rejyr 2022-09-21 20:42:52 -04:00
parent 8b897bbce6
commit e3bb2ebfbf

View file

@ -1,3 +1,5 @@
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
use rustc_errors::{ use rustc_errors::{
fluent, AddToDiagnostic, Diagnostic, ErrorGuaranteed, Handler, IntoDiagnostic, fluent, AddToDiagnostic, Diagnostic, ErrorGuaranteed, Handler, IntoDiagnostic,
SubdiagnosticMessage, SubdiagnosticMessage,
@ -38,7 +40,7 @@ impl AddToDiagnostic for OverruledAttributeSub {
OverruledAttributeSub::NodeSource { span, reason } => { OverruledAttributeSub::NodeSource { span, reason } => {
diag.span_label(span, fluent::lint_node_source); diag.span_label(span, fluent::lint_node_source);
if let Some(rationale) = reason { if let Some(rationale) = reason {
#[allow(rustc::diagnostic_outside_of_impl)] #[allow(rustc::untranslatable_diagnostic)]
diag.note(rationale.as_str()); diag.note(rationale.as_str());
} }
} }