Make sure trait def ids match before zipping args in note_function_argument_obligation

This commit is contained in:
Michael Goulet 2024-07-15 16:43:18 -04:00
parent eb72697e41
commit 841b30f63e
4 changed files with 98 additions and 20 deletions

View file

@ -3810,6 +3810,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
{
if let Some(where_pred) = where_pred.as_trait_clause()
&& let Some(failed_pred) = failed_pred.as_trait_clause()
&& where_pred.def_id() == failed_pred.def_id()
{
self.enter_forall(where_pred, |where_pred| {
let failed_pred = self.instantiate_binder_with_fresh_vars(