@@ -45,21 +45,33 @@ use syntax::print::pprust;
45
45
46
46
47
47
pub fn item_signature ( item : & ast:: Item , scx : & SaveContext ) -> Option < Signature > {
48
+ if !scx. config . signatures {
49
+ return None ;
50
+ }
48
51
item. make ( 0 , None , scx) . ok ( )
49
52
}
50
53
51
54
pub fn foreign_item_signature ( item : & ast:: ForeignItem , scx : & SaveContext ) -> Option < Signature > {
55
+ if !scx. config . signatures {
56
+ return None ;
57
+ }
52
58
item. make ( 0 , None , scx) . ok ( )
53
59
}
54
60
55
61
/// Signature for a struct or tuple field declaration.
56
62
/// Does not include a trailing comma.
57
63
pub fn field_signature ( field : & ast:: StructField , scx : & SaveContext ) -> Option < Signature > {
64
+ if !scx. config . signatures {
65
+ return None ;
66
+ }
58
67
field. make ( 0 , None , scx) . ok ( )
59
68
}
60
69
61
70
/// Does not include a trailing comma.
62
71
pub fn variant_signature ( variant : & ast:: Variant , scx : & SaveContext ) -> Option < Signature > {
72
+ if !scx. config . signatures {
73
+ return None ;
74
+ }
63
75
variant. node . make ( 0 , None , scx) . ok ( )
64
76
}
65
77
@@ -68,6 +80,9 @@ pub fn method_signature(id: NodeId,
68
80
m : & ast:: MethodSig ,
69
81
scx : & SaveContext )
70
82
-> Option < Signature > {
83
+ if !scx. config . signatures {
84
+ return None ;
85
+ }
71
86
make_method_signature ( id, ident, m, scx) . ok ( )
72
87
}
73
88
@@ -77,6 +92,9 @@ pub fn assoc_const_signature(id: NodeId,
77
92
default : Option < & ast:: Expr > ,
78
93
scx : & SaveContext )
79
94
-> Option < Signature > {
95
+ if !scx. config . signatures {
96
+ return None ;
97
+ }
80
98
make_assoc_const_signature ( id, ident, ty, default, scx) . ok ( )
81
99
}
82
100
@@ -86,6 +104,9 @@ pub fn assoc_type_signature(id: NodeId,
86
104
default : Option < & ast:: Ty > ,
87
105
scx : & SaveContext )
88
106
-> Option < Signature > {
107
+ if !scx. config . signatures {
108
+ return None ;
109
+ }
89
110
make_assoc_type_signature ( id, ident, bounds, default, scx) . ok ( )
90
111
}
91
112
0 commit comments