-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use a macro to not have to copy-paste ConstFnMutClosure::new(&mut fold, NeverShortCircuit::wrap_mut_2_imp)).0
everywhere
#102300
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
(rust-highfive has picked a reviewer for you, use r? to override) |
…ld, NeverShortCircuit::wrap_mut_2_imp)).0` everywhere Also use that macro to replace a bunch of places that had custom closure-wrappers.
943048c
to
55492de
Compare
Yeah, I feel like my take is "we should not have landed the thing this macro avoids" (https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/const.20in.20the.20standard.20library). I feel like the macro is an improvement in some ways (obviously avoids duplication) but it's not really a way out; the places in std that use macros to avoid duplication are already a pain (e.g., integer methods) to review and edit changes to. But I agree this is an improvement on the current state. r=me though I would also prefer waiting for that Zulip discussion somewhat. |
I'm fine with waiting a bit -- I'll wait a couple days and see if the libs meeting reaches a conclusion. The macro should be much less painful here than for, say, the unsigned integers because this is only used in trait impls. That all the mess about the manual (Of course, what I really want is just to make this the default |
I doesn't seem like we got much a decision here in either libs or libs-api meeting this week, so I'm just going to merge this. Feel free to ping me on Zulip if something gets decided and I'll happily revert or update if needed. @bors r=Mark-Simulacrum |
Rollup of 6 pull requests Successful merges: - rust-lang#102300 (Use a macro to not have to copy-paste `ConstFnMutClosure::new(&mut fold, NeverShortCircuit::wrap_mut_2_imp)).0` everywhere) - rust-lang#102475 (unsafe keyword: trait examples and unsafe_op_in_unsafe_fn update) - rust-lang#102760 (Avoid repeated re-initialization of the BufReader buffer) - rust-lang#102764 (Check `WhereClauseReferencesSelf` after all other object safety checks) - rust-lang#102779 (Fix `type_of` ICE) - rust-lang#102780 (run Miri CI when std::sys changes) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Also use that macro to replace a bunch of places that had custom closure-wrappers.
+35 -114 sounds good to me.