Skip to content

Move treemap libextra to libstd #10496

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

Closed

Conversation

recrack
Copy link
Contributor

@recrack recrack commented Nov 15, 2013

#10275

Thanks to @brson

@brson
Copy link
Contributor

brson commented Nov 15, 2013

Do we know what the tradeoffs between HashMap and TreeMap are? What's the benefit of having both?

@brson
Copy link
Contributor

brson commented Nov 15, 2013

Thanks @recrack!

@thestinger
Copy link
Contributor

@brson: TreeMap is an ordered map so you can iterate over the keys in-order or do fast range searches. The cost is that the operations are O(log n) (search) or amortized O(log n) instead of an O(1) average case (which with SipHash is a fairly strong guarantee if the universe doesn't hate you).

If we do get a nice B-tree implementation, it would likely make sense to replace this red-black tree implementation with it but the API would remain the same.

@brson
Copy link
Contributor

brson commented Nov 15, 2013

@recrack Can you remove the second commit that ignores the memory map test? I'm not sure what's happening on your machine but the bots aren't seeing that error.

@brson
Copy link
Contributor

brson commented Nov 15, 2013

@thestinger Thanks.

@recrack
Copy link
Contributor Author

recrack commented Nov 15, 2013

Thanks @brson @thestinger
I removed second commit.

@chris-morgan
Copy link
Member

The failure is genuine: when running tests, only that crate will be built with #[cfg(test)], so moving the test-only mod extra::containers::bench to std has broken extra tests, because it only has a non-test std.

@alexcrichton
Copy link
Member

Closing due to inactivity, but feel free to reopen with updates!

flip1995 pushed a commit to flip1995/rust that referenced this pull request Apr 6, 2023
fix [`cast_possible_truncation`] offering wrong suggestion for casting float to integer

fixes: rust-lang#10366

---

changelog: [`cast_possible_truncation`] Fix incorrect suggestions when casting from float types or to `_`
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

Successfully merging this pull request may close these issues.

6 participants