Skip to content

translation: eager translation #102623

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Oct 12, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
macros: tidy up lint changes
Small tweaks to changes made in a previous PR, unrelated to eager
translation.

Signed-off-by: David Wood <david.wood@huawei.com>
  • Loading branch information
davidtwco committed Oct 10, 2022
commit febbf71219001cd7948c3d1e5ffa68706896d955
9 changes: 6 additions & 3 deletions compiler/rustc_macros/src/diagnostics/diagnostic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ impl<'a> LintDiagnosticDerive<'a> {
});

let msg = builder.each_variant(&mut structure, |mut builder, variant| {
// HACK(wafflelapkin): initialize slug (???)
let _preamble = builder.preamble(&variant);
// Collect the slug by generating the preamble.
let _ = builder.preamble(&variant);

match builder.slug.value_ref() {
None => {
Expand All @@ -125,7 +125,10 @@ impl<'a> LintDiagnosticDerive<'a> {
let diag = &builder.diag;
structure.gen_impl(quote! {
gen impl<'__a> rustc_errors::DecorateLint<'__a, ()> for @Self {
fn decorate_lint<'__b>(self, #diag: &'__b mut rustc_errors::DiagnosticBuilder<'__a, ()>) -> &'__b mut rustc_errors::DiagnosticBuilder<'__a, ()> {
fn decorate_lint<'__b>(
self,
#diag: &'__b mut rustc_errors::DiagnosticBuilder<'__a, ()>
) -> &'__b mut rustc_errors::DiagnosticBuilder<'__a, ()> {
use rustc_errors::IntoDiagnosticArg;
#implementation
}
Expand Down