Update imports and rustup

This commit is contained in:
Oliver Schneider
2018-08-28 13:13:42 +02:00
parent b001ab33fe
commit d99cea0f16
111 changed files with 164 additions and 159 deletions

View File

@@ -2,7 +2,7 @@ use crate::reexport::*;
use matches::matches;
use rustc::hir::*;
use rustc::hir::intravisit::FnKind;
use rustc::lint::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use if_chain::if_chain;
use rustc::ty;
@@ -522,7 +522,7 @@ fn check_to_owned(cx: &LateContext<'_, '_>, expr: &Expr, other: &Expr) {
let parent_fn = cx.tcx.hir.get_parent(expr.id);
let parent_impl = cx.tcx.hir.get_parent(parent_fn);
if parent_impl != CRATE_NODE_ID {
if let map::NodeItem(item) = cx.tcx.hir.get(parent_impl) {
if let Node::Item(item) = cx.tcx.hir.get(parent_impl) {
if let ItemKind::Impl(.., Some(ref trait_ref), _, _) = item.node {
if trait_ref.path.def.def_id() == partial_eq_trait_id {
// we are implementing PartialEq, don't suggest not doing `to_owned`, otherwise