-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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 types should permit arbitrary bounds #18178
Comments
I'm not sure what the deal with that snippet was when the issue was opened, but it compiles today. The compiler also correctly rejects an impl of #![feature(associated_types)]
pub trait Cancel {
fn cancel(self);
}
pub trait Foo {
type C: Cancel;
fn stuff(self) -> <Self as Foo>::C;
fn trait_doit(self) { // this method typechecks
let cancel_me = self.stuff();
cancel_me.cancel();
}
}
fn doit<F: Foo>(f: F) { // this function doesn't typecheck
let cancel_me = f.stuff();
cancel_me.cancel();
}
pub fn main() {
}
|
I'm pretty sure the fix for this landed. |
I think my grievance is #18434 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Based on my understanding of the RFC, associated types should be able to specify bounds, yet the following does not work:
The text was updated successfully, but these errors were encountered: