diff options
| author | Michael Goulet <michael@errs.io> | 2025-03-05 14:43:36 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-03-10 02:03:19 +0000 |
| commit | 6a38322d2608a480b38da6efd926627950bc0537 (patch) | |
| tree | c9253d95c185d5142c2ab45a25c59544efe189a1 /compiler/rustc_macros | |
| parent | 2b4694a69804f89ff9d47d1a427f72c876f7f44c (diff) | |
| download | rust-6a38322d2608a480b38da6efd926627950bc0537.tar.gz rust-6a38322d2608a480b38da6efd926627950bc0537.zip | |
Rename print_something to should_render
Diffstat (limited to 'compiler/rustc_macros')
| -rw-r--r-- | compiler/rustc_macros/src/print_attribute.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_macros/src/print_attribute.rs b/compiler/rustc_macros/src/print_attribute.rs index 3c6e30b851b..fe78fb15cb9 100644 --- a/compiler/rustc_macros/src/print_attribute.rs +++ b/compiler/rustc_macros/src/print_attribute.rs @@ -16,7 +16,7 @@ fn print_fields(name: &Ident, fields: &Fields) -> (TokenStream, TokenStream, Tok let name = field.ident.as_ref().unwrap(); let string_name = name.to_string(); disps.push(quote! { - if __printed_anything && #name.print_something() { + if __printed_anything && #name.should_render() { __p.word_space(","); __printed_anything = true; } @@ -31,7 +31,7 @@ fn print_fields(name: &Ident, fields: &Fields) -> (TokenStream, TokenStream, Tok quote! { {#(#field_names),*} }, quote! { __p.word(#string_name); - if true #(&& !#field_names.print_something())* { + if true #(&& !#field_names.should_render())* { return; } @@ -48,7 +48,7 @@ fn print_fields(name: &Ident, fields: &Fields) -> (TokenStream, TokenStream, Tok for idx in 0..fields_unnamed.unnamed.len() { let name = format_ident!("f{idx}"); disps.push(quote! { - if __printed_anything && #name.print_something() { + if __printed_anything && #name.should_render() { __p.word_space(","); __printed_anything = true; } @@ -62,7 +62,7 @@ fn print_fields(name: &Ident, fields: &Fields) -> (TokenStream, TokenStream, Tok quote! { __p.word(#string_name); - if true #(&& !#field_names.print_something())* { + if true #(&& !#field_names.should_render())* { return; } @@ -138,7 +138,7 @@ pub(crate) fn print_attribute(input: Structure<'_>) -> TokenStream { input.gen_impl(quote! { #[allow(unused)] gen impl PrintAttribute for @Self { - fn print_something(&self) -> bool { #printed } + fn should_render(&self) -> bool { #printed } fn print_attribute(&self, __p: &mut rustc_ast_pretty::pp::Printer) { #code } } }) |
