1
Fork 0

better ObligationCause for normalization errors in can_type_implement_copy

This commit is contained in:
Michael Goulet 2022-02-06 13:03:28 -08:00
parent 3d127e2040
commit 8ba74369c2
8 changed files with 71 additions and 22 deletions

View file

@ -74,7 +74,8 @@ fn visit_implementation_of_copy(tcx: TyCtxt<'_>, impl_did: LocalDefId) {
debug!("visit_implementation_of_copy: self_type={:?} (free)", self_type);
match can_type_implement_copy(tcx, param_env, self_type) {
let cause = traits::ObligationCause::misc(span, impl_hir_id);
match can_type_implement_copy(tcx, param_env, self_type, cause) {
Ok(()) => {}
Err(CopyImplementationError::InfrigingFields(fields)) => {
let item = tcx.hir().expect_item(impl_did);