Skip to content

Commit

Permalink
Auto merge of rust-lang#105102 - compiler-errors:copy-impl-considerin…
Browse files Browse the repository at this point in the history
…g-regions, r=lcnr

Check ADT fields for copy implementations considering regions

Fixes rust-lang#88901
r? `@ghost`
  • Loading branch information
bors committed Jan 20, 2023
2 parents 11611b0 + 93d0f47 commit ce460dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clippy_lints/src/needless_pass_by_value.rs
Expand Up @@ -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! {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit ce460dc

Please sign in to comment.