Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
nikomatsakis opened this issue Nov 11, 2017 · 0 comments
Closed

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

nikomatsakis opened this issue Nov 11, 2017 · 0 comments
Labels
C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@nikomatsakis
Copy link
Contributor

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.

@nikomatsakis nikomatsakis added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Nov 11, 2017
@TimNN TimNN added the C-bug Category: This is a bug. label Nov 14, 2017
nikomatsakis added a commit to nikomatsakis/rust that referenced this issue Nov 16, 2017
This revealed some shortcomings, one of which is fixed. Fixes rust-lang#45937.
nikomatsakis added a commit to nikomatsakis/rust that referenced this issue Nov 26, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
This revealed some shortcomings, one of which is fixed. Fixes rust-lang#45937.
nikomatsakis added a commit to nikomatsakis/rust that referenced this issue Nov 27, 2017
This revealed some shortcomings, one of which is fixed. Fixes rust-lang#45937.
nikomatsakis added a commit to nikomatsakis/rust that referenced this issue Dec 2, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
This revealed some shortcomings, one of which is fixed. Fixes rust-lang#45937.
@bors bors closed this as completed in 5562663 Dec 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants