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

Rewrite Comparator impls to get rid of the need for old_impl_check #75

Closed
reem opened this issue Jan 9, 2015 · 10 comments
Closed

Rewrite Comparator impls to get rid of the need for old_impl_check #75

reem opened this issue Jan 9, 2015 · 10 comments

Comments

@reem
Copy link
Collaborator

reem commented Jan 9, 2015

No description provided.

@reem reem mentioned this issue Jan 9, 2015
@apasel422
Copy link
Contributor

I've been thinking about how to approach this, but it seems like the new rules will make comparators a lot more limited.

@Gankra
Copy link
Owner

Gankra commented Jan 9, 2015

@apasel422 Can you elaborate on the problems so I can pester core devs with it?

@apasel422
Copy link
Contributor

@gankro Sure, let me organize my thoughts.

@apasel422
Copy link
Contributor

@gankro I may be wrong, actually. I thought there was an issue relating to "early" vs. "late" binding of the types that a comparator can compare, but maybe not. Let me submit a PR with my proposed changes to see how it turns out.

@Gankra
Copy link
Owner

Gankra commented Jan 9, 2015

I'm currently trying to port it to associated types as well (need to learn this crap at some point)

@Gankra
Copy link
Owner

Gankra commented Jan 9, 2015

(getting walled on TreeMap's Compare<K> + Compare<Q, K> bounds @_@)

@apasel422
Copy link
Contributor

I actually don't think associated types will work in general -- in particular, I think Borrow will be impossible to write.

@Gankra
Copy link
Owner

Gankra commented Jan 9, 2015

How did a type ever satisfy these bounds anyway?

@apasel422
Copy link
Contributor

Do you mean Compare<K> + Compare<Q, K>? I don't know. It makes sense for it to be legal, but I don't know if rustc "officially" supports bounds like that yet.

In any case, see #76 for a fix.

@reem
Copy link
Collaborator Author

reem commented Jan 9, 2015

I remember there being problems with doing something like Get<A> + Get<B>, but that was a while ago so it might have been fixed/changed.

@Gankra Gankra closed this as completed in 16ffdc8 Jan 9, 2015
abonander pushed a commit to abonander/collect-rs that referenced this issue Jan 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants