-
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 macro to make query providers greppable #117360
Conversation
r? @TaKO8Ki (rustbot has picked a reviewer for you, use r? to override) |
The job Click to see the possible cause of the failure (guessed by this bot)
|
This comment was marked as resolved.
This comment was marked as resolved.
rust analyzer works just fine on the RHS. I also made sure to make the macro contain valid rust exprs, letting rustfmt take care of formatting. |
☔ The latest upstream changes (presumably #117405) made this pull request unmergeable. Please resolve the merge conflicts. |
@@ -116,7 +116,7 @@ impl<'tcx> TyCtxtConsts<'tcx> { | |||
} | |||
|
|||
pub fn provide(providers: &mut Providers) { | |||
*providers = Providers { mir_borrowck, ..*providers }; | |||
query_provider!(providers, provide(mir_borrowck) = mir_borrowck); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about a simpler query_provide!(mir_borrowck, providers)
?
If we need to provide a closure, we add a simple let binding just above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with this opinion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closure inference hates this idea and makes this all really annoying, needing type annotations all over the place. Probably makes more sense to just turn the closures into functions instead, but that's some annoying manual effort that I don't feel like doing right now. Gonna work on this at a later point.
@rustbot author |
@Noratrieb any updates on this? thanks |
Closing this as inactive. Feel free to reöpen this pr or create a new pr if you get the time to work on this. Thanks |
implements https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/query.20provider.20definitions