@@ -772,20 +772,11 @@ impl Item {
772772 . filter_map ( |attr| {
773773 if is_json {
774774 match attr {
775- hir:: Attribute :: Parsed ( AttributeKind :: Deprecation { .. } ) => {
776- // rustdoc-json stores this in `Item::deprecation`, so we
777- // don't want it it `Item::attrs`.
778- None
779- }
780- rustc_hir:: Attribute :: Parsed ( rustc_attr_parsing:: AttributeKind :: Repr (
781- ..,
782- ) ) => {
783- // We have separate pretty-printing logic for `#[repr(..)]` attributes.
784- // For example, there are circumstances where `#[repr(transparent)]`
785- // is applied but should not be publicly shown in rustdoc
786- // because it isn't public API.
787- None
788- }
775+ // rustdoc-json stores this in `Item::deprecation`, so we
776+ // don't want it it `Item::attrs`.
777+ hir:: Attribute :: Parsed ( AttributeKind :: Deprecation { .. } ) => None ,
778+ // We have separate pretty-printing logic for `#[repr(..)]` attributes.
779+ hir:: Attribute :: Parsed ( AttributeKind :: Repr ( ..) ) => None ,
789780 _ => Some ( {
790781 let mut s = rustc_hir_pretty:: attribute_to_string ( & tcx, attr) ;
791782 assert_eq ! ( s. pop( ) , Some ( '\n' ) ) ;
@@ -818,7 +809,8 @@ impl Item {
818809 if repr. transparent ( ) {
819810 // Render `repr(transparent)` iff the non-1-ZST field is public or at least one
820811 // field is public in case all fields are 1-ZST fields.
821- let render_transparent = cache. document_private
812+ let render_transparent = is_json
813+ || cache. document_private
822814 || adt
823815 . all_fields ( )
824816 . find ( |field| {
0 commit comments