(Re-)Implement impl_trait_in_bindings

This commit is contained in:
Michael Goulet 2024-12-11 22:18:39 +00:00
parent 1da411e750
commit d714a22e7b
45 changed files with 391 additions and 25 deletions

View file

@ -52,6 +52,12 @@ pub fn type_op_ascribe_user_type_with_span<'tcx>(
relate_mir_and_user_args(ocx, param_env, span, mir_ty, def_id, user_args)?
}
};
// Enforce any bounds that come from impl trait in bindings.
ocx.register_obligations(user_ty.bounds.iter().map(|clause| {
Obligation::new(ocx.infcx.tcx, ObligationCause::dummy_with_span(span), param_env, clause)
}));
Ok(())
}