Skip to content

Conversation

Kivooeo
Copy link
Member

@Kivooeo Kivooeo commented Aug 3, 2025

This stabilises btree_map::VacantEntry::insert_entry and btree_map::Entry::insert_entry, following the FCP in tracking issue.

New stable API:

impl<'a, K: Ord, V, A: Allocator + Clone> Entry<'a, K, V, A> {
    pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V, A>;
}

impl<'a, K: Ord, V, A: Allocator + Clone> VacantEntry<'a, K, V, A> {
    pub fn insert_entry(mut self, value: V) -> OccupiedEntry<'a, K, V, A>;
}

(FCP ended almost a year ago, so if it's needed for process we could rerun it)

Closes: #65225

@rustbot
Copy link
Collaborator

rustbot commented Aug 3, 2025

r? @ibraheemdev

rustbot has assigned @ibraheemdev.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 3, 2025
@ibraheemdev
Copy link
Member

r? libs-api because it's been a while since the FCP.

@rustbot rustbot added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Aug 5, 2025
@rustbot rustbot assigned m-ou-se and unassigned ibraheemdev Aug 5, 2025
@tgross35
Copy link
Contributor

tgross35 commented Sep 3, 2025

I haven't looked but it's worth a sanity check if the concerns that caused HashMap::insert_entry to be destabilized also apply to BTreeMap #90345 (comment). (It was eventually stabilized after #44286 went through FCP to reject.)

@tgross35
Copy link
Contributor

tgross35 commented Sep 5, 2025

@rustbot label +I-libs-api-nominated
r? libs

@rustbot rustbot added the I-libs-api-nominated Nominated for discussion during a libs-api team meeting. label Sep 5, 2025
@rustbot rustbot assigned jhpratt and unassigned m-ou-se Sep 5, 2025
@tgross35 tgross35 added the needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. label Sep 5, 2025
@jhpratt
Copy link
Member

jhpratt commented Sep 7, 2025

r=me assuming someone from T-libs-api is fine with it. It's already passed FCP, but it was roughly a year ago. I see no reason this shouldn't be merged as a result.

cc @rust-lang/libs-api

@bors rollup

@jhpratt jhpratt added S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 7, 2025
@the8472
Copy link
Member

the8472 commented Sep 16, 2025

We briefly discussed this, seems fine.

@Amanieu Amanieu removed the I-libs-api-nominated Nominated for discussion during a libs-api team meeting. label Sep 16, 2025
@jhpratt jhpratt removed the needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. label Sep 16, 2025
@jhpratt
Copy link
Member

jhpratt commented Sep 16, 2025

In that case @bors r+

@bors
Copy link
Collaborator

bors commented Sep 16, 2025

📌 Commit b5a4e5d has been approved by jhpratt

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). labels Sep 16, 2025
@jhpratt
Copy link
Member

jhpratt commented Sep 16, 2025

@rustbot label +relnotes

@rustbot rustbot added the relnotes Marks issues that should be documented in the release notes of the next release. label Sep 16, 2025
jhpratt added a commit to jhpratt/rust that referenced this pull request Sep 17, 2025
…ze, r=jhpratt

Stabilize `btree_entry_insert` feature

This stabilises `btree_map::VacantEntry::insert_entry` and `btree_map::Entry::insert_entry`, following the FCP in [tracking issue](rust-lang#65225).

New stable API:

```rust
impl<'a, K: Ord, V, A: Allocator + Clone> Entry<'a, K, V, A> {
    pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V, A>;
}

impl<'a, K: Ord, V, A: Allocator + Clone> VacantEntry<'a, K, V, A> {
    pub fn insert_entry(mut self, value: V) -> OccupiedEntry<'a, K, V, A>;
}
```

(FCP ended almost a year ago, so if it's needed for process we could rerun it)

Closes: rust-lang#65225
bors added a commit that referenced this pull request Sep 17, 2025
Rollup of 9 pull requests

Successful merges:

 - #144871 (Stabilize `btree_entry_insert` feature)
 - #145181 (remove FIXME block from `has_significant_drop`, it never encounters inference variables)
 - #145838 (don't apply temporary lifetime extension rules to non-extended `super let`)
 - #146259 (Suggest removing Box::new instead of unboxing it)
 - #146410 (Iterator repeat: no infinite loop for `last` and `count`)
 - #146460 (Add tidy readme)
 - #146581 (Detect attempt to use var-args in closure)
 - #146588 (tests/run-make: Update list of statically linked musl targets)
 - #146647 (Move `#[rustc_coherence_is_core]` to the `crate_level` file)

r? `@ghost`
`@rustbot` modify labels: rollup
Zalathar added a commit to Zalathar/rust that referenced this pull request Sep 17, 2025
…ze, r=jhpratt

Stabilize `btree_entry_insert` feature

This stabilises `btree_map::VacantEntry::insert_entry` and `btree_map::Entry::insert_entry`, following the FCP in [tracking issue](rust-lang#65225).

New stable API:

```rust
impl<'a, K: Ord, V, A: Allocator + Clone> Entry<'a, K, V, A> {
    pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V, A>;
}

impl<'a, K: Ord, V, A: Allocator + Clone> VacantEntry<'a, K, V, A> {
    pub fn insert_entry(mut self, value: V) -> OccupiedEntry<'a, K, V, A>;
}
```

(FCP ended almost a year ago, so if it's needed for process we could rerun it)

Closes: rust-lang#65225
Zalathar added a commit to Zalathar/rust that referenced this pull request Sep 17, 2025
…ze, r=jhpratt

Stabilize `btree_entry_insert` feature

This stabilises `btree_map::VacantEntry::insert_entry` and `btree_map::Entry::insert_entry`, following the FCP in [tracking issue](rust-lang#65225).

New stable API:

```rust
impl<'a, K: Ord, V, A: Allocator + Clone> Entry<'a, K, V, A> {
    pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V, A>;
}

impl<'a, K: Ord, V, A: Allocator + Clone> VacantEntry<'a, K, V, A> {
    pub fn insert_entry(mut self, value: V) -> OccupiedEntry<'a, K, V, A>;
}
```

(FCP ended almost a year ago, so if it's needed for process we could rerun it)

Closes: rust-lang#65225
bors added a commit that referenced this pull request Sep 17, 2025
Rollup of 14 pull requests

Successful merges:

 - #142807 (libtest: expose --fail-fast as an unstable command-line option)
 - #144871 (Stabilize `btree_entry_insert` feature)
 - #145071 (Update the minimum external LLVM to 20)
 - #145181 (remove FIXME block from `has_significant_drop`, it never encounters inference variables)
 - #145660 (initial implementation of the darwin_objc unstable feature)
 - #145838 (don't apply temporary lifetime extension rules to non-extended `super let`)
 - #146259 (Suggest removing Box::new instead of unboxing it)
 - #146410 (Iterator repeat: no infinite loop for `last` and `count`)
 - #146460 (Add tidy readme)
 - #146552 (StateTransform: Do not renumber resume local.)
 - #146564 (Remove Rvalue::Len again.)
 - #146581 (Detect attempt to use var-args in closure)
 - #146588 (tests/run-make: Update list of statically linked musl targets)
 - #146631 (cg_llvm: Replace some DIBuilder wrappers with LLVM-C API bindings (part 3))

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit feeb68e into rust-lang:master Sep 17, 2025
10 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Sep 17, 2025
rust-timer added a commit that referenced this pull request Sep 17, 2025
Rollup merge of #144871 - Kivooeo:btree_entry_insert-stabilize, r=jhpratt

Stabilize `btree_entry_insert` feature

This stabilises `btree_map::VacantEntry::insert_entry` and `btree_map::Entry::insert_entry`, following the FCP in [tracking issue](#65225).

New stable API:

```rust
impl<'a, K: Ord, V, A: Allocator + Clone> Entry<'a, K, V, A> {
    pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V, A>;
}

impl<'a, K: Ord, V, A: Allocator + Clone> VacantEntry<'a, K, V, A> {
    pub fn insert_entry(mut self, value: V) -> OccupiedEntry<'a, K, V, A>;
}
```

(FCP ended almost a year ago, so if it's needed for process we could rerun it)

Closes: #65225
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tracking issue for #![feature(entry_insert)]
9 participants