# Libs-API Meeting 2024-12-10 ###### tags: `Libs Meetings` `Minutes` **Meeting Link**: https://meet.jit.si/rust-libs-meeting-crxoz2at8hiccp7b3ixf89qgxfymlbwr **Attendees**: Amanieu, Mara, David, The 8472, Chris Denton, Josh Triplett ## Agenda - Triage - Anything else? ## Triage ### FCPs 17 rust-lang/rust T-libs-api FCPs - 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/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 for 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\`)* - (3 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) - merge rust.tf/104642 *Tracking Issue for get\_many\_mut* - (3 checkboxes left) - merge rust.tf/97601 *Tracking Issue for map\_many\_mut* - (3 checkboxes left) [dtolnay (4)](https://rfcbot.rs/fcp/dtolnay), [BurntSushi (15)](https://rfcbot.rs/fcp/BurntSushi), [pnkfelix (2)](https://rfcbot.rs/fcp/pnkfelix), [joshtriplett (11)](https://rfcbot.rs/fcp/joshtriplett), [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), [scottmcm (2)](https://rfcbot.rs/fcp/scottmcm), [tmandry (1)](https://rfcbot.rs/fcp/tmandry) ### (nominated) rust.tf/libs292 *Add an \`unsafe fn\` for creating a ZST* Mara: This got stuck a year ago on deciding whether it should support being instantiated with a non-zero-sized type in a not-taken branch Example usage: https://github.com/rust-lang/rust/blob/4654a910018cf0447db1edb2a46a0cae5f7dff8e/library/core/src/array/mod.rs#L801-L804 The 8472: another example: https://github.com/rust-lang/rust/blob/4654a910018cf0447db1edb2a46a0cae5f7dff8e/library/alloc/src/vec/into_iter.rs#L145 Josh: if we implement it originally as compile time checked, then change to runtime checked, that is not a breaking change. The reverse is a breaking change. 8472: not exactly, it might still be considered a breaking change. Generic code would need to propagate the bounds that it intended under its original compile-time checked implementation Amanieu: counterproposal: restrict it to being instantiated only with a concrete type, not generic type. transmute currently has this restriction. David: counterproposal: compile-time checking if instantiated with a concrete type (equivalent to a deny-by-default lint), runtime checking if instantiated with a generic type parameter David to comment ### (nominated) rust.tf/libs478 *\`file\_absolute!\` macro* Defer to a meeting with Ed invited, if possible Mara: regarding [Ed's question](https://github.com/rust-lang/libs-team/issues/478#issuecomment-2517543156)? just FCP on a PR? answer: please send a PR with a doc update. It will need compiler and/or lang FCP; probably not libs-api ### (nominated) rust.tf/libs500 *stdio \`set\`, \`close\` and \`take\` methods* Josh: one aspect we had talked about is that in addition to a unix-specific set of APIs with `OwnedFd`, we might also (or instead?) want a cross-platform one that operates on `File` Amanieu: should there be a `replace`? which returns the old handle, unlike `set` 8472: for `take` there are 3 options in the case that `set` was called with something that is not representable as `File`, such as console on Windows. 1: return error, 2: return some dedicated `ConsoleFile` type that can handle all the possibilities, 3: return `File`, but the file you get will return errors in unexpected places. Amanieu: not "return errors in unexpected places". `write` will work because you can write bytes to a console. But conversions from utf8 will not kick in, you will get random binary garbage. The Windows console does not take utf8, it takes bytes and interprets some other encoding depending on the configuration of the console Josh: On Windows 11 or very recent Windows 10 I suspect it will usually behave the right way by default Chris: I don't think utf8 is console's default encoding, still Josh: Is there any way `take` could cause it to take utf8 on write? SetConsoleOutputCP 8472: so we can make `take` returning `File` just work? Is encoding a global thing or specific to a handle? `take` can check if the handle is a console and do the thing Amanieu: must still return Result because embedded platforms exist where standard output is very not a `File` Amanieu: if we can always convert standard stream into a `File`, is there still any need for the OS-specific StdioExt? Mara: `OwnedFd` and `File` are separate types for a reason, not sure if I would want the API conflating them in this way ---- Discussion about whether `replace` can be implemented in atomic manner Amanieu: I like `take_file`, `close`, `set_file`, `replace_file` 8472: Do we need OwnedFd functions? Josh: Yes Amanieu: propose renaming `set` to `set_fd` and `set_handle` according to platform `take_fd`? Josh: `.take_file()?.into()` Consensus on `take_file`, `close`, `set_file`, `replace_file`, `set_fd`, `set_handle` ### (nominated) rust.tf/104642 *Tracking Issue for get\_many\_mut* Last meeting, we started FCP for `get_multi_mut`. Since then, new sugestion with 7 :+1:: `get_disjoint_mut` > In slotmap this functionality is called `get_disjoint_mut` to emphasize that the keys must be disjoint. I think this is also an appropriate choice here, the indices must be disjoint. David: I suggested `get_nonoverlapping_mut`; this is a better version of that. Amanieu: We have is_disjoint on HashSet David: Not worried about that. The 8472: Can we have a lang feature that allows us to change the name of a method every week? Consensus: Restart FCP with `get_disjoint_mut`. ### (nominated) rust.tf/132975 *De\-duplicate and improve definition of core::ffi::c\_char* This is a breaking change for some tier 2/3 platforms But it makes it more consistent with clang/llvm. List of broken targets: https://github.com/rust-lang/rust/issues/129945 Amanieu: I consider this a fix, we should merge it Mara: Yeah, but be prepared to revert. Josh: let's time it early in a release cycle so it's on nightly for as long as possible before stabilizing the breaking change Amanieu: this is overwhelmingly `unknown` targets which do not interact with C much anyway ### (nominated) rust.tf/133829 *AtomicT::fetch\_update\_infallible* ### (new change proposal) rust.tf/libs501 *ACP: Add floating point representation conversions* ### (new change proposal) rust.tf/libs499 *slice contains subslice* 1b, accepts-2, consider 5 in the future. Accepted Some discussion about criteria to accept `BStr`/`BString`. ### (new change proposal) rust.tf/libs498 *TrySendError method to get the user data* Accept 8472: should this go upstream in crossbeam too? Yes ### (new change proposal) rust.tf/libs497 *Add \`Mutex\` and \`RwLock\` APIs for accessing values within a function scope* Old attempt: https://github.com/rust-lang/rust/pull/61976 ### (new change proposal) rust.tf/libs495 *add an \`extract\` macro which extracts values matched in a pattern* Inclined to close ### (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\`)* ### (new change proposal) rust.tf/libs482 *Docs \- type guarantees update* ### (stalled change proposal) rust.tf/libs253 *Provide way to deconstruct std::iter::Rev* ### (stalled change proposal) rust.tf/libs311 *ACP: Pattern methods for \`OsStr\` without \`OsStr\` patterns* Josh to comment and accept ### (stalled change proposal) rust.tf/libs331 *Support permanently skipping tests on a specific system* ### (stalled change proposal) rust.tf/libs357 *ACP: \`std::collections::{hash\_map, btree\_map}::Entry::{is\_vacant, is\_occupied}\`* ### (stalled change proposal) rust.tf/libs111 *Restructure ptr\_metadata to minimal support* ### (stalled change proposal) rust.tf/libs131 *Add \`std::fs::rename\_noreplace\`* ### (stalled change proposal) rust.tf/libs181 *\`Cow::map\_borrowed\`, \`Cow::map\_owned\`, and \`Cow::map\`* ### (stalled change proposal) rust.tf/libs295 *Create iterator function in std libs: split\_item\_mut()* ### (stalled change proposal) rust.tf/libs347 *Context reactor hook* ### (stalled change proposal) rust.tf/libs277 *\[ACP\] RangeBounds::overlaps* _Generated by [fully-automatic-rust-libs-team-triage-meeting-agenda-generator](https://github.com/rust-lang/libs-team/tree/main/tools/agenda-generator)_