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

Traits with associated types break in where clauses on impl items #19631

Closed
sfackler opened this issue Dec 8, 2014 · 1 comment · Fixed by #20404
Closed

Traits with associated types break in where clauses on impl items #19631

sfackler opened this issue Dec 8, 2014 · 1 comment · Fixed by #20404
Labels
A-associated-items Area: Associated items such as associated types and consts.

Comments

@sfackler
Copy link
Member

sfackler commented Dec 8, 2014

#![feature(associated_types)]

trait PoolManager {
    type C;
}

struct InnerPool<M> {
    manager: M,
}

impl<M> InnerPool<M> where M: PoolManager {}

fn main() {}
test.rs:11:31: 11:42 error: no suitable bound on `<generic #0>`
test.rs:11 impl<M> InnerPool<M> where M: PoolManager {}
                                         ^~~~~~~~~~~
error: aborting due to previous error

Moving the bounds to the old style allows it to compile.

@sfackler sfackler added the A-associated-items Area: Associated items such as associated types and consts. label Dec 8, 2014
@jroesch
Copy link
Member

jroesch commented Dec 23, 2014

This seems to be an issue with where clauses, the error has morphed into:

rust/test3.rs:11:31: 11:42 error: associated types may not be referenced here
rust/test3.rs:11 impl<M> InnerPool<M> where M: PoolManager {}

I will track this as part of where clause clean up.

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 such as associated types and consts.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants