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

Normalization of projections in trait bounds on associated types #20775

Open
nikomatsakis opened this issue Jan 8, 2015 · 3 comments
Open

Normalization of projections in trait bounds on associated types #20775

nikomatsakis opened this issue Jan 8, 2015 · 3 comments
Assignees
Labels
A-associated-items Area: Associated items (types, constants & functions) 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

Related to #20765 we should do more normalization in order for this test to pass:

// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// Test where the bounds in the trait use projections rather than the
// canonical form.

trait Foo
{
    type T;
}

trait Bar<A:Foo<T=B>,B>
{
    type F : Baz<A::T>;
}

trait Baz<A> { }

fn foo<I:Bar<J,K>,J,K>()
{
    // Based on trait, we can conclude that
    //    I::F : Baz<J::T>
    // and
    //    J::T == K
    // hence
    //    I::F : Baz<K>
    // which is what `bar` expects.
    bar::<I::F,K>()
}

fn bar<IF, K>()
    where IF : Baz<K>
{
}

fn main ()
{
}
@nikomatsakis nikomatsakis self-assigned this Jan 8, 2015
@nikomatsakis nikomatsakis added the A-associated-items Area: Associated items (types, constants & functions) label Jan 8, 2015
@steveklabnik
Copy link
Member

Triage: test still fails.

@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 22, 2017
@steveklabnik
Copy link
Member

Triage: still fails

@jonas-schievink jonas-schievink added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jun 13, 2019
@vandenheuvel
Copy link
Contributor

Still fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-associated-items Area: Associated items (types, constants & functions) 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

5 participants