Quick fix for #96223.
This commit is contained in:
parent
e1df625306
commit
bfcd191905
3 changed files with 88 additions and 1 deletions
|
@ -866,7 +866,13 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
|
|||
return false;
|
||||
}
|
||||
|
||||
let orig_ty = old_pred.self_ty().skip_binder();
|
||||
// This is a quick fix to resolve an ICE ([issue#96223](https://github.com/rust-lang/rust/issues/96223)).
|
||||
// This change should probably be deeper.
|
||||
// As suggested by @jackh726, `mk_trait_obligation_with_new_self_ty` could take a `Binder<(TraitRef, Ty)>
|
||||
// instead of `Binder<Ty>` leading to some changes to its call places.
|
||||
let Some(orig_ty) = old_pred.self_ty().no_bound_vars() else {
|
||||
return false;
|
||||
};
|
||||
let mk_result = |new_ty| {
|
||||
let obligation =
|
||||
self.mk_trait_obligation_with_new_self_ty(param_env, old_pred, new_ty);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue