Skip to content

Commit f6f0363

Browse files
committed
Gate signatures on the config
1 parent 52e9f20 commit f6f0363

File tree

1 file changed

+21
-0
lines changed
  • src/librustc_save_analysis

1 file changed

+21
-0
lines changed

src/librustc_save_analysis/sig.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,33 @@ use syntax::print::pprust;
4545

4646

4747
pub fn item_signature(item: &ast::Item, scx: &SaveContext) -> Option<Signature> {
48+
if !scx.config.signatures {
49+
return None;
50+
}
4851
item.make(0, None, scx).ok()
4952
}
5053

5154
pub fn foreign_item_signature(item: &ast::ForeignItem, scx: &SaveContext) -> Option<Signature> {
55+
if !scx.config.signatures {
56+
return None;
57+
}
5258
item.make(0, None, scx).ok()
5359
}
5460

5561
/// Signature for a struct or tuple field declaration.
5662
/// Does not include a trailing comma.
5763
pub fn field_signature(field: &ast::StructField, scx: &SaveContext) -> Option<Signature> {
64+
if !scx.config.signatures {
65+
return None;
66+
}
5867
field.make(0, None, scx).ok()
5968
}
6069

6170
/// Does not include a trailing comma.
6271
pub fn variant_signature(variant: &ast::Variant, scx: &SaveContext) -> Option<Signature> {
72+
if !scx.config.signatures {
73+
return None;
74+
}
6375
variant.node.make(0, None, scx).ok()
6476
}
6577

@@ -68,6 +80,9 @@ pub fn method_signature(id: NodeId,
6880
m: &ast::MethodSig,
6981
scx: &SaveContext)
7082
-> Option<Signature> {
83+
if !scx.config.signatures {
84+
return None;
85+
}
7186
make_method_signature(id, ident, m, scx).ok()
7287
}
7388

@@ -77,6 +92,9 @@ pub fn assoc_const_signature(id: NodeId,
7792
default: Option<&ast::Expr>,
7893
scx: &SaveContext)
7994
-> Option<Signature> {
95+
if !scx.config.signatures {
96+
return None;
97+
}
8098
make_assoc_const_signature(id, ident, ty, default, scx).ok()
8199
}
82100

@@ -86,6 +104,9 @@ pub fn assoc_type_signature(id: NodeId,
86104
default: Option<&ast::Ty>,
87105
scx: &SaveContext)
88106
-> Option<Signature> {
107+
if !scx.config.signatures {
108+
return None;
109+
}
89110
make_assoc_type_signature(id, ident, bounds, default, scx).ok()
90111
}
91112

0 commit comments

Comments
 (0)