Rollup merge of #96679 - ricked-twice:issue-96223-fix, r=jackh726
Quick fix for #96223. This PR is a quick fix regarding #96223. As mentioned in the issue, others modification could be added to not elide types with bound vars from suggestions. Special thanks to ``@jackh726`` for mentoring and ``@Manishearth`` for minimal test case. r? ``@jackh726``
This commit is contained in:
commit
d0a7a4c6e6
3 changed files with 87 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 (#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