Upgrade to rustc 1.4.0-dev (cb9323ec0 2015-09-01)

This commit is contained in:
Simon Sapin 2015-09-02 07:57:55 +02:00
parent ba2cb77c26
commit 40b4348824
28 changed files with 349 additions and 338 deletions

View file

@ -4,7 +4,8 @@
use rustc::lint::{Context, LintPass, LintArray, Level};
use rustc::middle::def;
use syntax::{ast, ast_util};
use rustc::middle::def_id::DefId;
use syntax::ast;
use utils::match_lang_ty;
@ -26,7 +27,7 @@ impl LintPass for InheritancePass {
_gen: &ast::Generics, id: ast::NodeId) {
// Lints are run post expansion, so it's fine to use
// #[_dom_struct_marker] here without also checking for #[dom_struct]
if cx.tcx.has_attr(ast_util::local_def(id), "_dom_struct_marker") {
if cx.tcx.has_attr(DefId::local(id), "_dom_struct_marker") {
// Find the reflector, if any
let reflector_span = def.fields.iter().enumerate()
.find(|&(ctr, f)| {

View file

@ -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 => {

View file

@ -120,14 +120,14 @@ impl LintPass for UnrootedPass {
fn check_fn(&mut self, cx: &Context, kind: visit::FnKind, decl: &ast::FnDecl,
block: &ast::Block, _span: codemap::Span, id: ast::NodeId) {
match kind {
visit::FkItemFn(i, _, _, _, _, _) |
visit::FkMethod(i, _, _) if i.name.as_str() == "new"
|| i.name.as_str() == "new_inherited"
|| i.name.as_str() == "new_initialized" => {
visit::FnKind::ItemFn(i, _, _, _, _, _) |
visit::FnKind::Method(i, _, _) if i.name.as_str() == "new"
|| i.name.as_str() == "new_inherited"
|| i.name.as_str() == "new_initialized" => {
self.in_new_function = true;
return;
},
visit::FkItemFn(_, _, style, _, _, _) => match style {
visit::FnKind::ItemFn(_, _, style, _, _, _) => match style {
ast::Unsafety::Unsafe => return,
_ => ()
},