File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -772,7 +772,15 @@ impl Item {
772772 . other_attrs
773773 . iter ( )
774774 . filter_map ( |attr| {
775- if keep_as_is {
775+ // We have separate pretty-printing logic for `#[repr(..)]` attributes.
776+ // For example, there are circumstances where `#[repr(transparent)]` is applied
777+ // but should not be publicly shown in rustdoc because it isn't public API.
778+ if keep_as_is
779+ && !matches ! (
780+ attr,
781+ rustc_hir:: Attribute :: Parsed ( rustc_attr_parsing:: AttributeKind :: Repr ( ..) )
782+ )
783+ {
776784 Some ( rustc_hir_pretty:: attribute_to_string ( & tcx, attr) )
777785 } else if ALLOWED_ATTRIBUTES . contains ( & attr. name_or_empty ( ) ) {
778786 Some (
@@ -786,8 +794,7 @@ impl Item {
786794 }
787795 } )
788796 . collect ( ) ;
789- if !keep_as_is
790- && let Some ( def_id) = self . def_id ( )
797+ if let Some ( def_id) = self . def_id ( )
791798 && let ItemType :: Struct | ItemType :: Enum | ItemType :: Union = self . type_ ( )
792799 {
793800 let adt = tcx. adt_def ( def_id) ;
You can’t perform that action at this time.
0 commit comments