aboutsummaryrefslogtreecommitdiffstats
path: root/components/plugins/lints/privatize.rs
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2016-03-06 02:37:48 +0100
committerAnthony Ramine <n.oxyde@gmail.com>2016-03-06 10:36:49 +0100
commit7c1dd54895032ece871d6ec727fbd643b8214331 (patch)
treef59cff6ef1c934e874f4109d9524b9602e30b3f2 /components/plugins/lints/privatize.rs
parent64fb09ca2d5d077b4d3e0815ee3e094f67b7cf4e (diff)
downloadservo-7c1dd54895032ece871d6ec727fbd643b8214331.tar.gz
servo-7c1dd54895032ece871d6ec727fbd643b8214331.zip
Update to Rust 2016-03-05
Diffstat (limited to 'components/plugins/lints/privatize.rs')
-rw-r--r--components/plugins/lints/privatize.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/components/plugins/lints/privatize.rs b/components/plugins/lints/privatize.rs
index 704edcdaeda..e02c5b09212 100644
--- a/components/plugins/lints/privatize.rs
+++ b/components/plugins/lints/privatize.rs
@@ -31,13 +31,10 @@ impl LateLintPass for PrivatizePass {
id: ast::NodeId) {
if cx.tcx.has_attr(cx.tcx.map.local_def_id(id), "privatize") {
for field in def.fields() {
- match field.node {
- hir::StructField_ { kind: hir::NamedField(name, visibility), .. } if visibility == hir::Public => {
- cx.span_lint(PRIVATIZE, field.span,
- &format!("Field {} is public where only private fields are allowed",
- name));
- }
- _ => {}
+ if field.vis == hir::Public {
+ cx.span_lint(PRIVATIZE, field.span,
+ &format!("Field {} is public where only private fields are allowed",
+ field.name));
}
}
}