-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Consistent trait bounds for ExtractIf Debug impls #139764
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
base: master
Are you sure you want to change the base?
Conversation
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
Marking as draft until rust-lang/hashbrown#616 ends up in a |
The job Click to see the possible cause of the failure (guessed by this bot)
|
[beta] Delay `hash_extract_if` stabilization from 1.87 to 1.88 This PR is a revert of: - rust-lang#134655 for use in the event that we are unable to get rust-lang#139764 into 1.87 (current beta).
Closes #137654. Refer to that issue for a table of the 4 different impl signatures we previously had in the standard library for Debug impls of various ExtractIf iterator types.
The one we are standardizing on is the one so far only used by
alloc::collections::linked_list::ExtractIf
, which is noF: Debug
bound, noF: FnMut
bound, onlyT: Debug
bound.This PR applies the following signature changes:
I have made the following changes to bring these types into better alignment with one another.
Delete
F: Debug
bounds. These are especially problematic because Rust closures do not come with a Debug impl, rendering the impl useless.Delete
A: Debug
bounds. Allocator parameters are unstable for now, but in the future this would become an API commitment that we do not debug-print a representation of the allocator when printing an iterator.Delete
F: FnMut
bounds. Requireshashbrown
PR: Drop FnMut trait bounds from ExtractIf data structures hashbrown#616. API commitment: we commit to not doing RefCell voodoo inside ExtractIf to have some way for its Debug impl (which takes &self) to call a FnMut closure, if this is even possible.Add
T: Debug
bounds (orK
/V
), even on Debug impls that do not currently make use of them, but might in the future. Breaking change. Must backport into Rust 1.87 (current beta) or do a de-stabilization PR in beta to delay those types by one release.Render using
debug_struct
+finish_non_exhaustive
, instead ofdebug_tuple
.Do not render the entire underlying collection.
Show a "peek" field indicating the current position of the iterator.