Conversation
It's just an unnecessary level of additional nesting. rust-lang#151893 did the same thing for the `define_callbacks` macro.
Specifically `define_callbacks` and `define_queries`. These are big, complicated macros. If the top-level `$(..)*` repetitions are obvious it helps enormously with readability.
It's a unit type used for trait stuff, it doesn't need a lifetime. (Unless there's some weird variance thing I'm unaware of, but it compiles fine, so I think it should be ok.)
|
|
I find that the
In #151893 it’s less necessary because |
|
I agree with giving The exception I sometimes make is for relatively simple struct field declarations and struct/slice initialisation. If the whole thing can clearly and comfortably fit on one line, then I tend to prefer this more compact style: Struct {
$( $name: FieldType<$name::Thing>, )*
}(Take this as a suggestion rather than a request for changes; use it if you agree it’s an improvement in particular places, but otherwise the fully-indented style is fine.) |
| pub(crate) struct QueryType<'tcx> { | ||
| data: PhantomData<&'tcx ()> | ||
| } | ||
| pub(crate) struct QueryType; |
There was a problem hiding this comment.
Remark: I intend to dismantle and remove QueryDispatcherUnerased (and therefore QueryType) at some point, but no harm in simplifying this now.
|
☔ The latest upstream changes (presumably #152437) made this pull request unmergeable. Please resolve the merge conflicts. |
|
I have filed #152459 as an alternative to the first commit in this PR. It aims to make |
Some readability improvements.
r? @Zalathar