rustup to 1.5.0-nightly (7bf4c885f 2015-09-26)

fixes #348
This commit is contained in:
Manish Goregaokar
2015-09-28 10:34:06 +05:30
parent b749d832cc
commit 15e3774cb4
7 changed files with 24 additions and 22 deletions

View File

@@ -36,7 +36,7 @@ pub fn in_external_macro<T: LintContext>(cx: &T, span: Span) -> bool {
opt_info.map_or(false, |info| {
match info.callee.format {
ExpnFormat::CompilerExpansion(..) => {
if info.callee.name() == "closure expansion" {
if info.callee.name().as_str() == "closure expansion" {
return false;
}
},
@@ -66,7 +66,8 @@ pub fn in_external_macro<T: LintContext>(cx: &T, span: Span) -> bool {
/// usage e.g. with
/// `match_def_path(cx, id, &["core", "option", "Option"])`
pub fn match_def_path(cx: &LateContext, def_id: DefId, path: &[&str]) -> bool {
cx.tcx.with_path(def_id, |iter| iter.zip(path).all(|(nm, p)| nm.name() == p))
cx.tcx.with_path(def_id, |iter| iter.zip(path)
.all(|(nm, p)| nm.name().as_str() == *p))
}
/// check if type is struct or enum type with given def path
@@ -98,7 +99,7 @@ pub fn match_trait_method(cx: &LateContext, expr: &Expr, path: &[&str]) -> bool
/// `match_path(path, &["std", "rt", "begin_unwind"])`
pub fn match_path(path: &Path, segments: &[&str]) -> bool {
path.segments.iter().rev().zip(segments.iter().rev()).all(
|(a, b)| &a.identifier.name == b)
|(a, b)| a.identifier.name.as_str() == *b)
}
/// get the name of the item the expression is in, if available