mirror of
https://github.com/servo/servo.git
synced 2025-06-18 22:34:30 +01:00
Upgrade to rustc 1.4.0-dev (cb9323ec0 2015-09-01)
This commit is contained in:
parent
ba2cb77c26
commit
40b4348824
28 changed files with 349 additions and 338 deletions
|
@ -3,9 +3,10 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use rustc::lint::{Context, LintPass, LintArray};
|
||||
use rustc::middle::def_id::DefId;
|
||||
use syntax::ast;
|
||||
use syntax::ast::Public;
|
||||
use syntax::attr::AttrMetaMethods;
|
||||
use syntax::{ast, ast_util};
|
||||
|
||||
declare_lint!(PRIVATIZE, Deny,
|
||||
"Allows to enforce private fields for struct definitions");
|
||||
|
@ -27,7 +28,7 @@ impl LintPass for PrivatizePass {
|
|||
_i: ast::Ident,
|
||||
_gen: &ast::Generics,
|
||||
id: ast::NodeId) {
|
||||
if cx.tcx.has_attr(ast_util::local_def(id), "privatize") {
|
||||
if cx.tcx.has_attr(DefId::local(id), "privatize") {
|
||||
for field in &def.fields {
|
||||
match field.node {
|
||||
ast::StructField_ { kind: ast::NamedField(ident, visibility), .. } if visibility == Public => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue