mirror of https://github.com/rust-lang/rust.git
Remove `Diagnostic::new_with_code`.
Its single use can be replaced with `Diagnostic::new_with_messages`.
This commit is contained in:
parent
3a1b8e643a
commit
d7a3b6291c
|
@ -216,7 +216,7 @@ impl StringPart {
|
|||
impl Diagnostic {
|
||||
#[track_caller]
|
||||
pub fn new<M: Into<DiagnosticMessage>>(level: Level, message: M) -> Self {
|
||||
Diagnostic::new_with_code(level, None, message)
|
||||
Diagnostic::new_with_messages(level, vec![(message.into(), Style::NoStyle)])
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
|
@ -235,26 +235,6 @@ impl Diagnostic {
|
|||
}
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
pub(crate) fn new_with_code<M: Into<DiagnosticMessage>>(
|
||||
level: Level,
|
||||
code: Option<DiagnosticId>,
|
||||
message: M,
|
||||
) -> Self {
|
||||
Diagnostic {
|
||||
level,
|
||||
message: vec![(message.into(), Style::NoStyle)],
|
||||
code,
|
||||
span: MultiSpan::new(),
|
||||
children: vec![],
|
||||
suggestions: Ok(vec![]),
|
||||
args: Default::default(),
|
||||
sort_span: DUMMY_SP,
|
||||
is_lint: false,
|
||||
emitted_at: DiagnosticLocation::caller(),
|
||||
}
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub fn level(&self) -> Level {
|
||||
self.level
|
||||
|
|
Loading…
Reference in New Issue