Add replace_args
method for rustc_errors::diagnostic::Diagnostic
This commit is contained in:
parent
b4820a3b94
commit
3b949eb7c1
@ -1792,9 +1792,7 @@ pub fn check(&self, sess: &Session, blocking: bool) {
|
||||
if let Some(code) = diag.code {
|
||||
d.code(code);
|
||||
}
|
||||
for (name, arg) in diag.args {
|
||||
d.set_arg(name, arg);
|
||||
}
|
||||
d.replace_args(diag.args);
|
||||
handler.emit_diagnostic(&mut d);
|
||||
}
|
||||
Ok(SharedEmitterMessage::InlineAsmError(cookie, msg, level, source)) => {
|
||||
|
@ -940,6 +940,10 @@ pub fn set_arg(
|
||||
self
|
||||
}
|
||||
|
||||
pub fn replace_args(&mut self, args: FxHashMap<DiagnosticArgName<'static>, DiagnosticArgValue<'static>>) {
|
||||
self.args = args;
|
||||
}
|
||||
|
||||
pub fn styled_message(&self) -> &[(DiagnosticMessage, Style)] {
|
||||
&self.message
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user