---
# System prepended metadata

title: Libs-API Meeting 2024-11-26
tags: [Minutes, Libs Meetings]

---

---
date: 2024-11-26
url: https://hackmd.io/gZkoK98rQg6ZgrMk62nF3g
---

# Libs-API Meeting 2024-11-26

###### tags: `Libs Meetings` `Minutes`

**Meeting Link**: https://meet.jit.si/rust-libs-meeting-crxoz2at8hiccp7b3ixf89qgxfymlbwr
**Attendees**: Amanieu, David, JoshT, Mara, The 8472, TC

## Agenda

- Triage
- Anything else?

## Triage

### FCPs

16 rust-lang/rust T-libs-api FCPs

  - merge rust.tf/97601 *Tracking Issue for map\_many\_mut* - (2 checkboxes left)
  - merge rust.tf/80437 *Tracking Issue for \`box\_into\_inner\`* - (1 checkboxes left)
  - merge rust.tf/120287 *Tracking Issue for \`NonZero\*::count\_ones\`* - (3 checkboxes left)
  - merge rust.tf/106418 *Implement \`PartialOrd\` and \`Ord\` for \`Discriminant\`* - (2 checkboxes left)
  - merge rust.tf/120141 *Tracking Issue for enum access in offset\_of* - (6 checkboxes left)
  - merge rust.tf/130191 *\[discussion\] \`ErrorKind::CrossesDevices\` from \`io\_error\_more\`* - (3 checkboxes left)
  - merge rust.tf/130190 *\[discussion\] \`ErrorKind::FilesystemQuotaExceeded\` from \`io\_error\_more\`* - (3 checkboxes left)
  - merge rust.tf/104642 *Tracking Issue for get\_many\_mut* - (3 checkboxes left)
  - merge rust.tf/130192 *\[discussion\] \`ErrorKind::InvalidFilename\` from \`io\_error\_more\`* - (3 checkboxes left)
  - merge rust.tf/132187 *Add Extend impls for tuples of arity 1 through 12* - (3 checkboxes left)
  - merge rust.tf/129375 *Tracking Issue for unbounded\_shifts* - (3 checkboxes left)
  - merge rust.tf/132431 *From iterator more tuples* - (3 checkboxes left)
  - merge rust.tf/93235 *Tracking Issue for \`const\_nonnull\_new\`* - (3 checkboxes left)
  - merge rust.tf/127534 *feat(core): impl Step for NonZero\<u\*\>* - (3 checkboxes left)
  - merge rust.tf/43244 *Tracking issue for Vec::extract\_if and LinkedList::extract\_if* - (2 checkboxes left)
  - merge rust.tf/59618 *Tracking issue for HashMap::extract\_if and HashSet::extract\_if* - (3 checkboxes left)

[nikomatsakis (2)](https://rfcbot.rs/fcp/nikomatsakis), [Amanieu (6)](https://rfcbot.rs/fcp/Amanieu), [m-ou-se (12)](https://rfcbot.rs/fcp/m-ou-se), [dtolnay (2)](https://rfcbot.rs/fcp/dtolnay), [scottmcm (2)](https://rfcbot.rs/fcp/scottmcm), [tmandry (1)](https://rfcbot.rs/fcp/tmandry), [pnkfelix (1)](https://rfcbot.rs/fcp/pnkfelix), [joshtriplett (6)](https://rfcbot.rs/fcp/joshtriplett), [BurntSushi (14)](https://rfcbot.rs/fcp/BurntSushi)

### (nominated) rust.tf/43244 *Tracking issue for Vec::extract\_if and LinkedList::extract\_if*

Already in FCP.

### (nominated) rust.tf/95892 *Tracking Issue for \`sub\_ptr\` (feature \`ptr\_sub\_ptr\`)*

No progress since last week...

Still in bikeshed.

None of the options have consensus.

Amanieu: sitll prefer offset_from_unsigned. also okay with offset_after

JoshT: Would check the box for either, prefer offset_after.

The 8472: Or unsigned_offset_from, better english?

Amanieu: In the prefix position it sounds like absolute value.

David: I don't have much of an issue with `as usize`.

The 8472: That's different though. `as usize` has defined behaviour for -1 -> usize::MAX. This method is UB for negative offset.

David: We need one with a signed result. The only question is if we want one offset method (signed only) or two (signed and unsigned).

The 8472: The unsigned offset helps optimizations.

David: Are there actual situations where the optimizer optimizes better?

The 8472: Yes, that's why we have this method.

Amanieu: One method is also nice for autocompletion.

The 8472: We might need a third method in the future, if llvm gets a way to communicate that two pointers .. i don't remember.

1. `second.sub_ptr(first)`
2. `second.offset_after(first)`
3. `second.offset_from_unsigned(first)`
4. `first.offset_to(second)`
5. `first.distance_to(second)`
6. `second.positive_offset_from(first)`

Ordered ranking with favorite first:

- David: 3, 5, 4, 6, 1, 2
- Josh: 2, 1, 3, 4, 5, 6
- Mara: 4, 5, 3, 2, 1, 6
- Amanieu: 3, 2, 1, 6, 4, 5
- The 8472: 6, 2, 1, 3, 5, 4

based on this, 3 seems like the option everyone can live with. is it good enough?

JoshT: Would anyone object?

JoshT: My only annoyance at it is how long the name is, discouraging people from using it. But I'm willing to reluctantly live with it.

Good enough for everyone.

Amanieu to propose FCP.

### (nominated) rust.tf/104642 *Tracking Issue for get\_many\_mut*

Discussed last time.

Mara: Every time we discuss this, we always bring up that it's primarily for 2-3 items, so "many" seems wrong.

Josh: Every use of `many` in the standard library is unstable, so :+1: for renaming them all consistently.

Josh: Enthusiastic about `get_n_mut`. `n` for a compile time fixed N makes sense, and the name is even shorter.

8472: We already have `repeat_n`

David: and `Iterator::nth`

Amanieu: Weak argument, but hashbrown already uses get_many_mut.

David: `get_nonoverlapping_mut` could work too, avoids the many/few/multiple question. Even longer than 'multiple' though.

Amanieu: prefer get_multiple_mut over get_n_mut. okay with get_multiple_mut

David: and multiple vs several?

Amanieu: Strongly prefer multiple.

Josh: Wouldn't support switching from get_many to a longer name like get_multiple.

Mara: Should we wait for some feedback on the tracking issue?

Anything else to talk about for this issue?

Amanieu: Error type



### (nominated) rust.tf/120580 *Add \`MAX\_LEN\_UTF8\` and \`MAX\_LEN\_UTF16\` Constants*

JoshT: Since we don't have the ability yet to import associated constants (`use char::BLA`), we should also expose these through a module. In general, we should do that for any constant that makes sense to import unqualified (as opposed to something like `MAX` that )

Amanieu: so just r+ this?

JoshT: "len" not being bytes is confusing; would have expected e.g. "how many bytes do I need to read off the wire".

Mara: len seems fine. we use len for arrays. in [0u16; 2], the len is 2. utf-16 has nothing to do with bytes.

Mara: we usually use 'size' for bytes, and 'len' for items/units

Amanieu: I think len is fine

Josh: Not going to object, on the basis that anytime I'm using UTF-16 I'm *already* having a bad time, so this doesn't make it that much worse...

### (nominated) rust.tf/129259 *Add inherent versions of MaybeUninit methods for slices*

Amanieu: Prefer old names, clone_from_slice

David: That would drop the old values.

Mara: We already have slice::clone_from_slice.

JoshT: I like the proposed names.

Amanieu: of_slice or from_slice?

JoshT: i think of_slice is clearer.

Amanieu: Do we have consensus on the assume_init ones?

Mara: I slightly dislike having them on slices, because they will shop up in in a weird place in rustdoc: on slices, rather than on MaybeUninit.

Amanieu: We have these methods on MaybeUninit, not taking self: https://github.com/rust-lang/rust/issues/63569

The 8472: Rustdoc could be improved.

The 8472: Same for raw pointers to slices.

Mara: Not just rustdoc. The language doesn't allow doing `impl [YourOwnType]`. We can 'cheat' here, but should we?

JoshT: The combination of slice and maybeuninit is a special thing

David: Should that get its own page?

David+JoshT: Sticky headers on the page for impl blocks would help. Feature request for rustdoc.

JoshT: I'll go file it.

The 8472: Is it also useful for other libraries?

David: Other libraries mostly use it for different bounds. We use it for different self types.

Josh: Filed as https://github.com/rust-lang/rust/issues/133506

### (nominated) rust.tf/131784 *Stabilize unsigned and float variants of \`num\_midpoint\` feature*

FCP started

### (nominated) rust.tf/132268 *Impl TryFrom\<Vec\<u8\>\> for String*

FCP started

### (nominated) rust.tf/133255 *Implement \`From\<&NonZero\<T\>\> for &T\`*

### (nominated) rust.tf/133485 *breaking change: Copy Python implementation for \`float::div\_euclid\`*


### (waiting on team) rust.tf/130209 *Stabilize \`std::io::ErrorKind::CrossesDevices\`*

FCP at https://github.com/rust-lang/rust/issues/130191#issuecomment-2342350729 , needs checkboxes

### (waiting on team) rust.tf/130254 *Stabilize \`std::io::ErrorKind::QuotaExceeded\`*

FCP at https://github.com/rust-lang/rust/issues/130190#issuecomment-2345025851 , needs checkboxes

### (waiting on team) rust.tf/131713 *Stabilize \`const\_maybe\_uninit\_write\`*

### (waiting on team) rust.tf/132187 *Add Extend impls for tuples of arity 1 through 12*



### (new change proposal) rust.tf/libs496 *ACP: Add \`try\_from\_slice\` constructor to \`core::array\`.*

### (new change proposal) rust.tf/libs495 *add an \`extract\` macro which extracts values matched in a pattern*

With if let:

```rust!
    let chars = arr
        .into_iter()
        .filter_map(|x| if let Char(c) = x { Some(c) } else { None });
```

A closure macro:

```rust!
arr.into_iter().filter_map(opt_closure!(|Char(c)| c))
arr.into_iter().filter_map(opt_closure!(|Char(c)| Some(c)))
arr.into_iter().filter_map(opt_closure!(Char(c) => c))
arr.into_iter().filter_map(opt_closure!(Char(c) => Some(c)))
arr.into_iter().filter_map(Option::Some.from(Value::Char))
```

### (new change proposal) rust.tf/libs494 *Safe intrinsics in core::arch*

### (new change proposal) rust.tf/libs493 *\`CStr::from\_bytes\_with\_nul\` returns non\-actionable error result*

### (new change proposal) rust.tf/libs492 *Implementing \`AsRef\<T\> for T\` for all the stdlib's types*

### (new change proposal) rust.tf/libs491 *ACP: \`core::arch::breakpoint\`*

### (new change proposal) rust.tf/libs490 *Infallible version of fetch\_update*

### (new change proposal) rust.tf/libs487 *Path::is\_trivial*

### (new change proposal) rust.tf/libs484 *Support \`vec!\[const { ... }; n\]\` syntax for creating a \`Vec\` of non\-\`Clone\` values*

### (new change proposal) rust.tf/libs483 *\`Box::new\_from\_ref\` for making a \`Box\<T\>\` from a \`&T\` where \`T: CloneToUninit + ?Sized\` (and \`Rc\` and \`Arc\`)*


### (stalled change proposal) rust.tf/libs298 *Constructive/Destructive Interference Size Padding*

### (stalled change proposal) rust.tf/libs277 *\[ACP\]  RangeBounds::overlaps*

### (stalled change proposal) rust.tf/libs311 *ACP: Pattern methods for \`OsStr\` without \`OsStr\` patterns*

### (stalled change proposal) rust.tf/libs201 *ACP: Provide \`TryFrom\<&\[T\]\>\` implementation for \`&\[\[T; N\]\]\`*

### (stalled change proposal) rust.tf/libs314 *Add security\_attributes() to windows::OpenOptionsExt*

### (stalled change proposal) rust.tf/libs253 *Provide way to deconstruct std::iter::Rev*

### (stalled change proposal) rust.tf/libs337 *Add \`(checked\_)norem\_div\` methods for integer types*

### (stalled change proposal) rust.tf/libs364 *ACP: Add {Box, Rc, Arc}::map and {Box, Rc, Arc}::try\_map*

### (stalled change proposal) rust.tf/libs344 *ACP: Add \`std::string::String::replace\_and\_count\` and/or \`replace\_with\`*

### (stalled change proposal) rust.tf/libs287 *ACP: Add \`FromByteStr\` trait with blanket impl \`FromStr\`*


_Generated by [fully-automatic-rust-libs-team-triage-meeting-agenda-generator](https://github.com/rust-lang/libs-team/tree/main/tools/agenda-generator)_
