mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 23:24:24 +00:00
Check ADT fields for copy implementations considering regions
This commit is contained in:
parent
efb631a09c
commit
93d0f47064
1 changed files with 2 additions and 2 deletions
|
@ -24,7 +24,7 @@ use rustc_span::symbol::kw;
|
|||
use rustc_span::{sym, Span};
|
||||
use rustc_target::spec::abi::Abi;
|
||||
use rustc_trait_selection::traits;
|
||||
use rustc_trait_selection::traits::misc::can_type_implement_copy;
|
||||
use rustc_trait_selection::traits::misc::type_allowed_to_implement_copy;
|
||||
use std::borrow::Cow;
|
||||
|
||||
declare_clippy_lint! {
|
||||
|
@ -200,7 +200,7 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessPassByValue {
|
|||
let sugg = |diag: &mut Diagnostic| {
|
||||
if let ty::Adt(def, ..) = ty.kind() {
|
||||
if let Some(span) = cx.tcx.hir().span_if_local(def.did()) {
|
||||
if can_type_implement_copy(
|
||||
if type_allowed_to_implement_copy(
|
||||
cx.tcx,
|
||||
cx.param_env,
|
||||
ty,
|
||||
|
|
Loading…
Reference in a new issue