@@ -774,20 +774,11 @@ impl Item {
774774 . filter_map ( |attr| {
775775 if is_json {
776776 match attr {
777- hir:: Attribute :: Parsed ( AttributeKind :: Deprecation { .. } ) => {
778- // rustdoc-json stores this in `Item::deprecation`, so we
779- // don't want it it `Item::attrs`.
780- None
781- }
782- rustc_hir:: Attribute :: Parsed (
783- rustc_attr_data_structures:: AttributeKind :: Repr ( ..) ,
784- ) => {
785- // We have separate pretty-printing logic for `#[repr(..)]` attributes.
786- // For example, there are circumstances where `#[repr(transparent)]`
787- // is applied but should not be publicly shown in rustdoc
788- // because it isn't public API.
789- None
790- }
777+ // rustdoc-json stores this in `Item::deprecation`, so we
778+ // don't want it it `Item::attrs`.
779+ hir:: Attribute :: Parsed ( AttributeKind :: Deprecation { .. } ) => None ,
780+ // We have separate pretty-printing logic for `#[repr(..)]` attributes.
781+ hir:: Attribute :: Parsed ( AttributeKind :: Repr ( ..) ) => None ,
791782 _ => Some ( {
792783 let mut s = rustc_hir_pretty:: attribute_to_string ( & tcx, attr) ;
793784 assert_eq ! ( s. pop( ) , Some ( '\n' ) ) ;
@@ -820,7 +811,8 @@ impl Item {
820811 if repr. transparent ( ) {
821812 // Render `repr(transparent)` iff the non-1-ZST field is public or at least one
822813 // field is public in case all fields are 1-ZST fields.
823- let render_transparent = cache. document_private
814+ let render_transparent = is_json
815+ || cache. document_private
824816 || adt
825817 . all_fields ( )
826818 . find ( |field| {
0 commit comments