better ObligationCause for normalization errors in can_type_implement_copy
This commit is contained in:
parent
3d127e2040
commit
8ba74369c2
8 changed files with 71 additions and 22 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue