-
Notifications
You must be signed in to change notification settings - Fork 13.4k
pretty print BTreeSet #53112
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
pretty print BTreeSet #53112
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
Do we have any sort of tests for this code? cc @michaelwoerister @tromey |
Also .. I'm probably not the best reviewer here ... one of you two care to pick this up? |
I found I should write test here. https://github.com/rust-lang/rust/blob/4ecf12bf0eb8386626ccdb5f721a7183ccc4eba6/src/test/debuginfo/pretty-std.rs |
@nikomatsakis, I'll take it.
@fukatani, yes, that would be great. I don't know why this test is ignored at the moment. |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@michaelwoerister Could you review this PR? |
Thanks a lot, @fukatani! Looks great. I'm wondering though if Also, to make things more consistent with the other collection printers, could you make it |
Current PR behavior is the same as #include <set>
int main() {
std::set<int> map;
map.insert(5);
map.insert(6);
return 0;
}
I agree that it's a bit redundant. |
So far we have not made any effort to match C++'s pretty printers. I'd rather have the Rust pretty printers be consistent among each other. |
FWIW the libstdc++ |
@michaelwoerister |
📌 Commit 6e562d2 has been approved by |
…ichaelwoerister pretty print BTreeSet I want pretty printing for BTreeSet. ```rust use std::collections::*; fn main() { let mut s = BTreeSet::new(); s.insert(5); s.insert(3); s.insert(7); s.remove(&3); println!("{:?}", s); } ``` ``` (gdb) b 9 (gdb) p s $1 = BTreeSet<i32> with 2 elements = {[0] = 5, [1] = 7} ``` This is analogy of pretty printing for C++ std::set.
Rollup of 11 pull requests Successful merges: - #53112 (pretty print BTreeSet) - #53208 (Don't panic on std::env::vars() when env is null.) - #53226 (driver: set the syntax edition in phase 1) - #53229 (Make sure rlimit is only ever increased) - #53233 (targets: aarch64: Add bare-metal aarch64 target) - #53239 (rustc_codegen_llvm: Restore the closure env alloca hack for LLVM 5.) - #53246 (A few cleanups) - #53257 (Idiomatic improvements to IP method) - #53274 (Remove statics field from CodegenCx) - #53290 (Make LLVM emit assembly comments with -Z asm-comments) - #53317 (Mark prior failure to avoid ICE)
…ichaelwoerister Pretty print btreemap for GDB Merge rust-lang#53112 first, please.
I want pretty printing for BTreeSet.
This is analogy of pretty printing for C++ std::set.