X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=clippy_lints%2Fsrc%2Fescape.rs;h=3581ab41906f414f26e97311c5d8360c2c855f21;hb=5491c802c2f6b71070268310644577dd00726fa9;hp=f8ef2a464d5c31aa929ce65aba6a53f64307f92d;hpb=a149f61244738d82769fe226b0f7a812eae5e0c0;p=rust.git diff --git a/clippy_lints/src/escape.rs b/clippy_lints/src/escape.rs index f8ef2a464d5..3581ab41906 100644 --- a/clippy_lints/src/escape.rs +++ b/clippy_lints/src/escape.rs @@ -1,7 +1,10 @@ +use clippy_utils::diagnostics::span_lint; +use clippy_utils::ty::contains_ty; use rustc_hir::intravisit; use rustc_hir::{self, AssocItemKind, Body, FnDecl, HirId, HirIdSet, Impl, ItemKind, Node}; use rustc_infer::infer::TyCtxtInferExt; use rustc_lint::{LateContext, LateLintPass}; +use rustc_middle::mir::FakeReadCause; use rustc_middle::ty::{self, TraitRef, Ty}; use rustc_session::{declare_tool_lint, impl_lint_pass}; use rustc_span::source_map::Span; @@ -10,8 +13,6 @@ use rustc_target::spec::abi::Abi; use rustc_typeck::expr_use_visitor::{ConsumeMode, Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId}; -use crate::utils::{contains_ty, span_lint}; - #[derive(Copy, Clone)] pub struct BoxedLocal { pub too_large_for_stack: u64, @@ -184,6 +185,8 @@ fn mutate(&mut self, cmt: &PlaceWithHirId<'tcx>, _: HirId) { } } } + + fn fake_read(&mut self, _: rustc_typeck::expr_use_visitor::Place<'tcx>, _: FakeReadCause, _: HirId) {} } impl<'a, 'tcx> EscapeDelegate<'a, 'tcx> {