Libs Meetings
Minutes
Meeting Link: https://meet.jit.si/rust-libs-meeting-crxoz2at8hiccp7b3ixf89qgxfymlbwr
Attendees: Amanieu, David, Josh Triplett, Mara, Eric Holk, Chris Denton
14 rust-lang/rust T-libs-api FCPs
tmandry (1), joshtriplett (9), Amanieu (3), m-ou-se (9), nikomatsakis (3), BurntSushi (10), scottmcm (3), dtolnay (1), yaahc (2), pnkfelix (2)
FCP close, as discussed last week
Amanieu to start FCP:
Discussion from last week: https://github.com/rust-lang/rust/issues/125319#issuecomment-2203697058
Looks acceptable, as expected.
For the future, we should do crater runs on PRs making "acceptable breakage" changes, and if we don't realize that and get notified of the breakage later, we should revert first and then do a PR re-adding the change with a crater run.
David to comment that we consider this acceptable breakage.
You could turbofish the stable methods that take a Pattern. Those methods are stable, even though the trait is unstable
Amanieu: throw it at crater
API design struggles: https://github.com/rust-lang/rfcs/pull/3301#issuecomment-2206131327
Amanieu to look at it async.
Nominated for WG-async. Is there anything we can do?
Eric Holk still working on comprehensive async iteration RFC
Mara: Sounds good. +1
Implementation might be tricky. Doesn't fit in today's implementation. Would need a different Once
.
Amanieu: Regardless of implementation, if this was possible, would we want this API?
Mara: +1
Josh: +1
Josh: Would be nice if we had an async .await version of this as well. (Separate proposal.)
David: Also on Once then?
Amanieu: +1
Mara: +1
Mara replied.
What would happen on emiting diagnostics from a proc_macro outside proc macro context?
David: Should that just print the message without the span?
Amanieu: i think it should panic
David: TokenStream::expand_expr() wouldn't be able to work. Although that one returns a Result..
Josh: Why would you want to use this in a build script?
David: Bindgen uses it to generate Rust code. Protobuf crates as well.
Internals forum thread about "syn in proc_macro": https://internals.rust-lang.org/t/how-can-we-improve-proc-macro-without-dependencies/19996
Next step: Ask which behaviour they are exactly changing. Not everything is possible outside proc macro context, so somethings will still need to error/panic. Need an overview of what will and won't work.
David: Implementation strategy: One way is to make everything an enum { Real(..), Fallback(..) }
. Alternative is to keep the 'everything is a handle' implementation and lazily spawn a rustc/host.
Josh: Or a compile time cfg solution.
Mara: That'd need recompiling the entire dep tree (e.g. syn etc.) for using the proc macro in a different context.
David: Could be doable
Josh: David, is there a path where proc_macro2 would no longer duplicate this if we go down this path?
David: Don't think so, proc_macro2 adds more than just this. We backport new APIs and emulate it on old rust versions.
Josh: Handles could be opaque pointers whose meaning depends on whether in compiler context or not.
Amanieu: Or 32 bit indexes that are either compiler handles or an index into a global vec.
David: Yeah that'd work.
Josh to reply.
Mara: So… the &**
operator.
Mara: Useful for Option<&String>
to Option<&str>
.
David: I don't think it has much value, because it only replaces just one call to map
.
David: Should we have a way to do &**
more conveniently? I do that all the time. E.g. match with box. Could use .deref().
David: Add Deref trait to prelude in 2024?
Amanieu: as_deref_inner is inscrutable. Not clear. I don't see how you'd go from having this problem to finding this as your solution
Josh: +1. Also don't want to come across this when reading someone's code. Less readable than e.g. .map(|x| x.as_str())
.
Conclusion: We don't want this because it's not very clear/readable.
Mara replied and closed.
Mara: .contains() taking by reference would lead to a double reference in [].iter().contains(&&1)
.. just .any()
might be better?
Itertools uses Borrow+PartialEq
rather than Item: PartialEq<Q>
.. https://github.com/rust-itertools/itertools/pull/514 Unclear why. Mistake?
David: Probably because of a missing : ?Sized
.
We would want &Q
with Self::Item: PartialEq<Q>
with Q: ?Sized
.
Mara: Not sure if this provides enough value over any
with || ==
.
Amanieu+Josh: I think it provides enough value
David: Agree with Mara.
Mara: Happy to see it as unstable though, but let's set the right expectations.
Amanieu to reply.
Mara: BufRead::fill_buf is blocking.. so if you want something nonblocking, you should start there?
Amanieu: I don't think it's the BufRead's job to decide if something is blocking. The underlying socket can be blocking or not.
Mara: This ACP is impossible. You cannot implement it in terms of fill_buf+consume, which are the only required methods.
Mara: I guess they might want it on BufReader.
Mara replied.
We're not closer than last year in having ==
work. So accepted.
Mara replied.
Amanieu: I'd reject all of it
Mara: I'd accept all except Wrapping and Saturating
Josh: Same
https://github.com/rust-lang/libs-team/issues/130 is only for unsigned NonZero
Mara: Accept for NonZero only?
That proposal is only for unsigned..
Step for signed NonZero steps over 0??
David: We do that for char already
Josh: Accept for all NonZero
Amanieu: I'd accept 130, only unsigned.
Josh: Why would you think signed NonZero would be a mistake?
Mara: I also don't think we should have Step on signed.. It's very easy to miss that that would silently skip over the zero.
Conclusion: Accept 130.
Reject this one.
Seems fine.
Also DebugSet.
Amanieu to reply.
Not interested in write_fmt
inherent method that returns Result. Not viable to add write_fmt
inherent method that returns ().
Counterproposal: += format_args!(...)
, needs PR and crater run
Generated by fully-automatic-rust-libs-team-triage-meeting-agenda-generator