---
date: 2024-06-18
url: https://hackmd.io/3gan007nSG-xxB9--m81bA
---
# Libs-API Meeting 2024-06-18
###### tags: `Libs Meetings` `Minutes`
**Meeting Link**: https://meet.jit.si/rust-libs-meeting-crxoz2at8hiccp7b3ixf89qgxfymlbwr
**Attendees**: Amanieu, David, Josh Triplett, Mara, Chris Denton, Eric Holk, TC
## Agenda
- Triage
- Anything else?
## Triage
### FCPs
1 rust-lang/rfcs T-libs-api FCPs
- merge rust.tf/rfc3657 *Async project goal* - (8 checkboxes left)
16 rust-lang/rust T-libs-api FCPs
- merge rust.tf/80437 *Tracking Issue for \`box\_into\_inner\`* - (1 checkboxes left)
- merge rust.tf/82901 *Tracking Issue for \`Option::get\_or\_insert\_default\`* - (2 checkboxes left)
- merge rust.tf/83871 *Tracking Issue for CharIndices::offset function* - (3 checkboxes left)
- merge rust.tf/102012 *Tracking Issue for \`const\_waker\`* - (3 checkboxes left)
- merge rust.tf/106943 *Implement DoubleEnded and ExactSize for Take\<Repeat\> and Take\<RepeatWith\>* - (3 checkboxes left)
- merge rust.tf/62726 *Tracking issue for io\_slice\_advance* - (3 checkboxes left)
- merge rust.tf/109402 *Implement owned ops for \`HashSet\` and \`BTreeSet\`* - (3 checkboxes left)
- merge rust.tf/101196 *Tracking Issue for \`Ready::into\_inner()\`* - (1 checkboxes left)
- merge rust.tf/106418 *Implement \`PartialOrd\` and \`Ord\` for \`Discriminant\`* - (2 checkboxes left)
- close rust.tf/56167 *Tracking issue for HashMap::raw\_entry* - (3 checkboxes left)
- merge rust.tf/113219 *Tracking Issue for \`const\_cstr\_from\_ptr\`* - (5 checkboxes left)
- merge rust.tf/55132 *Tracking issue for thread::Builder::spawn\_unchecked* - (3 checkboxes left)
- merge rust.tf/123723 *Make \`std::os::tvos\`, \`std::os::visionos\` and \`std::os::watchos\` public* - (4 checkboxes left)
- merge rust.tf/53485 *Tracking issue for RFC 2351, "Add \`is\_sorted\` to the standard library"* - (4 checkboxes left)
- merge rust.tf/120141 *Tracking Issue for enum access in offset\_of* - (7 checkboxes left)
- merge rust.tf/120140 *Tracking Issue for nested field access in offset\_of* - (7 checkboxes left)
[m-ou-se (12)](https://rfcbot.rs/fcp/m-ou-se), [Amanieu (4)](https://rfcbot.rs/fcp/Amanieu), [nikomatsakis (4)](https://rfcbot.rs/fcp/nikomatsakis), [tmandry (4)](https://rfcbot.rs/fcp/tmandry), [BurntSushi (11)](https://rfcbot.rs/fcp/BurntSushi), [dtolnay (3)](https://rfcbot.rs/fcp/dtolnay), [scottmcm (4)](https://rfcbot.rs/fcp/scottmcm), [yaahc (2)](https://rfcbot.rs/fcp/yaahc), [joshtriplett (14)](https://rfcbot.rs/fcp/joshtriplett), [pnkfelix (4)](https://rfcbot.rs/fcp/pnkfelix)
### (nominated) rust.tf/libs310 *Add \`array::repeat\` for making an array from a non\-\`Copy\` non\-\`const\` value*
Should this call Clone::clone N times or N-1 times?
Should it take the value by value or by reference?
N-1 times seems fine, that's what iterator's repeat_n does.
Accepted.
### (nominated) rust.tf/60123 *Tracking issue for core::arch::{x86, x86\_64}::has\_cpuid*
Josh: I agree with Jubilee's argument.
Mara: Seems fine to leave this to asm!().
Josh: Is this just useful for SGX and nothing else?
Amanieu: 586, 386? We don't have a target for this, except SGX.
FCP close
Amanieu: related: CPU feature detection in core: https://github.com/rust-lang/rfcs/pull/3469
### (nominated) rust.tf/63291 *Tracking issue for uninitialized constructors for Box, Rc, Arc*
new question since last week: what Self type do we use? Specifically for new_uninit_slice
Leaving FCP as it is
### (nominated) rust.tf/125937 *Remove lock guarantee from \`std::env::{set\_var, remove\_var}\`*
FCP closed, unnominating.
### (nominated) rust.tf/125970 *CommandExt::before\_exec: deprecate safety in edition 2024*
This nomination was stale; unnominating.
### (nominated) rust.tf/126489 *Add a little bit of life to \`Cell::update\`*
Amanieu: Who uses a Cell with a non-copy type?
David+TC+Mara put up their hands
Mara: It's a bit annoying that we need two, but I'm mildly in favour.
Amanieu: rather just provide it for copy types only. result for take+set is nonobvious
David: Agree
Mara: I think I agree.. would be nice if it is usable for Default !Copy types.. but two functions is confusing.
David: There should be a docs example with take+set for !Copy types
Amanieu to reply and start FCP.
### (nominated) rust.tf/126600 *\`std::process::exit\` is not thread\-safe*
Mara: This isn't the first time this issue has been filed.
Josh: Yeah, 2nd or 3rd time. It's not so much exit(), but more atexit() callbacks.
https://github.com/rust-lang/rust/issues/83994
https://github.com/rust-lang/rust/issues/83994#issuecomment-821903447
TC: The example given by the author currently segfaults in the [playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&code=use+std%3A%3Athread%3B%0A%0Afn+main%28%29+%7B%0A++++for+_+in+0..32+%7B%0A++++++++unsafe+%7B+libc%3A%3Aatexit%28exit_handler%29+%7D%3B%0A++++%7D%0A++++for+_+in+0..2+%7B%0A++++++++thread%3A%3Aspawn%28%7C%7C+std%3A%3Aprocess%3A%3Aexit%280%29%29%3B%0A++++%7D%0A%7D%0A%0Aextern+%22C%22+fn+exit_handler%28%29+%7B%0A++++thread%3A%3Asleep_ms%281000%29%3B%0A%7D%0A).
(Discussion about adding a lock.)
TC: Adding a lock would have the same problem as for `set_var` and `remove_var`, which is that you'd still need to ensure that no other threads could be running. Any other thread could be calling C code that calls `exit` (without the lock).
Josh: It'd be even worse than the `set_var` case since it's even harder to determine that no other thread could be calling `exit`.
David: Lock is very cheap. Let's just add it?
Mara: Just an AtomicBool should be enough, to indicate exit() is running somewhere.
TC: We should just be clear that adding a lock would not really solve the problem.
Amanieu + Josh: We should report this to glibc.
Amanieu to report the bug.
Chris: Here's the list of functions allowed by POSIX to not be thread safe (it doesn't include `exit`):
https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_09_01
Mara: Here's where Rich Felker says that POSIX requires `exit` to be thread safe:
https://github.com/rust-lang/rust/issues/83994#issuecomment-821903447
### (waiting on team) rust.tf/119550 *Rename \`AsyncIterator\` back to \`Stream\`, introduce an AFIT\-based \`AsyncIterator\` trait*
Not waiting on us.
### (waiting on team) rust.tf/123723 *Make \`std::os::tvos\`, \`std::os::visionos\` and \`std::os::watchos\` public*
### (new change proposal) rust.tf/libs393 *Simple secure random number generation*
### (new change proposal) rust.tf/libs394 *Simple seedable insecure random number generation, stable across Rust versions*
Amanieu: I don't see this being stabilized on its own without the rest of the `random` API.
Amanieu: I started on writing up an API proposal here; but I stopped when I realized we'd need to add the entire contents of the existing crate.
Amanieu: I'd also like to see this trait unsealed. If we define this trait in the standard library, the rest of the ecosystem is going to want to use this trait.
Mara: For a random die roll, you need 0..6, not a random u8 or w/e. `% 6` is bad.
Mara: I want to avoid a situation where `random() % 6` is easier than `random(0..6)` (e.g. if the latter needs a dependency)
Amanieu: We need to consider the full API picture; just doing a piece without considering the rest doesn't seem a good way to start.
Mara: +1
Josh: So what is the minimal API we can accept?
Chris: related ACP: https://github.com/rust-lang/libs-team/issues/159
Mara: Clear goals/use cases would be helpful. E.g. die roll vs random u8/u32/.. vs entropy from the O.S. ..
Amanieu: Here's an incomplete draft of what I think is the minimal API is:
https://gist.github.com/Amanieu/07c6b058aeffe7c97381842ece8e53d6
(The meeting ended here.)
---
### (new change proposal) rust.tf/libs395 *\`impl core::str::Pattern for \[&str; N\]\`*
### (new change proposal) rust.tf/libs396 *Extend the \`Path\` API with some useful helper functions.*
### (new change proposal) rust.tf/libs397 *ACP: Add \`prev\_power\_of\_two\` and \`bit\_width\` methods for unsigned integers and \`NonZero\<uN\>\`*
### (stalled change proposal) rust.tf/libs230 *Add \`saturating\_shl\` and \`saturating\_shr\` for ints*
### (stalled change proposal) rust.tf/libs255 *Adding \`set\_route\` to \`sys::unix::net\`*
### (stalled change proposal) rust.tf/libs186 *Implementing flatten for \`Option\<&Option\<T\>\>\` and \`Option\<&mut Option\<T\>\>\`*
### (stalled change proposal) rust.tf/libs145 *ACP: Additional NonZero conversions*
### (stalled change proposal) rust.tf/libs184 *Add \`setsid\` method to \`CommandExt\` trait*
_Generated by [fully-automatic-rust-libs-team-triage-meeting-agenda-generator](https://github.com/rust-lang/libs-team/tree/main/tools/agenda-generator)_