-// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-use crate::rustc::hir::intravisit::FnKind;
-use crate::rustc::hir::*;
-use crate::rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
-use crate::rustc::middle::expr_use_visitor as euv;
-use crate::rustc::middle::mem_categorization as mc;
-use crate::rustc::traits;
-use crate::rustc::ty::{self, RegionKind, TypeFoldable};
-use crate::rustc::{declare_tool_lint, lint_array};
-use crate::rustc_data_structures::fx::{FxHashMap, FxHashSet};
-use crate::rustc_errors::Applicability;
-use crate::rustc_target::spec::abi::Abi;
-use crate::syntax::ast::NodeId;
-use crate::syntax::errors::DiagnosticBuilder;
-use crate::syntax_pos::Span;
use crate::utils::ptr::get_spans;
use crate::utils::{
get_trait_def_id, implements_trait, in_macro, is_copy, is_self, match_type, multispan_sugg, paths, snippet,
};
use if_chain::if_chain;
use matches::matches;
+use rustc::hir::intravisit::FnKind;
+use rustc::hir::*;
+use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
+use rustc::middle::expr_use_visitor as euv;
+use rustc::middle::mem_categorization as mc;
+use rustc::traits;
+use rustc::ty::{self, RegionKind, TypeFoldable};
+use rustc::{declare_tool_lint, lint_array};
+use rustc_data_structures::fx::{FxHashMap, FxHashSet};
+use rustc_errors::Applicability;
+use rustc_target::spec::abi::Abi;
use std::borrow::Cow;
+use syntax::ast::NodeId;
+use syntax::errors::DiagnosticBuilder;
+use syntax_pos::Span;
/// **What it does:** Checks for functions taking arguments by value, but not
/// consuming them in its
Node::Stmt(s) => {
// `let <pat> = x;`
if_chain! {
- if let StmtKind::Decl(ref decl, _) = s.node;
- if let DeclKind::Local(ref local) = decl.node;
+ if let StmtKind::Local(ref local) = s.node;
then {
self.spans_need_deref
.entry(vid)