Skip to content

Move treemap libextra to libstd - #10496

Closed
recrack wants to merge 1 commit into
rust-lang:masterfrom
recrack:move_treemap_libextra_to_libstd
Closed

recrack wants to merge 1 commit into
rust-lang:masterfrom
recrack:move_treemap_libextra_to_libstd

Conversation

@recrack

@recrack recrack commented Nov 15, 2013

Copy link
Copy Markdown

#10275

Thanks to @brson

@brson

brson commented Nov 15, 2013

Copy link
Copy Markdown
Contributor

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

@brson

brson commented Nov 15, 2013

Copy link
Copy Markdown
Contributor

Thanks @recrack!

@thestinger

Copy link
Copy Markdown
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

brson commented Nov 15, 2013

Copy link
Copy Markdown
Contributor

@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

brson commented Nov 15, 2013

Copy link
Copy Markdown
Contributor

@thestinger Thanks.

@recrack

recrack commented Nov 15, 2013

Copy link
Copy Markdown
Author

Thanks @brson @thestinger
I removed second commit.

@chris-morgan

Copy link
Copy Markdown
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
Copy Markdown
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 `_`
U007D pushed a commit to U007D/rust-mos that referenced this pull request Aug 21, 2026
10496: internal: move some macro tests r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
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.

7 participants