You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The concrete problem that we are encountering is that the type fn_tpt.ty extracted by check_item still has formal generic parameters in it (e.g. so-called EarlyBound lifetimes) that should have been replaced with concrete types (such as unification variables, so-called Free lifetimes).
The solution in several of these instances is that typeck::check::check_itemhandling of ItemFn should subst more, in the same manner as done in check_method_body.
That, or the substitution should be moved into the common control paths that are shared between check_item and check_method_body, e.g. check_bare_fn or perhaps check_fn.
(See also #13139 for the bug to try to safe-guard against future occurrences of this bug.)
Aside: Normally I would have just repurposed #5121 for this task, but local experimentation has shown that fixing this problem will not solve all of the ICE's nor all of the instances of unsoundness that are linked on #5121. So I am trying to track which issues are resolved and which remain unresolved by filing a separate issue and then checking off checkboxes accordingly.
The text was updated successfully, but these errors were encountered:
r? @nikomatsakisFix#13140
Includes two fixes, and a semi-thorough regression test.
(There is another set of tests that I linked from #5121, but those are sort of all over the place, while the ones I've included here are more directly focused on the issues at hand.)
Spawned off of issue #5121.
The concrete problem that we are encountering is that the type
fn_tpt.ty
extracted bycheck_item
still has formal generic parameters in it (e.g. so-called EarlyBound lifetimes) that should have been replaced with concrete types (such as unification variables, so-called Free lifetimes).The solution in several of these instances is that
typeck::check::check_item
handling ofItemFn
should subst more, in the same manner as done incheck_method_body
.That, or the substitution should be moved into the common control paths that are shared between
check_item
andcheck_method_body
, e.g.check_bare_fn
or perhapscheck_fn
.(See also #13139 for the bug to try to safe-guard against future occurrences of this bug.)
Aside: Normally I would have just repurposed #5121 for this task, but local experimentation has shown that fixing this problem will not solve all of the ICE's nor all of the instances of unsoundness that are linked on #5121. So I am trying to track which issues are resolved and which remain unresolved by filing a separate issue and then checking off checkboxes accordingly.
The text was updated successfully, but these errors were encountered: