rust/compiler
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
..
rustc Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_abi Auto merge of #138302 - matthiaskrgr:rollup-an2up80, r=matthiaskrgr 2025-03-11 00:55:25 +00:00
rustc_arena Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_ast Auto merge of #136932 - m-ou-se:fmt-width-precision-u16, r=scottmcm 2025-03-11 04:07:05 +00:00
rustc_ast_ir Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_ast_lowering Auto merge of #136932 - m-ou-se:fmt-width-precision-u16, r=scottmcm 2025-03-11 04:07:05 +00:00
rustc_ast_passes Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_ast_pretty Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_attr_data_structures Rollup merge of #138063 - compiler-errors:improve-attr-unpretty, r=jdonszelmann 2025-03-11 13:30:51 +01:00
rustc_attr_parsing Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_baked_icu_data Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_borrowck Auto merge of #138302 - matthiaskrgr:rollup-an2up80, r=matthiaskrgr 2025-03-11 00:55:25 +00:00
rustc_builtin_macros Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_codegen_cranelift Fully test the alloc crate through alloctests 2025-03-07 19:11:13 +00:00
rustc_codegen_gcc Rollup merge of #138040 - thaliaarchi:use-prelude-size-of.compiler, r=compiler-errors 2025-03-09 10:34:49 +01:00
rustc_codegen_llvm Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_codegen_ssa Auto merge of #138302 - matthiaskrgr:rollup-an2up80, r=matthiaskrgr 2025-03-11 00:55:25 +00:00
rustc_const_eval Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_data_structures Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_driver Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_driver_impl Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_error_codes Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_error_messages Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_errors Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_expand Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_feature Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_fluent_macro Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_fs_util Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_graphviz Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_hashes Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_hir Auto merge of #138302 - matthiaskrgr:rollup-an2up80, r=matthiaskrgr 2025-03-11 00:55:25 +00:00
rustc_hir_analysis Auto merge of #138302 - matthiaskrgr:rollup-an2up80, r=matthiaskrgr 2025-03-11 00:55:25 +00:00
rustc_hir_pretty Rollup merge of #138063 - compiler-errors:improve-attr-unpretty, r=jdonszelmann 2025-03-11 13:30:51 +01:00
rustc_hir_typeck Rollup merge of #138306 - jieyouxu:revert-workspace-lints, r=Noratrieb 2025-03-10 15:57:22 +01:00
rustc_incremental Auto merge of #138302 - matthiaskrgr:rollup-an2up80, r=matthiaskrgr 2025-03-11 00:55:25 +00:00
rustc_index Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_index_macros Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_infer Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_interface Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_lexer Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_lint Auto merge of #138302 - matthiaskrgr:rollup-an2up80, r=matthiaskrgr 2025-03-11 00:55:25 +00:00
rustc_lint_defs Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_llvm Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_log Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_macros Rollup merge of #138063 - compiler-errors:improve-attr-unpretty, r=jdonszelmann 2025-03-11 13:30:51 +01:00
rustc_metadata Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_middle Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_mir_build Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_mir_dataflow Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_mir_transform Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_monomorphize Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_next_trait_solver Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_parse Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_parse_format Auto merge of #136932 - m-ou-se:fmt-width-precision-u16, r=scottmcm 2025-03-11 04:07:05 +00:00
rustc_passes Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_pattern_analysis Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_privacy Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_query_impl Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_query_system Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_resolve Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_sanitizers Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_serialize Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_session Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_smir Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_span Auto merge of #136932 - m-ou-se:fmt-width-precision-u16, r=scottmcm 2025-03-11 04:07:05 +00:00
rustc_symbol_mangling Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_target Target definition for wasm32-wali-linux-musl to support the Wasm Linux 2025-03-10 21:26:45 -04:00
rustc_trait_selection Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_traits Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_transmute Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_ty_utils Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_type_ir Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_type_ir_macros Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
stable_mir Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00