Generate lint diagnostic message from BuiltinLintDiag
Translation of the lint message happens when the actual diagnostic is created, not when the lint is buffered. Generating the message from BuiltinLintDiag ensures that all required data to construct the message is preserved in the LintBuffer, eventually allowing the messages to be moved to fluent. Remove the `msg` field from BufferedEarlyLint, it is either generated from the data in the BuiltinLintDiag or stored inside BuiltinLintDiag::Normal.
This commit is contained in:
parent
2482f3c17c
commit
c227f35a9c
26 changed files with 212 additions and 130 deletions
|
@ -556,7 +556,6 @@ fn make_format_args(
|
|||
let arg_name = args.explicit_args()[index].kind.ident().unwrap();
|
||||
ecx.buffered_early_lint.push(BufferedEarlyLint {
|
||||
span: arg_name.span.into(),
|
||||
msg: format!("named argument `{}` is not used by name", arg_name.name).into(),
|
||||
node_id: rustc_ast::CRATE_NODE_ID,
|
||||
lint_id: LintId::of(NAMED_ARGUMENTS_USED_POSITIONALLY),
|
||||
diagnostic: BuiltinLintDiag::NamedArgumentUsedPositionally {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue