Skip to content

normalizing parameter environments uses an empty free-region-map #45937

Closed
@nikomatsakis

Description

@nikomatsakis

The following program gets a (spurious) region error (E0495):

trait Project<'a, 'b> {
    type Item;
}

impl<'a, 'b> Project<'a, 'b> for ()
where 'a: 'b
{
    type Item = ();
}

fn foo<'a: 'b, 'b>()
where <() as Project<'a, 'b>>::Item : Eq
{
}

fn main() { }

The cause for this problem, I believe, is that during the normalize environment phase we use an empty FreeRegionMap, and thus do not let the region inferencer does not know that 'a: 'b holds.

I have a fix on a local branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions