Skip to content

[RFC] Entry API v3: replace Entry::get with Entry::default and Entry::default_with - #22930

Merged
bors merged 3 commits into
rust-lang:masterfrom
Gankra:entry_3
Mar 27, 2015
Merged

[RFC] Entry API v3: replace Entry::get with Entry::default and Entry::default_with#22930
bors merged 3 commits into
rust-lang:masterfrom
Gankra:entry_3

Conversation

@Gankra

Copy link
Copy Markdown
Contributor

RFC pending, but this is the patch that does it.

Totally untested. Likely needs some removed imports. std::collections docs should also be updated to provide better examples.

Closes#23508

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @brson

(rust_highfive has picked a reviewer for you, use r? to override)

@Gankra
Gankraforce-pushed the entry_3 branch 3 times, most recently from d7782ad to 009f861CompareMarch 1, 2015 15:04
Comment threadsrc/libcollections/btree/map.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/self./self,

@Gankra

Copy link
Copy Markdown
ContributorAuthor

RFC posted: rust-lang/rfcs#921

All imports/typos/missed-things fixed.

@bors

bors commented Mar 7, 2015

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #23107) made this pull request unmergeable. Please resolve the merge conflicts.

@aturon

Copy link
Copy Markdown
Contributor

Note: the RFC has now been merged (with updated names)

@Gankra
Gankraforce-pushed the entry_3 branch 2 times, most recently from c9b5258 to 0c4a120CompareMarch 20, 2015 17:43
@Gankra

Copy link
Copy Markdown
ContributorAuthor

Rebased with updated names. r? @aturon

@rust-highfiverust-highfive assigned aturon and unassigned brsonMar 20, 2015
@alexcrichton

Copy link
Copy Markdown
Member

(added Closes #23508 to the description)

I'd also be fine insta-stabilizing these methods as they've been around for quite some time and we're just tweaking the naming here basically.

@Gankra

Copy link
Copy Markdown
ContributorAuthor

I'm not comfortable stabilizing these quite yet. We could go one step further and just make these methods on the Map itself, for instance.

I also see no particular urgency to stabilize them; they are pure convenience (though very convenient indeed).

@Gankra

Copy link
Copy Markdown
ContributorAuthor

Oh whoops I forgot to actually, you know, test the rebase/fix. Tidy error fixed; building now.

@aturon

Copy link
Copy Markdown
Contributor

This is really, really nice! You've done great work with Entry, @gankro.

I also agree that there's no rush to stabilize these new methods, which are more than a rename.

@aturon

Copy link
Copy Markdown
Contributor

r=me once tests are looking good locally

@Gankra

Copy link
Copy Markdown
ContributorAuthor

looks good locally (had to make one update)

Comment threadsrc/libcollections/btree/map.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or_insert?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@aturon

Copy link
Copy Markdown
Contributor

(r=me after nits)

@bors

bors commented Mar 23, 2015

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #23593) made this pull request unmergeable. Please resolve the merge conflicts.

@aturon

Copy link
Copy Markdown
Contributor

Given the proximity to beta, I'm thinking we should probably go ahead and mark these #[stable] within this PR as well. I know that this is more than a straight renaming, but I still think it's a relatively small change to the API with clear benefits, and stabilizing it now will enable a lot of ecosystem code to continue using it at beta.

Worst case, if we do find a problem, we can revise before 1.0.

@Gankra

Copy link
Copy Markdown
ContributorAuthor

I'd really like to let this sit if possible. Although empirically it seems like we've played very fast and loose with stable vs unstable so far. Is it possible to stabilize things in the beta -> stable transition?

There's still (in my mind) open questions about whether this functionality should just be on the map directly. Although I suppose we can deprecate this in favour of that quite easily.

@aturon

Copy link
Copy Markdown
Contributor

@gankro I'm happy to defer to your judgment here.

In terms of ongoing stabilization: we will be adding unstable APIs, and stabilizing existing ones, continuously. It is likely possible to stabilize a few APIs during the 1.0 beta and have those available at 1.0, but it's not entirely clear yet.

In terms of "fast and loose", I'm not sure exactly what you're referring to -- perhaps just that we've been willing to change #[stable] APIs in the past? This is entirely due to being in a pre-1.0 state, where it's been essential to use the markers to track progress in cleaning up APIs and signal preliminary confidence in them, while still retaining the freedom to change until the actual release. These kinds of changes have all but disappeared since the alpha release, though.

@Gankra

Copy link
Copy Markdown
ContributorAuthor

Easy to stabilize later; let's land this unstable for now. Can review in coming weeks, perhaps with removal of deprecated API.

@Gankra

Copy link
Copy Markdown
ContributorAuthor

@bors r=aturon

@bors

bors commented Mar 24, 2015

Copy link
Copy Markdown
Collaborator

📌 Commit d3d11b2 has been approved by aturon

@bors

bors commented Mar 24, 2015

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #23654) made this pull request unmergeable. Please resolve the merge conflicts.

@Gankra

Copy link
Copy Markdown
ContributorAuthor

Ugh what another rebase?

@Gankra

Copy link
Copy Markdown
ContributorAuthor

@bors r=aturon

@bors

bors commented Mar 27, 2015

Copy link
Copy Markdown
Collaborator

📌 Commit 1132198 has been approved by aturon

bors added a commit that referenced this pull request Mar 27, 2015
RFC pending, but this is the patch that does it.
Totally untested. Likely needs some removed imports. std::collections docs should also be updated to provide better examples.
Closes#23508
@bors

bors commented Mar 27, 2015

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 1132198 with merge 64a4e01...

@bors

bors commented Mar 27, 2015

Copy link
Copy Markdown
Collaborator

💔 Test failed - auto-linux-64-x-android-t

@Gankra

Copy link
Copy Markdown
ContributorAuthor

@bors r=aturon

@bors

bors commented Mar 27, 2015

Copy link
Copy Markdown
Collaborator

📌 Commit 1b98f6d has been approved by aturon

@bors

bors commented Mar 27, 2015

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 1b98f6d with merge 242ed0b...

bors added a commit that referenced this pull request Mar 27, 2015
RFC pending, but this is the patch that does it.
Totally untested. Likely needs some removed imports. std::collections docs should also be updated to provide better examples.
Closes#23508
@bors

bors commented Mar 27, 2015

Copy link
Copy Markdown
Collaborator

@bors
bors merged commit 1b98f6d into rust-lang:masterMar 27, 2015
lnicola pushed a commit to lnicola/rust that referenced this pull request Aug 3, 2026
…c_on_a_qualified_path_whose_trait_is_not_a_trait
fix: don't panic on a qualified path whose trait is not a trait
Sign up for freeto 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.

Tracking issue for Entry API V3

8 participants

@Gankra@rust-highfive@bors@aturon@alexcrichton@liigo@apasel422@brson