@@ -772,20 +772,11 @@ impl Item {
772
772
. filter_map ( |attr| {
773
773
if is_json {
774
774
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 ,
789
780
_ => Some ( {
790
781
let mut s = rustc_hir_pretty:: attribute_to_string ( & tcx, attr) ;
791
782
assert_eq ! ( s. pop( ) , Some ( '\n' ) ) ;
@@ -818,7 +809,8 @@ impl Item {
818
809
if repr. transparent ( ) {
819
810
// Render `repr(transparent)` iff the non-1-ZST field is public or at least one
820
811
// 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
822
814
|| adt
823
815
. all_fields ( )
824
816
. find ( |field| {
0 commit comments