Upgrade Rust to rustc 1.5.0-nightly (b2f379cdc 2015-09-23)

Ident was removed in many HIR structures in favor of Name.
This commit is contained in:
Pietro Monteiro 2015-09-23 17:30:39 -07:00
parent 4838e8a3b4
commit b2c66d1a0e
9 changed files with 32 additions and 32 deletions

View file

@ -173,10 +173,9 @@ impl LateLintPass for CmpOwned {
fn check_to_owned(cx: &LateContext, expr: &Expr, other_span: Span) {
match expr.node {
ExprMethodCall(Spanned{node: ref ident, ..}, _, ref args) => {
let name = ident.name;
if name == "to_string" ||
name == "to_owned" && is_str_arg(cx, args) {
ExprMethodCall(Spanned{node: ref name, ..}, _, ref args) => {
if name.as_str() == "to_string" ||
name.as_str() == "to_owned" && is_str_arg(cx, args) {
span_lint(cx, CMP_OWNED, expr.span, &format!(
"this creates an owned instance just for comparison. \
Consider using `{}.as_slice()` to compare without allocation",