File tree 1 file changed +4
-8
lines changed
1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -756,12 +756,7 @@ impl Item {
756
756
Some ( tcx. visibility ( def_id) )
757
757
}
758
758
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 > {
765
760
const ALLOWED_ATTRIBUTES : & [ Symbol ] =
766
761
& [ sym:: export_name, sym:: link_section, sym:: no_mangle, sym:: non_exhaustive] ;
767
762
@@ -772,7 +767,7 @@ impl Item {
772
767
. other_attrs
773
768
. iter ( )
774
769
. filter_map ( |attr| {
775
- if keep_as_is {
770
+ if is_json {
776
771
Some ( rustc_hir_pretty:: attribute_to_string ( & tcx, attr) )
777
772
} else if ALLOWED_ATTRIBUTES . contains ( & attr. name_or_empty ( ) ) {
778
773
Some (
@@ -786,7 +781,8 @@ impl Item {
786
781
}
787
782
} )
788
783
. collect ( ) ;
789
- if !keep_as_is
784
+
785
+ if !is_json
790
786
&& let Some ( def_id) = self . def_id ( )
791
787
&& let ItemType :: Struct | ItemType :: Enum | ItemType :: Union = self . type_ ( )
792
788
{
You can’t perform that action at this time.
0 commit comments