lint: port keyword idents diagnostics
Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
parent
10f2d3f566
commit
10676418fa
3 changed files with 14 additions and 3 deletions
|
@ -8,7 +8,7 @@ use rustc_error_messages::FluentValue;
|
|||
use rustc_lint_defs::{Applicability, LintExpectationId};
|
||||
use rustc_span::edition::LATEST_STABLE_EDITION;
|
||||
use rustc_span::symbol::{Ident, Symbol};
|
||||
use rustc_span::{Span, DUMMY_SP};
|
||||
use rustc_span::{edition::Edition, Span, DUMMY_SP};
|
||||
use std::borrow::Cow;
|
||||
use std::fmt;
|
||||
use std::hash::{Hash, Hasher};
|
||||
|
@ -115,6 +115,12 @@ impl IntoDiagnosticArg for String {
|
|||
}
|
||||
}
|
||||
|
||||
impl IntoDiagnosticArg for Edition {
|
||||
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
|
||||
DiagnosticArgValue::Str(Cow::Owned(self.to_string()))
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoDiagnosticArg for Symbol {
|
||||
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
|
||||
self.to_ident_string().into_diagnostic_arg()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue