servo: Merge #7697 - Rust upgrade to rustc 1.5.0-dev (6217b002b 2015-09-21) (from servo:rustup_20150921); r=Ms2ger
Snapshot doesn't exist yet. Rust master+ should work. Also https://github.com/serde-rs/aster/pull/33 hasn't merged yet. r? @Ms2ger @larsbergstrom Source-Repo: https://github.com/servo/servo Source-Revision: f7f16870bebdc9359661544054259b37780f1331
This commit is contained in:
@@ -2,9 +2,10 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use rustc::lint::{Context, LintPass, LintArray, Level};
|
||||
use rustc::lint::{LateContext, LintPass, LintArray, Level, LateLintPass, LintContext};
|
||||
use rustc::middle::def;
|
||||
use rustc::middle::def_id::DefId;
|
||||
use rustc_front::hir;
|
||||
use syntax::ast;
|
||||
use utils::match_lang_ty;
|
||||
|
||||
@@ -21,9 +22,11 @@ impl LintPass for InheritancePass {
|
||||
fn get_lints(&self) -> LintArray {
|
||||
lint_array!(INHERITANCE_INTEGRITY)
|
||||
}
|
||||
}
|
||||
|
||||
fn check_struct_def(&mut self, cx: &Context, def: &ast::StructDef, _i: ast::Ident,
|
||||
_gen: &ast::Generics, id: ast::NodeId) {
|
||||
impl LateLintPass for InheritancePass {
|
||||
fn check_struct_def(&mut self, cx: &LateContext, def: &hir::StructDef, _i: ast::Ident,
|
||||
_gen: &hir::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(DefId::local(id), "_dom_struct_marker") {
|
||||
@@ -43,7 +46,7 @@ impl LintPass for InheritancePass {
|
||||
.map(|(_, f)| f.span);
|
||||
// Find all #[dom_struct] fields
|
||||
let dom_spans: Vec<_> = def.fields.iter().enumerate().filter_map(|(ctr, f)| {
|
||||
if let ast::TyPath(..) = f.node.ty.node {
|
||||
if let hir::TyPath(..) = f.node.ty.node {
|
||||
if let Some(&def::PathResolution { base_def: def::DefTy(def_id, _), .. }) =
|
||||
cx.tcx.def_map.borrow().get(&f.node.ty.id) {
|
||||
if cx.tcx.has_attr(def_id, "_dom_struct_marker") {
|
||||
|
||||
Reference in New Issue
Block a user