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

Problem with lexical_ordering deprecation #16018

Closed
brson opened this issue Jul 26, 2014 · 4 comments
Closed

Problem with lexical_ordering deprecation #16018

brson opened this issue Jul 26, 2014 · 4 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@brson
Copy link
Contributor

brson commented Jul 26, 2014

The deprecation note says "Just call .cmp() on an Ordering" but is misleading.

16:52 < Dr-Emann> brson: If you have 2 Ords to compare to 2 other Ords, you can use (a1, b1).cmp(&(a2, b2)). If you only have 2 Orderings, you can write out the match that 
                  lexical_ordering contains, or use (o1, o2).cmp(&(Equal, Equal)). (but that's pretty unintuitive)
16:52 < Dr-Emann> Either way, the deprecation note should be changed. (or removed. I kinda like having that as a convenience function.)
@huonw
Copy link
Member

huonw commented Jul 27, 2014

Fwiw I think it was normally used like lexical_ordering(a1.cmp(&a2), b1.cmp(&b2)) where the as and bs are arbitrary Ord types. The replacement for that is (a1, b1).cmp(&(a2, b2)). (That said, the message is still unhelpful, maybe it should say "tuple" instead of "ordering".)

@aturon
Copy link
Member

aturon commented Jul 27, 2014

cc me.

@treeman
Copy link
Contributor

treeman commented Aug 29, 2014

Deprecation comment fixed by PR #16104.

@alexcrichton
Copy link
Member

Thanks!

bors added a commit to rust-lang-ci/rust that referenced this issue Dec 11, 2023
minor: Disable debuginfo again

I suspect this wasn't intentional, right?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

5 participants