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 struct bounds #19632

Closed
sfackler opened this issue Dec 8, 2014 · 4 comments · Fixed by #20404
Closed

Traits with associated types break in struct bounds #19632

sfackler opened this issue Dec 8, 2014 · 4 comments · Fixed by #20404
Labels
A-associated-items Area: Associated items such as associated types and consts. E-needs-test Call for participation: Writing correctness tests.

Comments

@sfackler
Copy link
Member

sfackler commented Dec 8, 2014

#![feature(associated_types)]

trait PoolManager {
    type C;
}

struct InnerPool<M: PoolManager> {
    manager: M,
}

fn main() {}
test.rs:7:21: 7:32 error: no suitable bound on `<generic #0>`
test.rs:7 struct InnerPool<M: PoolManager> {
                              ^~~~~~~~~~~
error: aborting due to previous error
@sfackler sfackler added the A-associated-items Area: Associated items such as associated types and consts. label Dec 8, 2014
@kinghajj
Copy link

I've just run into this issue while attempting to improve an API. Has any progress been made on it yet?

@dylanmckay
Copy link
Contributor

I've also now run into this issue.

@dylanede
Copy link
Contributor

Got this issue as well. A fix would be appreciated as it would allow my library to remove a significant amount of redundant code.

@sfackler
Copy link
Member Author

sfackler commented Jan 1, 2015

This appears to be fixed now.

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. E-needs-test Call for participation: Writing correctness tests.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants