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

Associated item projections across crate boundaries slightly broken #29205

Open
ebfull opened this Issue Oct 21, 2015 · 4 comments

Comments

Projects
None yet
6 participants
@ebfull
Copy link
Contributor

ebfull commented Oct 21, 2015

pub trait Foo<T> { }
pub trait Mirror {
        type Dual;
}

pub struct Eps;

pub struct A<T, U>(T, U);
impl<T, U: Mirror> Mirror for A<T, U> { type Dual = B<T, U::Dual>; }
pub struct B<T, U>(T, U);
impl<T, U: Mirror> Mirror for B<T, U> { type Dual = A<T, U::Dual>; }

impl Mirror for Eps { type Dual = Eps; }
extern crate whatever;
use whatever::*;

struct Dummy;

impl Foo<A<Eps, B<Eps, Eps>>> for Dummy {}

// doesn't work, causes "conflicting implementations for trait `whatever::Foo`"
// impl Foo<<A<Eps, B<Eps, Eps>> as Mirror>::Dual> for Dummy {}

// works just fine
// impl Foo<B<Eps, A<Eps, Eps>>> for Dummy {}

This despite the fact that <A<Eps, B<Eps, Eps>> as Mirror>::Dual and B<Eps, A<Eps, Eps>> are the same type. It works just fine when they're in the same crate.

@brson

This comment has been minimized.

Copy link
Contributor

brson commented Mar 23, 2017

Needs repro.

@brson brson added the I-nominated label Mar 23, 2017

@brson

This comment has been minimized.

Copy link
Contributor

brson commented Mar 23, 2017

Is this a bug? P-?

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Apr 28, 2017

I agree this is a bug. I think it falls under the general category of "failure to normalize" that I expect to basically go away as part of the "chalk overhaul" (rust-lang/rust-roadmap-2017#8).

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Apr 28, 2017

triage: P-medium

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.