Update to Rust 2016-03-05

This commit is contained in:
Anthony Ramine 2016-03-06 02:37:48 +01:00
parent 64fb09ca2d
commit 7c1dd54895
13 changed files with 108 additions and 113 deletions

View file

@ -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));
}
}
}