-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Implement low-hanging fruit of collection conventions #18605
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
Conversation
Rebased from merge conflict. Note to self: handle @thestinger's notes about future semantics of |
Really great work @gankro! I just left a few minor comments, r=me after those and a squash. |
5600b71
to
8a02137
Compare
Rebased. |
171aa8d
to
2be71db
Compare
@gankro Needs moar rebase |
👿 |
Still working on resolving the like a million check errors acrichto found. |
There were so many flaws with my previous two commits that I just made a third separate patch to handle them all. Most of of it is just fixing method names, but there were legit bugs in VecMap and EnumSet. I also uncovered that the old impls of Evidently if you happen to have I'm still checking these changes (this is like my 10th rebuild), but I'm optimistic. Last failure was in the shootouts. I guess I'll have to rebuild again to confirm my rebase is correct. |
@gankro Wow, this is turning out to be quite the adventure :-) Thanks for the hard work getting this out, let me know when it's good to go! |
Made it into check-formatting. You can definitely start reviewing the third commit now. Will need to re-run everything again to confirm the rebase, though (shouldn't be a problem, the conflict was just a doc cleanup-- but someone might have added some more collections-using code in librustc). |
Oops, missed a HEAD. |
Yuck, now they're all throughout my history. sigh I can rebase this into a sane state if you want. But the sum of the patches seems right. Checking... |
|
* Renames/deprecates the simplest and most obvious methods * Adds FIXME(conventions)s for outstanding work * Marks "handled" methods as unstable NOTE: the semantics of reserve and reserve_exact have changed! Other methods have had their semantics changed as well, but in a way that should obviously not typecheck if used incorrectly. Lots of work and breakage to come, but this handles most of the core APIs and most eggregious breakage. Future changes should *mostly* focus on niche collections, APIs, or simply back-compat additions. [breaking-change]
All passed! 🌴 |
/// Returns `true` if this `EnumSet` is included in the given `EnumSet`. | ||
#[unstable = "matches collection reform specification, waiting for dust to settle"] | ||
pub fn is_subset(&self, other: &EnumSet<E>) -> bool { | ||
other.is_subset(self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn’t this infinite recursion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure is!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SimonSapin sent a patch to @alexcrichton for the rollup, thanks!
fix: Fixed another bug with glob imports
Implement low-hanging fruit of collection conventions
Renames/deprecates the simplest and most obvious methods
Adds FIXME(conventions)s for outstanding work
Marks "handled" methods as unstable
NOTE: the semantics of reserve and reserve_exact have changed!
Other methods have had their semantics changed as well, but in a
way that should obviously not typecheck if used incorrectly.
Lots of work and breakage to come, but this handles most of the core
APIs and most eggregious breakage. Future changes should mostly focus on
niche collections, APIs, or simply back-compat additions.
[breaking-change]
r? @aturon