Improve some names.

Lots of vectors of messages called `message` or `msg`. This commit
pluralizes them.

Note that `emit_message_default` and `emit_messages_default` both
already existed, and both process a vector, so I renamed the former
`emit_messages_default_inner` because it's called by the latter.
This commit is contained in:
Nicholas Nethercote 2023-12-20 17:12:17 +11:00
parent d7a3b6291c
commit 824667f753
12 changed files with 45 additions and 45 deletions

View file

@ -986,7 +986,7 @@ pub struct CguMessage;
type DiagnosticArgName<'source> = Cow<'source, str>;
struct Diagnostic {
msg: Vec<(DiagnosticMessage, Style)>,
msgs: Vec<(DiagnosticMessage, Style)>,
args: FxHashMap<DiagnosticArgName<'static>, rustc_errors::DiagnosticArgValue<'static>>,
code: Option<DiagnosticId>,
lvl: Level,
@ -1799,14 +1799,14 @@ impl Emitter for SharedEmitter {
let args: FxHashMap<Cow<'_, str>, rustc_errors::DiagnosticArgValue<'_>> =
diag.args().map(|(name, arg)| (name.clone(), arg.clone())).collect();
drop(self.sender.send(SharedEmitterMessage::Diagnostic(Diagnostic {
msg: diag.message.clone(),
msgs: diag.messages.clone(),
args: args.clone(),
code: diag.code.clone(),
lvl: diag.level(),
})));
for child in &diag.children {
drop(self.sender.send(SharedEmitterMessage::Diagnostic(Diagnostic {
msg: child.message.clone(),
msgs: child.messages.clone(),
args: args.clone(),
code: None,
lvl: child.level,
@ -1838,7 +1838,7 @@ impl SharedEmitterMain {
match message {
Ok(SharedEmitterMessage::Diagnostic(diag)) => {
let dcx = sess.dcx();
let mut d = rustc_errors::Diagnostic::new_with_messages(diag.lvl, diag.msg);
let mut d = rustc_errors::Diagnostic::new_with_messages(diag.lvl, diag.msgs);
if let Some(code) = diag.code {
d.code(code);
}