fix(ty_utils): try normalize earsing regions#111259
fix(ty_utils): try normalize earsing regions#111259bvanjoi wants to merge 1 commit intorust-lang:masterfrom
Conversation
|
r? @cjgillot (rustbot has picked a reviewer for you, use r? to override) |
compiler-errors
left a comment
There was a problem hiding this comment.
This PR description really needs more information about:
- Why it happens
- Why this fix is correct
Thanks for your advice, I will try to add more descriptions |
|
Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri |
| impl LateLintPass<'_> for QueryStability { | ||
| fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { | ||
| let Some((span, def_id, substs)) = typeck_results_of_method_fn(cx, expr) else { return }; | ||
| let substs = cx.tcx.normalize_erasing_regions(cx.param_env, substs); |
| impl LateLintPass<'_> for Diagnostics { | ||
| fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { | ||
| let Some((span, def_id, substs)) = typeck_results_of_method_fn(cx, expr) else { return }; | ||
| let substs = cx.tcx.normalize_erasing_regions(cx.param_env, substs); |
|
@rustbot ready |
|
generic_const_exprs currently evaluates constants without their where clauses holding, resulting in us attempting to do things like this on not-wf code. I do not think this PR is the correct solution to the linked issue, we really ought to be ensuring that Unfortunately it is not possible right now to "just" check |
|
☔ The latest upstream changes (presumably #113591) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@bvanjoi any updates on this? thanks |
|
Closed this as it is invalid. |
close #110630
#105561 introduces
normalize_erasing_regionsfor thesubstsinresolve_instance, this is quite general and can apply to any type. However, it poses a problem for issue #110630, whereI as Concatwill trigger a bug becauseConcatis not implemented forI.In order to solve #110630, this PR:
substswhen necessary.substsbefore resolve duringconst_eval_resolve_for_typeck, if it failed, we will returnTooGenericerror