owned this note
owned this note
Published
Linked with GitHub
---
date: 2024-12-03
url: https://hackmd.io/j3s2yuL4SkWSAnEAPWmEwg#
---
# Libs-API Meeting 2024-12-03
###### tags: `Libs Meetings` `Minutes`
**Meeting Link**: https://meet.jit.si/rust-libs-meeting-crxoz2at8hiccp7b3ixf89qgxfymlbwr
**Attendees**: Amanieu, David, Mara, Josh, The8472, TC, Chris Denton
## Agenda
- Triage
- Anything else?
## Triage
### FCPs
17 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/132268 *Impl TryFrom\<Vec\<u8\>\> for String* - (4 checkboxes left)
- merge rust.tf/67521 *Tracking issue for const \`alloc::Layout\`* - (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/129375 *Tracking Issue for unbounded\_shifts* - (3 checkboxes left)
- merge rust.tf/132431 *From iterator more tuples* - (3 checkboxes left)
- merge rust.tf/127534 *feat(core): impl Step for NonZero\<u\*\>* - (3 checkboxes left)
- merge rust.tf/59618 *Tracking issue for HashMap::extract\_if and HashSet::extract\_if* - (3 checkboxes left)
- merge rust.tf/83163 *Tracking Issue for const\_swap* - (4 checkboxes left)
- merge rust.tf/95892 *Tracking Issue for \`sub\_ptr\` (feature \`ptr\_sub\_ptr\`)* - (6 checkboxes left)
- merge rust.tf/130801 *Tracking Issue for \`const\_mut\_cursor\`* - (4 checkboxes left)
- merge rust.tf/129041 *Tracking Issue for \`const\_vec\_string\_slice\`* - (4 checkboxes left)
[m-ou-se (13)](https://rfcbot.rs/fcp/m-ou-se), [scottmcm (2)](https://rfcbot.rs/fcp/scottmcm), [pnkfelix (2)](https://rfcbot.rs/fcp/pnkfelix), [dtolnay (3)](https://rfcbot.rs/fcp/dtolnay), [nikomatsakis (3)](https://rfcbot.rs/fcp/nikomatsakis), [Amanieu (6)](https://rfcbot.rs/fcp/Amanieu), [BurntSushi (15)](https://rfcbot.rs/fcp/BurntSushi), [traviscross (1)](https://rfcbot.rs/fcp/traviscross), [joshtriplett (10)](https://rfcbot.rs/fcp/joshtriplett), [tmandry (2)](https://rfcbot.rs/fcp/tmandry)
### (nominated) rust.tf/libs478 *\`file\_absolute!\` macro*
JoshT: The use cases are all things we should support, but not with file_absolute.
David: In some build systems, the absolute path ceases to exist right after compiling. Sandboxing. Remote execution.
David: There could be two paths: one to wherever file!() starts, and the other is file!(). The former could be `.` or the path to the library (in crates.io cache or w/e).
Use cases:
- [cargo test suite](https://github.com/rust-lang/cargo/blob/286b6d0efa1db67c17c1fbed1385e9829f09c1e6/tests/testsuite/cargo_add/add_multiple/mod.rs#L36). tests run relative to crate root, but file!() is relative to workspace root.
- [Bevy](https://github.com/bevyengine/bevy/blob/main/crates/bevy_asset/src/io/embedded/mod.rs): wants to embed a file into the binary; and also at runtime, watch that path for changes
For Cargo, it might work if `cargo test` supplies an environment variable that says what path to interpret `file!()` relative to. For Bevy, still not solved.
David: if Cargo compilations provided `env!("CARGO_WORKSPACE_DIR")` (similar to `env!("CARGO_MANIFEST_DIR")` which is already provided) would this be solved?
Josh: this was proposed to Cargo, and rejected, because Cargo prefers to leave it to rustc to say what rustc made `file!` relative to
David: rustc's `file!` is relative to rustc's current directory, and it's Cargo's prerogative what directory it chooses to run rustc in (namely the workspace root). Cargo should tell the project what directory it chose to run rustc in.
8472: what's the chance we can just change `file!`?
Josh: Maybe in an edition.
Or have Cargo pass a new flag to rustc that says what directory to make `file!` relative to. Cargo could start always passing that, or passing it depending on edition.
Amanieu: let's invite Ed to next meeting
### (nominated) rust.tf/104642 *Tracking Issue for get\_many\_mut*
Mara: there is not consensus in the issue over naming
Josh: get_n_mut > get_multi_mut > get_many_mut > get_multiple_mut
Mara: get_n_mut ≈ get_multiple_mut > get_multi_mut > get_many_mut
Amanieu: if we rename this one, the one on HashMap also needs to be renamed
TC: get_n_mut is shortest
8472: complaint about get_n_mut is that there is no 'n' argument, but there actually is (as (usually implicit) generic argument)
Josh: if the sentiment from the thread is "n" is too jargon, it seems fine to go with "many"
TC: repeat_n is a precedent. programmers understand te 'n' jargon.
_: also iterator.nth()
Amanieu: still prefer "many" over "n"
get_multi_mut seems to be acceptable to everyone
Mara: get_multi_mut or get_mut_multi?
Josh: postfix is usually a type modifier, e.g. _osstring
David: Yeah, like mut_ptr. not the case here.
Josh: Naming guideline, like as/into/etc. would be useful.
TC: +1
David: difference "n" (in repeat_n) and "multi" in (get_multi_mut): the latter is about upgrading get_mut to get_multi_mut.
Mara: What I like about get_mut_n or get_mut_multiple or get_muts, is that it autocompletes with get_mut.
The 8472: get_multi_mut and get_mut share a large prefix: get_mu.
Conclusion: amanieu to cancel fcp, restart for get_multi_mut. for both slice and hashmap.
### (nominated) rust.tf/125623 *Tracking Issue for \`lazy\_cell\_into\_inner\`*
Mara: Result<T, F> is a strange result type here
Amanieu: I might expect it to just return T, calling F if not yet called. For example like [BufWriter::into_inner](https://doc.rust-lang.org/std/io/struct.BufWriter.html#method.into_inner): first try to flush the buffer before returning.
Mara: For some other similar situations in std, we return Result<T, SpecificErrorType> where the error type can be turned in to the F with a method.
Josh: I think we should do that.
Amanieu: I think we should just always return T, just execute the function.
Mara: but then how would you get the current behavior of not calling F if not yet called? Both use cases make sense.
Josh: This is using Result as an 'Either'. just using the first available two-valued enum
Mara: provide both? A `force_into_inner` that returns T, and one equivalent to `into_inner` but under a better name
Josh: `into_inner` (T) and `into_parts` (enum).
Mara: We have `force` and `get`. These are the by-value versions.
Mara: Sounds like we don't want to stabilize the current thing as is, but solve the above first.
Amanieu: GitHub code search is not showing any uses of once_cell's equivalent of this (`into_value`)
Amanieu to reply proposing `force_into -> T`, and not exposing the other behavior for now
### (new change proposal) rust.tf/libs492 *Implementing \`AsRef\<T\> for T\` for all the stdlib's types*
Reject, too much potential for breakage.
### (new change proposal) rust.tf/libs490 *Infallible version of fetch\_update*
Accept `fetch_update_infallible`. We are open to alternative names.
### (stalled change proposal) rust.tf/libs330 *Add \`net::hostname\` to retrieve the devices host name*
Josh: Needs to use `io::Result`.
### (new change proposal) rust.tf/libs499 *slice contains subslice*
Proposal:
- `impl AsRef<[u8]> for OsStr/OsString/Path/PathBuf`
- `[u8]::find_bytes(bytes: impl AsRef<[u8]>)`
- `[u8]::find(bytes: impl AsRef<[u8]>)` ?
- `OsStr::find(substr: impl AsRef<OsStr>)`
Candidates to take from [`ByteSlice`](https://docs.rs/bstr/latest/bstr/trait.ByteSlice.html):
- `contains_bytes`
- `find_bytes`
- `rfind_bytes`
- `split_bytes`
- `rsplit_bytes`
- `split_once_bytes`
- `rsplit_once_bytes`
- `splitn_bytes`
- `rsplitn_bytes`
- `replace_bytes`
- `replacen_bytes`
- `starts_with_bytes`
- `ends_with_bytes`
- `matches_bytes`
- `rmatches_bytes`
- `match_indices_bytes`
- `rmatch_indices_bytes`
- `trim_start_matches_bytes`
- `trim_end_matches_bytes`
- `strip_prefix_bytes`
- `strip_suffix_bytes`
The 8472: `os_str.as_ref().find_bytes(osstr.as_ref())`
### (new change proposal) rust.tf/libs498 *TrySendError method to get the user data*
### (new change proposal) rust.tf/libs497 *Add \`Mutex\` and \`RwLock\` APIs for accessing values within a function scope*
### (new change proposal) rust.tf/libs495 *add an \`extract\` macro which extracts values matched in a pattern*
### (new change proposal) rust.tf/libs493 *\`CStr::from\_bytes\_with\_nul\` returns non\-actionable error result*
### (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/libs111 *Restructure ptr\_metadata to minimal support*
### (stalled change proposal) rust.tf/libs344 *ACP: Add \`std::string::String::replace\_and\_count\` and/or \`replace\_with\`*
### (stalled change proposal) rust.tf/libs311 *ACP: Pattern methods for \`OsStr\` without \`OsStr\` patterns*
### (stalled change proposal) rust.tf/libs296 *ACP: Designing an alternative \`FromStr\`*
### (stalled change proposal) rust.tf/libs201 *ACP: Provide \`TryFrom\<&\[T\]\>\` implementation for \`&\[\[T; N\]\]\`*
### (stalled change proposal) rust.tf/libs148 *Expose raw std{in,out,err}*
The 8472 to write an alternative ACP
### (stalled change proposal) rust.tf/libs316 *Add nearly in\-place case change methods to String*
### (stalled change proposal) rust.tf/libs360 *make FromResidual #\[fundamental\]*
### (stalled change proposal) rust.tf/libs336 *Add \`or\_try\_\*\` variants for HashMap and BTreeMap Entry APIs*
_Generated by [fully-automatic-rust-libs-team-triage-meeting-agenda-generator](https://github.com/rust-lang/libs-team/tree/main/tools/agenda-generator)_