Auto merge of #105102 - compiler-errors:copy-impl-considering-regions, r=lcnr
Check ADT fields for copy implementations considering regions Fixes #88901 r? `@ghost`
This commit is contained in:
commit
ce460dcd14
@ -24,7 +24,7 @@
|
||||
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 @@ fn check_fn(
|
||||
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 New Issue
Block a user