rust/compiler/rustc_macros/src
Jakub Beránek c054bac89a
Rollup merge of #138063 - compiler-errors:improve-attr-unpretty, r=jdonszelmann
Improve `-Zunpretty=hir` for parsed attrs

0. Rename `print_something` to `should_render` to make it distinct from `print_attribute` in that it doesn't print anything, it's just a way to probe if a type renders anything.
1. Fixes a few bugs in the `PrintAttribute` derive. Namely, the `__printed_anything` variable was entangled with the `should_render` call, leading us to always render field names but never render commas.
2. Remove the outermost `""` from the attr.
3. Debug print `Symbol`s. I know that this is redundant for some parsed attributes, but there's no good way to distinguish symbols that are ident-like and symbols which are cooked string literals. We could perhaps *conditionally* to fall back to a debug printing if the symbol doesn't match an ident? But seems like overkill.

Based on #138060, only review the commits not in that one.
2025-03-11 13:30:51 +01:00
..
diagnostics Fix binding mode problems 2025-02-22 00:13:19 +00:00
symbols Rustfmt 2025-02-08 22:12:13 +00:00
current_version.rs Simplify the current_rustc_version macro. 2023-11-10 10:54:21 +11:00
extension.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
hash_stable.rs Make synstructure underscore_const(true) the default 2024-02-17 13:57:33 +01:00
lib.rs Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
lift.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
print_attribute.rs Fix pretty printing of parsed attrs in hir_pretty 2025-03-10 02:04:26 +00:00
query.rs Rename ensure_forwards_result_if_red to return_result_from_ensure_ok 2025-02-01 12:42:41 +11:00
serialize.rs Rustfmt 2025-02-08 22:12:13 +00:00
symbols.rs Avoid naming variables str 2025-01-07 14:30:02 +02:00
try_from.rs Use LLVM-C APIs for getting/setting visibility 2024-10-27 11:05:33 +11:00
type_foldable.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
type_visitable.rs Make fewer crates depend on rustc_ast_ir 2025-02-19 07:06:54 +00:00