Skip to content

typeck::check::check_item's ItemFn handling should subst more #13140

Closed
@pnkfelix

Description

@pnkfelix
Member

Spawned off of issue #5121.

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.

Activity

nikomatsakis

nikomatsakis commented on Mar 26, 2014

@nikomatsakis
Contributor

cc me

added a commit that references this issue on Mar 26, 2014

Fix rust-lang#13140: Early/Late Bound related ICEs.

6b5ca8b
added a commit that references this issue on Mar 29, 2014

auto merge of #13157 : pnkfelix/rust/fsk-iss13140, r=nikomatsakis

b334f7c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @nikomatsakis@pnkfelix

      Issue actions

        typeck::check::check_item's ItemFn handling should subst more · Issue #13140 · rust-lang/rust