aboutsummaryrefslogtreecommitdiffstats
path: root/components/plugins/lints/privatize.rs
diff options
context:
space:
mode:
authorLars Bergstrom <lars@lars.com>2015-10-02 13:50:11 -0500
committerLars Bergstrom <lars@lars.com>2015-10-02 13:50:11 -0500
commit48b3259c902e77d21057fb6bcbf2da11bfd46212 (patch)
tree0420caed3a289f39b3bb60e2e5623ae6d9e42c52 /components/plugins/lints/privatize.rs
parentba2714f4f607da77bd7200f88cfa16c1d10da9cd (diff)
downloadservo-48b3259c902e77d21057fb6bcbf2da11bfd46212.tar.gz
servo-48b3259c902e77d21057fb6bcbf2da11bfd46212.zip
Rust upgrade to nightly 20151002
Diffstat (limited to 'components/plugins/lints/privatize.rs')
-rw-r--r--components/plugins/lints/privatize.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/components/plugins/lints/privatize.rs b/components/plugins/lints/privatize.rs
index 07e5b903553..cf3d933c010 100644
--- a/components/plugins/lints/privatize.rs
+++ b/components/plugins/lints/privatize.rs
@@ -3,7 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use rustc::lint::{LateContext, LintPass, LintArray, LateLintPass, LintContext};
-use rustc::middle::def_id::DefId;
use rustc_front::hir;
use syntax::ast;
use syntax::attr::AttrMetaMethods;
@@ -27,16 +26,16 @@ impl LateLintPass for PrivatizePass {
fn check_struct_def(&mut self,
cx: &LateContext,
def: &hir::StructDef,
- _i: ast::Ident,
+ _n: ast::Name,
_gen: &hir::Generics,
id: ast::NodeId) {
- if cx.tcx.has_attr(DefId::local(id), "privatize") {
+ 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(ident, visibility), .. } if visibility == hir::Public => {
+ 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",
- ident.name));
+ name));
}
_ => {}
}