mirror of
https://github.com/servo/servo
synced 2026-05-11 17:37:21 +02:00
Upgrade to rustc 1.29.0-nightly (e06c87544 2018-07-06)
This commit is contained in:
@@ -7,7 +7,7 @@ use rustc::hir::intravisit as visit;
|
||||
use rustc::hir::map as ast_map;
|
||||
use rustc::lint::{LateContext, LintPass, LintArray, LateLintPass, LintContext};
|
||||
use rustc::ty;
|
||||
use syntax::{ast, codemap};
|
||||
use syntax::{ast, codemap, symbol::Ident};
|
||||
use utils::{match_def_path, in_derive_expn};
|
||||
|
||||
declare_lint!(UNROOTED_MUST_ROOT, Deny,
|
||||
@@ -133,8 +133,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass {
|
||||
span: codemap::Span,
|
||||
id: ast::NodeId) {
|
||||
let in_new_function = match kind {
|
||||
visit::FnKind::ItemFn(n, _, _, _, _, _, _) |
|
||||
visit::FnKind::Method(n, _, _, _) => {
|
||||
visit::FnKind::ItemFn(n, _, _, _, _) |
|
||||
visit::FnKind::Method(Ident { name: n, .. }, _, _, _) => {
|
||||
&*n.as_str() == "new" || n.as_str().starts_with("new_")
|
||||
}
|
||||
visit::FnKind::Closure(_) => return,
|
||||
|
||||
@@ -30,7 +30,7 @@ pub fn match_def_path(cx: &LateContext, def_id: DefId, path: &[&str]) -> bool {
|
||||
|
||||
pub fn in_derive_expn(span: Span) -> bool {
|
||||
if let Some(i) = span.ctxt().outer().expn_info() {
|
||||
if let ExpnFormat::MacroAttribute(n) = i.callee.format {
|
||||
if let ExpnFormat::MacroAttribute(n) = i.format {
|
||||
n.as_str().contains("derive")
|
||||
} else {
|
||||
false
|
||||
|
||||
Reference in New Issue
Block a user