-
Notifications
You must be signed in to change notification settings - Fork 18
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
Transform associated types into type parameters #532
Conversation
Linked lists are slow to iterate through; we don't need the reordering capabilities that hashlink provides.
27678ed
to
1e6e24e
Compare
5c77cc1
to
bf43b79
Compare
This is really awesome to see this finally landing, thanks a lot for this! And specifying which traits this should be applied on by using a pattern is a good design choice. I have one question: by trait Foo<'a> {
type Bar;
...
}
fn f<T>(...) where for<'a> T : Foo<'a> |
Yep exactly, because we'd have to translate that to something like fn f<T, Bar<'_>>(...) where for<'a> T : Foo<'a, Bar<'a>> which doesn't exist in rust. |
bf43b79
to
9b1ebbc
Compare
da2c626
to
9101559
Compare
9101559
to
d97f20d
Compare
d97f20d
to
41f18cb
Compare
This PR introduces a
--remove-associated-types <name pattern>
option that replaces the associated types of the selected traits and converts them into type parameters.Fixes #127.
This has 4 know limitations today:
--remove-associated-types
#531;dyn Trait
(Add support fordyn Trait
#123);T: for<'a> Trait<'a, Type = &'a ()>
(Bug:--remove-associated-types
doesn't track quantified lifetimes #534).This also has three fundamental limitations that we can't work around:
for<'a>
clauses with unconstrained associated types, for the same reason;