mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-25 20:07:21 +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_span::{sym, Span};
|
||||||
use rustc_target::spec::abi::Abi;
|
use rustc_target::spec::abi::Abi;
|
||||||
use rustc_trait_selection::traits;
|
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;
|
use std::borrow::Cow;
|
||||||
|
|
||||||
declare_clippy_lint! {
|
declare_clippy_lint! {
|
||||||
|
@ -200,7 +200,7 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessPassByValue {
|
||||||
let sugg = |diag: &mut Diagnostic| {
|
let sugg = |diag: &mut Diagnostic| {
|
||||||
if let ty::Adt(def, ..) = ty.kind() {
|
if let ty::Adt(def, ..) = ty.kind() {
|
||||||
if let Some(span) = cx.tcx.hir().span_if_local(def.did()) {
|
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.tcx,
|
||||||
cx.param_env,
|
cx.param_env,
|
||||||
ty,
|
ty,
|
||||||
|
|
Loading…
Add table
Reference in a new issue