Skip to content

Commit 676943a

Browse files
better ObligationCause for normalization errors in can_type_implement_copy
1 parent e390e6c commit 676943a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/needless_pass_by_value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessPassByValue {
199199
let sugg = |diag: &mut DiagnosticBuilder<'_>| {
200200
if let ty::Adt(def, ..) = ty.kind() {
201201
if let Some(span) = cx.tcx.hir().span_if_local(def.did) {
202-
if can_type_implement_copy(cx.tcx, cx.param_env, ty).is_ok() {
202+
if can_type_implement_copy(cx.tcx, cx.param_env, ty, traits::ObligationCause::dummy_with_span(span)).is_ok() {
203203
diag.span_help(span, "consider marking this type as `Copy`");
204204
}
205205
}

0 commit comments

Comments
 (0)