@@ -10,9 +10,9 @@ use crate::bindgen::config::{Config, Language};
1010use crate :: bindgen:: declarationtyperesolver:: DeclarationTypeResolver ;
1111use crate :: bindgen:: dependencies:: Dependencies ;
1212use crate :: bindgen:: ir:: {
13- AnnotationSet , AnnotationValue , Cfg , ConditionWrite , Documentation , Field , GenericArgument ,
14- GenericParams , GenericPath , Item , ItemContainer , Literal , Path , Repr , ReprStyle , Struct ,
15- ToCondition , Type ,
13+ AnnotationSet , AnnotationValue , Cfg , ConditionWrite , DeprecatedNoteKind , Documentation , Field ,
14+ GenericArgument , GenericParams , GenericPath , Item , ItemContainer , Literal , Path , Repr ,
15+ ReprStyle , Struct , ToCondition , Type ,
1616} ;
1717use crate :: bindgen:: library:: Library ;
1818use crate :: bindgen:: mangle;
@@ -754,14 +754,11 @@ impl Enum {
754754 // If we need to specify size, then we have no choice but to create a typedef,
755755 // so `config.style` is not respected.
756756 write ! ( out, "enum" ) ;
757- if let Some ( note) = self . annotations . deprecated_note ( config) {
758- if let Some ( note) = self . annotations . format_deprecated_note (
759- config. enumeration . deprecated . as_deref ( ) ,
760- config. enumeration . deprecated_with_note . as_deref ( ) ,
761- note,
762- ) {
763- write ! ( out, " {}" , note) ;
764- }
757+ if let Some ( note) = self
758+ . annotations
759+ . deprecated_note ( config, DeprecatedNoteKind :: Enum )
760+ {
761+ write ! ( out, " {}" , note) ;
765762 }
766763 write ! ( out, " {}" , tag_name) ;
767764
@@ -779,14 +776,11 @@ impl Enum {
779776 out. write ( "typedef " ) ;
780777 }
781778 out. write ( "enum" ) ;
782- if let Some ( note) = self . annotations . deprecated_note ( config) {
783- if let Some ( note) = self . annotations . format_deprecated_note (
784- config. enumeration . deprecated . as_deref ( ) ,
785- config. enumeration . deprecated_with_note . as_deref ( ) ,
786- note,
787- ) {
788- write ! ( out, " {}" , note) ;
789- }
779+ if let Some ( note) = self
780+ . annotations
781+ . deprecated_note ( config, DeprecatedNoteKind :: Enum )
782+ {
783+ write ! ( out, " {}" , note) ;
790784 }
791785 if config. style . generate_tag ( ) {
792786 write ! ( out, " {}" , tag_name) ;
@@ -806,14 +800,11 @@ impl Enum {
806800 }
807801 }
808802
809- if let Some ( note) = self . annotations . deprecated_note ( config) {
810- if let Some ( note) = self . annotations . format_deprecated_note (
811- config. structure . deprecated . as_deref ( ) ,
812- config. structure . deprecated_with_note . as_deref ( ) ,
813- note,
814- ) {
815- write ! ( out, " {}" , note) ;
816- }
803+ if let Some ( note) = self
804+ . annotations
805+ . deprecated_note ( config, DeprecatedNoteKind :: Enum )
806+ {
807+ write ! ( out, " {}" , note) ;
817808 }
818809
819810 write ! ( out, " {}" , tag_name) ;
@@ -894,14 +885,11 @@ impl Enum {
894885 }
895886 }
896887
897- if let Some ( note) = self . annotations . deprecated_note ( config) {
898- if let Some ( note) = self . annotations . format_deprecated_note (
899- config. enumeration . deprecated . as_deref ( ) ,
900- config. enumeration . deprecated_with_note . as_deref ( ) ,
901- note,
902- ) {
903- write ! ( out, " {} " , note) ;
904- }
888+ if let Some ( note) = self
889+ . annotations
890+ . deprecated_note ( config, DeprecatedNoteKind :: Struct )
891+ {
892+ write ! ( out, " {} " , note) ;
905893 }
906894
907895 if config. language != Language :: C || config. style . generate_tag ( ) {
0 commit comments