diff options
| author | 许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com> | 2024-11-30 12:57:35 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-30 12:57:35 +0800 |
| commit | 132fcd89b30a6e7d7e4bcf68070657ea1e76edbb (patch) | |
| tree | 397ff696dcb68f370cd335ee614d810d1f1a272e /compiler/rustc_mir_transform/src/errors.rs | |
| parent | 70b107910bc26ae21b6f3e7204b48b2cf4f4fd53 (diff) | |
| parent | 21b1ab1779a6f58f4a77bad0e1d3a21efcd9bc47 (diff) | |
| download | rust-132fcd89b30a6e7d7e4bcf68070657ea1e76edbb.tar.gz rust-132fcd89b30a6e7d7e4bcf68070657ea1e76edbb.zip | |
Rollup merge of #133548 - cuviper:btreeset-entry-api, r=Mark-Simulacrum
Add `BTreeSet` entry APIs to match `HashSet`
The following methods are added, along with the corresponding `Entry` implementation.
```rust
impl<T, A: Allocator + Clone> BTreeSet<T, A> {
pub fn get_or_insert(&mut self, value: T) -> &T
where
T: Ord,
{...}
pub fn get_or_insert_with<Q: ?Sized, F>(&mut self, value: &Q, f: F) -> &T
where
T: Borrow<Q> + Ord,
Q: Ord,
F: FnOnce(&Q) -> T,
{...}
pub fn entry(&mut self, value: T) -> Entry<'_, T, A>
where
T: Ord,
{...}
}
```
Tracking issue #133549
Closes https://github.com/rust-lang/rfcs/issues/1490
Diffstat (limited to 'compiler/rustc_mir_transform/src/errors.rs')
0 files changed, 0 insertions, 0 deletions
