diff options
| author | Michael Goulet <michael@errs.io> | 2022-02-06 13:03:28 -0800 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-02-24 08:30:38 -0800 |
| commit | 676943a9f9a2e0b5978e9783130c7dc6a9ffb5cf (patch) | |
| tree | e976a89d4e4f4d9d19c7abde267e78edf8f0a05e | |
| parent | e390e6c46914b54ea2ffa901f3c6b046b9a7b7d4 (diff) | |
| download | rust-676943a9f9a2e0b5978e9783130c7dc6a9ffb5cf.tar.gz rust-676943a9f9a2e0b5978e9783130c7dc6a9ffb5cf.zip | |
better ObligationCause for normalization errors in can_type_implement_copy
| -rw-r--r-- | clippy_lints/src/needless_pass_by_value.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_lints/src/needless_pass_by_value.rs b/clippy_lints/src/needless_pass_by_value.rs index ebd4fb0bf51..d27e1383d01 100644 --- a/clippy_lints/src/needless_pass_by_value.rs +++ b/clippy_lints/src/needless_pass_by_value.rs @@ -199,7 +199,7 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessPassByValue { let sugg = |diag: &mut DiagnosticBuilder<'_>| { if let ty::Adt(def, ..) = ty.kind() { if let Some(span) = cx.tcx.hir().span_if_local(def.did) { - if can_type_implement_copy(cx.tcx, cx.param_env, ty).is_ok() { + if can_type_implement_copy(cx.tcx, cx.param_env, ty, traits::ObligationCause::dummy_with_span(span)).is_ok() { diag.span_help(span, "consider marking this type as `Copy`"); } } |
