Remove some fields from ObligationCauseCode
This commit is contained in:
parent
7276a6a117
commit
9734c03524
9 changed files with 29 additions and 62 deletions
|
@ -266,19 +266,16 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
|
|||
}
|
||||
}
|
||||
if let ObligationCauseCode::CompareImplMethodObligation {
|
||||
item_name,
|
||||
impl_item_def_id,
|
||||
trait_item_def_id,
|
||||
}
|
||||
| ObligationCauseCode::CompareImplTypeObligation {
|
||||
item_name,
|
||||
impl_item_def_id,
|
||||
trait_item_def_id,
|
||||
} = obligation.cause.code
|
||||
{
|
||||
self.report_extra_impl_obligation(
|
||||
span,
|
||||
item_name,
|
||||
impl_item_def_id,
|
||||
trait_item_def_id,
|
||||
&format!("`{}`", obligation.predicate),
|
||||
|
|
|
@ -2354,11 +2354,8 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
|
|||
)
|
||||
});
|
||||
}
|
||||
ObligationCauseCode::CompareImplMethodObligation {
|
||||
item_name,
|
||||
trait_item_def_id,
|
||||
..
|
||||
} => {
|
||||
ObligationCauseCode::CompareImplMethodObligation { trait_item_def_id, .. } => {
|
||||
let item_name = self.tcx.item_name(trait_item_def_id);
|
||||
let msg = format!(
|
||||
"the requirement `{}` appears on the impl method `{}` but not on the \
|
||||
corresponding trait method",
|
||||
|
@ -2383,9 +2380,8 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
|
|||
}
|
||||
err.span_note(assoc_span, &msg);
|
||||
}
|
||||
ObligationCauseCode::CompareImplTypeObligation {
|
||||
item_name, trait_item_def_id, ..
|
||||
} => {
|
||||
ObligationCauseCode::CompareImplTypeObligation { trait_item_def_id, .. } => {
|
||||
let item_name = self.tcx.item_name(trait_item_def_id);
|
||||
let msg = format!(
|
||||
"the requirement `{}` appears on the associated impl type `{}` but not on the \
|
||||
corresponding associated trait type",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue