-
Notifications
You must be signed in to change notification settings - Fork 957
Implement more complete backend selection #4118
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
Conversation
2f3a3a5
to
3bfb0ff
Compare
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 think this is better now but still a bit less clear then I'd like. Maybe that's unavoidable. Perhaps using cfg!
instead of #[cfg]
would help but perhaps not.
As it is, I'd be ok approving this but I'd want to hear @rami3l's thoughts first.
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.
@djc Thanks for your efforts!
I do think the new version looks much better for two reasons:
- It's clear why each conditional branch is doing certain things (and thus making the review easier).
- If I'd like remove a feature flag (I hope this won't be too far in the future), I can easily figure out what parts of the code to rip off.
@ChrisDenton We have 7 cfg
s (2 ^ 3 backend stacks - 1 won't build, if I'm not mistaken) to consider in this piece of code, so unfortunately it will be very long if it was made absolutely plain. My guess is that we'll start to deprecate backends shortly, so this seems bearable.
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.
We have 7 cfgs (2 ^ 3 backend stacks - 1 won't build, if I'm not mistaken) to consider in this piece of code, so unfortunately it will be very long if it was made absolutely plain. My guess is that we'll start to deprecate backends shortly, so this seems bearable.
That's fair.
@djc I think this is where |
I agree that this might not be the optimal encoding but I'm also inclined to spend a bunch more time on it -- this takes care of covering all the cases with reasonably good feedback for the user, and I think that's a good improvement over the status quo. For me, the code isn't bad enough that it's worth investing much more in. |
So brought this back to a single |
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'm fine with this version and in any case I agree it's not worth spending more time on tbh.
Feedback from #4105.