File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -756,12 +756,7 @@ impl Item {
756756 Some ( tcx. visibility ( def_id) )
757757 }
758758
759- pub ( crate ) fn attributes (
760- & self ,
761- tcx : TyCtxt < ' _ > ,
762- cache : & Cache ,
763- keep_as_is : bool ,
764- ) -> Vec < String > {
759+ pub ( crate ) fn attributes ( & self , tcx : TyCtxt < ' _ > , cache : & Cache , is_json : bool ) -> Vec < String > {
765760 const ALLOWED_ATTRIBUTES : & [ Symbol ] =
766761 & [ sym:: export_name, sym:: link_section, sym:: no_mangle, sym:: non_exhaustive] ;
767762
@@ -772,7 +767,7 @@ impl Item {
772767 . other_attrs
773768 . iter ( )
774769 . filter_map ( |attr| {
775- if keep_as_is {
770+ if is_json {
776771 Some ( rustc_hir_pretty:: attribute_to_string ( & tcx, attr) )
777772 } else if ALLOWED_ATTRIBUTES . contains ( & attr. name_or_empty ( ) ) {
778773 Some (
@@ -786,7 +781,8 @@ impl Item {
786781 }
787782 } )
788783 . collect ( ) ;
789- if !keep_as_is
784+
785+ if !is_json
790786 && let Some ( def_id) = self . def_id ( )
791787 && let ItemType :: Struct | ItemType :: Enum | ItemType :: Union = self . type_ ( )
792788 {
You can’t perform that action at this time.
0 commit comments