# Libs-API Meeting 2024-03-19
###### tags: `Libs Meetings` `Minutes`
**Meeting Link**: https://meet.jit.si/rust-libs-meeting-crxoz2at8hiccp7b3ixf89qgxfymlbwr
**Attendees**: ...
## Agenda
- Triage
- Anything else?
## Triage
### FCPs
1 rust-lang/rfcs T-libs-api FCPs
- merge rust.tf/rfc3550 *RFC: New range types for Edition 2024* - (5 checkboxes left)
18 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/98934 *Add \`Option::take\_if\`* - (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/120257 *Tracking Issue for generic \`NonZero\`* - (2 checkboxes left)
- merge rust.tf/107462 *Implement \`FromIterator\` for \`(impl Default + Extend, impl Default + Extend)\`* - (2 checkboxes left)
- merge rust.tf/113744 *Tracking Issue for \`IpvNAddr::{BITS, to\_bits, from\_bits}\` (\`ip\_bits\`)* - (3 checkboxes left)
- merge rust.tf/99262 *Tracking Issue for \`io\_error\_downcast\`* - (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/116113 * Generalize \`{Rc,Arc}::make\_mut()\` to unsized types.* - (4 checkboxes left)
- merge rust.tf/115974 *Split core's PanicInfo and std's PanicInfo* - (2 checkboxes left)
- merge rust.tf/117468 *Stabilize Wasm relaxed SIMD* - (4 checkboxes left)
- merge rust.tf/101196 *Tracking Issue for \`Ready::into\_inner()\`* - (1 checkboxes left)
- merge rust.tf/119131 *Tracking Issue for \`hint::assert\_unchecked\`* - (2 checkboxes left)
- merge rust.tf/106418 *Implement \`PartialOrd\` and \`Ord\` for \`Discriminant\`* - (2 checkboxes left)
1 rust-lang/stdarch T-libs-api FCPs
- merge github.com/rust-lang/stdarch/issues/1552 *Stabilize AArch64 SHA3 intrinsics* - (3 checkboxes left)
[nikomatsakis (3)](https://rfcbot.rs/fcp/nikomatsakis), [dtolnay (1)](https://rfcbot.rs/fcp/dtolnay), [scottmcm (1)](https://rfcbot.rs/fcp/scottmcm), [Amanieu (6)](https://rfcbot.rs/fcp/Amanieu), [tmandry (1)](https://rfcbot.rs/fcp/tmandry), [BurntSushi (11)](https://rfcbot.rs/fcp/BurntSushi), [pnkfelix (2)](https://rfcbot.rs/fcp/pnkfelix), [m-ou-se (12)](https://rfcbot.rs/fcp/m-ou-se), [yaahc (2)](https://rfcbot.rs/fcp/yaahc), [joshtriplett (15)](https://rfcbot.rs/fcp/joshtriplett)
### (nominated) rust.tf/71146 *Tracking Issue for raw slice len() method (slice\_ptr\_len, const\_slice\_ptr\_len)*
Seems fine. Amanieu to propose FCP.
### (nominated) rust.tf/121588 *strict provenance: rename addr → bare\_addr*
Ralf asked folks from the Zulip discussion to leave a comment, but nobody showed up. :(
Today, Ralf pinged someone again on Zulip..
Amanieu: Still prefer bare_
Mara: I don't like it if we don't have a clear definition of "bare"
Amanieu: {some pun}
Amanieu: So would you accept bare_addr if we had a proper definition of bare?
Mara: Probably not, depending on that definition. If the definition is "without provenance" then no, because usizes don't carry provenance by definition.
### (nominated) rust.tf/121920 *downgrade ptr.is\_aligned\_to crate\-private*
FCP merge. (discussed last time)
### (nominated) rust.tf/122520 *Stabilize \`unchecked\_{add,sub,mul}\`*
FCP started.
### (waiting on team) rust.tf/119550 *Rename \`AsyncIterator\` back to \`Stream\`, introduce an AFIT\-based \`AsyncIterator\` trait*
Not waiting on our team.
### (waiting on team) rust.tf/119799 *Return the delimiter from slice::split\_once*
str::split_once is already stable and returns only two parts.
Competing proposal: Add split_once_sep, which we can also add to str. https://github.com/rust-lang/rust/issues/112811#issuecomment-1884460992
Options:
1. Don't change anything.
2. Change slice::split_once to return three things.
3. Add {slice, str}::split_once_sep that returns three things.
Mara: I'd like str::split_once_sep. don't care much about slices.
The 8472: If we have slice::split_once_sep, does it still make sense to add slice::split_once?
Amanieu: you can always manually do this with .find. How common is this pattern?
Mara: For slices these methods are a bit underpowered, since they only look for one element.
David: The impl is just two lines. You can write that when you need that.
Amanieu: prefer option 1. option 3 is a separate proposal.
David: +1
David: Do we not have a split_once_mut?
Amanieu: Nope. Probably because most people only want this for ascii/byte strings.
Proposing FCP close.
### (waiting on team) rust.tf/122291 *Stabilize \`const\_location\_fields\`*
Amanieu: Is this useful even though Location::caller() is not yet const stable?
David: Yes. E.g. `const fn f(Option<&Location>)` or something.
Amanieu: Prefer stabilization together with caller() being const.
David: Fair.
### (new change proposal) rust.tf/libs350 *std::slice::from\_raw\_parts alternative that would accept a null pointer if len == 0 by returning an empty slice*
Mara: Still prefer adding the check to slice::from_raw_parts.
Amanieu: Let's check with a perf run.
David: Normally we do a perf run for things that are reversible. Once we ship this as stable, we can't go back.
Mara: We could ship the implementation but not the guarantee for now.
Amanieu: But people will rely on that.
The 8472: Docs are clear enough that it shouldn't be null.
David: agree that could work.
Amanieu: Do we want to solve this FFI problem at all?
Mara: Yes
David: I'm on the fence. Fine with the API as is.
Amanieu: Tending towards a separate method, but not sure. If the perf run is negative, we could do this on nightly to see if anyone complains..
The 8472: I don't think this is a good idea, because of cases where the branch cannot be optimized away.
David: This shoudl result in branch free (cmov) code.
The 8472: Still prevents vectorization etc.
David: Right.
Amanieu: would this check len==0 to set ptr=dangling?
Mara: ptr==null then ptr=dangling
David: Agree
Amanieu: i think it should check len==0.
Amanieu: actually, the address of an empty slice is significant, so it should be ptr==null.
Mara: I think if we add this check, we should add a NonNull version.
Amanieu: I need to leave. My conclusion here is that i'd like to see a perf run. Though I don't like changing existing behaviour.
David: One null check on just the pointer should be enough. with len>0 it's UB.
### (new change proposal) rust.tf/libs351 *ACP: Add \`impl Display\` variant to print \`Duration\` as decimal seconds*
Mara: The question is whether we want this as `.display_seconds()` or as `impl Display for Duration`
David: Not clear to me that a user of `.display_seconds()` wants the nanosecond precision or just the seconds. Though you'd just call .secs() for that..
David: I think the ACP is fine as written.
David: Would we also need a .display_milliseconds()?
Mara: Seconds are inherent to the structure of Duration. It stores seconds separately from sub-second nanoseconds..
The 8472: But milliseconds are often relevant.
Mara: We discussed as_millis_f64 last week. This is similar, but for printing.
David: This is just displaying as_secs_f64() but without the risk of floating point rounding.
Mara: We might need display_millis(), but i think that's fine, for the same rason that as_millis_f64() is fine.
The 8472: What if we have the power of 10 as the argument?
David: What about .display(Duration::SECOND)?
The 8472: Powers of ten allows a nice implementation, where you dump the `.` character in the right place.
Mara: with a power of `10^2` is very likely just a bug, so let's just stay with only seconds and millis?
David: You could always multiply the Duration before displaying. `(duration * 1000).display_seconds()` displays millis.
Mara: Happy to accept display_seconds, and also happy to accept display_millis if someome comes and proposes that.
David: +1
Mara to accept ACP.
### (new change proposal) rust.tf/libs352 *Add error functions (\`erf\`, \`erfc\`) to the \`f32\`/\`f64\` API.*
David: Seems fine, as long as we can provide a high quality implementation.
C and C++ have these too.
Mara: +1
Mara: I'd like to see what other libm functions we're missing.
Mara to reply.
The 8472: Maybe ping a float expert.
### (new change proposal) rust.tf/libs354 *Add titlecase APIs to \`char\`*
### (new change proposal) rust.tf/libs355 *Add "as raw pointer" methods to \`Box\`*
### (stalled change proposal) rust.tf/libs255 *Adding \`set\_route\` to \`sys::unix::net\`*
### (stalled change proposal) rust.tf/libs205 *Expose the internal \`SimpleMessage\` struct and allow creating \`std::io::Error\`s with them*
### (stalled change proposal) rust.tf/libs204 *Integer Manipulation API*
### (stalled change proposal) rust.tf/libs159 *Provide access to the system's random number generator*
### (stalled change proposal) rust.tf/libs183 *Add uN::to\_signed and iN::to\_unsigned*
_Generated by [fully-automatic-rust-libs-team-triage-meeting-agenda-generator](https://github.com/rust-lang/libs-team/tree/main/tools/agenda-generator)_