# Libs-API Meeting 2024-07-23 ###### tags: `Libs Meetings` `Minutes` **Meeting Link**: https://meet.jit.si/rust-libs-meeting-crxoz2at8hiccp7b3ixf89qgxfymlbwr **Attendees**: Amanieu, Josh, David, Urgau, Chris Denton, The8472, Eric Holk ## Agenda - Triage - Anything else? ## Triage ### FCPs 15 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/112134 *Tracking Issue for \`std::ffi::c\_str\` module* - (3 checkboxes left) - merge rust.tf/106943 *Implement DoubleEnded and ExactSize for Take\<Repeat\> and Take\<RepeatWith\>* - (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/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/120141 *Tracking Issue for enum access in offset\_of* - (6 checkboxes left) - close rust.tf/44286 *Tracking issue for HashMap \`OccupiedEntry::{replace\_key, replace\_entry}\`* - (3 checkboxes left) - merge rust.tf/126877 *CloneToUninit impls* - (3 checkboxes left) - merge rust.tf/126383 *Tracking Issue for is\_none\_or* - (3 checkboxes left) [m-ou-se (9)](https://rfcbot.rs/fcp/m-ou-se), [tmandry (1)](https://rfcbot.rs/fcp/tmandry), [dtolnay (2)](https://rfcbot.rs/fcp/dtolnay), [scottmcm (2)](https://rfcbot.rs/fcp/scottmcm), [BurntSushi (11)](https://rfcbot.rs/fcp/BurntSushi), [yaahc (2)](https://rfcbot.rs/fcp/yaahc), [Amanieu (3)](https://rfcbot.rs/fcp/Amanieu), [pnkfelix (1)](https://rfcbot.rs/fcp/pnkfelix), [nikomatsakis (2)](https://rfcbot.rs/fcp/nikomatsakis), [joshtriplett (10)](https://rfcbot.rs/fcp/joshtriplett) ### (nominated) rust.tf/libs404 *Add \`is\_multiple\_of\`* Add it for both signed and unsigned integers? Or only unsigned? The person proposing only has a use case for unsigned. (Signed needs another special case for -1.) Amanieu: let's start with unsigned only, since that's uncontroversial Josh: nobody is objecting to the proposed special behavior for is_multiple_of(0) right? the8472 to reply ### (nominated) rust.tf/127765 *Fix doc nits* > [Summary sentence](https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md#appendix-a-full-conventions-text) > > In API documentation, the first line should be a single-line short sentence providing a summary of the code. This line is used as a summary description throughout Rustdoc’s output, so it’s a good idea to keep it short. > > The summary line should be written in third person singular present indicative form. Basically, this means **write ‘Returns’ instead of ‘Return’**. We can link them to this convention and say go ahead. Also consider featuring this in the standard library dev guide because most reviewers probably aren't aware of it. ### (nominated) rust.tf/rfc3469 *CPU feature detection in core* Josh: Does this preclude adding a different way to detect features on architectures or platforms where we can detect without operating system support? ### (waiting on team) rust.tf/119550 *Rename \`AsyncIterator\` back to \`Stream\`, introduce an AFIT\-based \`AsyncIterator\` trait* Waiting on WG-async ### (new change proposal) rust.tf/libs411 *ACP: add \`std::any::is\_same\_type::\<T, U\>() \-\> bool\`* Already responded last week ### (new change proposal) rust.tf/libs412 *File lock API* On some platforms it does mandatory locking, on others advisory locking. The only guarantee is that there is a lock associated with your file and it goes away when the file is closed. Josh: also on Fd please Amanieu: if you want to lock an Fd, turn your Fd into a File first 8472: is try_lock implementable? Josh: yes, LOCK_NB ("nonblocking") argument on Linux, LockFileEx with LOCKFILE_FAIL_IMMEDIATELY on Windows (exists since XP) Consensus: 3 methods on File: lock, unlock, try_lock. Difference from the ACP: no LockedFile lock guard type Separate methods for shared lock? lock_shared, try_lock_shared? Amanieu to reply ### (new change proposal) rust.tf/libs413 *ACP: add bitwise/bytewise methods to NonZero* Accepted Amanieu to reply ### (new change proposal) *Add \`slice::{trim, trim\_start, trim\_end}\` (+ mutable counterparts)* Josh: I like the methods but not necessarily the names. Already on str we have `trim_start` and `trim_end` (unicode whitespace) and on str + &[u8] we have `trim_ascii` to trim ascii whitespace. `trim` and `trim_start`/`trim_end` is not sufficiently clear for the new proposed behavior `trim_matches` for parity with str (which takes a Pattern)? Eric: `trim_with` or `trim_by` `Fn` vs `FnMut`? `trim_if`, `trim_while`, `trim_where` Precedent for "while": [Iterator::skip_while](https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.skip_while), [Iterator::take_while](https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.take_while) Accepting `trim_matches` 8472: but if it isn't identical to str's `trim_matches` I would prefer a different name ### (new change proposal) rust.tf/libs415 *Add a method for constructing a \`Waker\` from a \`Fn()\`* Eric: please ping WG-async We like it as long as there is no objection from WG-async ### (stalled change proposal) rust.tf/libs157 *fold\_first API Change Proposal* `let first = init(self.next()?); Some(self.fold(first, folding))` or `self.next().map(|first| self.fold(init(first), folding))` Close due to lack of seconds 8472 to comment ### (stalled change proposal) rust.tf/libs257 *Implement \`From\<&'a &'static str\>\` for \`Arguments\<'a\>\`* Deferred to a meeting with Mara ### (stalled change proposal) rust.tf/libs169 *Adding locks disregarding poison* Counterproposal: `std::lock` containing non-poisoning `Mutex`, `RwLock`, `ReentrantMutex` etc Josh: another possibility: `std::sync::poison` and `std::sync::nonpoison`, in a future edition it may become possible to change which set is re-exported in `std::sync` Amanieu, David: +1 Josh: and ask kodraus for an independent ACP proposing `Poison<T>`? ### (stalled change proposal) rust.tf/libs287 *ACP: Add \`FromByteStr\` trait with blanket impl \`FromStr\`* ### (stalled change proposal) rust.tf/libs215 *Implement AsRef, Borrow for std::cell::Ref, RefMut* Amanieu: `MutexGuard` does not have AsRef or Borrow. We shouldn't do it for Ref/RefMut if not for MutexGuard David to comment: ask for what other types the same rationale applies to (mutex guards?), prefer to see a PR adding it for them all, and crater all at once ### rust.tf/libs392 *Add a RwLock downgrade method* OK as long as it's implementable. Amanieu to reply ### rust.tf/libs323 *Add ptr::fn_addr_eq to compare functions pointers.* Defer until josh is available. ### rust.tf/libs396 *Extend the Path API with some useful helper functions.* ```push impl Path { fn normalize(&self) -> Cow<'_, Path>; } ``` `split_prefix`: agreed to move to a Windows-specific PathExt extension trait, possible different method name referring to "drive" `push_lexically`: not in favor, prefer `normalize` as above `push_checked`: undecided _Generated by [fully-automatic-rust-libs-team-triage-meeting-agenda-generator](https://github.com/rust-lang/libs-team/tree/main/tools/agenda-generator)_