-
Notifications
You must be signed in to change notification settings - Fork 468
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
Deny the unimplemented!
macro, it is too similar to unsupported!
#7999
Deny the unimplemented!
macro, it is too similar to unsupported!
#7999
Conversation
unsupported!
unimplemented!
macro, it is too similar to unsupported!
`unimplemented!` has almost made it through code review in a place that `unsupported` was intended at least once, despite 5 people performing code review (MaterializeInc#7507). The unimplemented macro is just shorthand around `panic!("unimplemented");` so require that if folks really want to panic.
d9d0418
to
45c89c6
Compare
TIL! +1 |
All those existing uses of So concretely: what if we instead renamed the |
yeah I'll just add that I use |
Is this a punishment, or just being more explicit? The problem isn't just that
You're still allowed to use it locally (same as |
I think there are two separate discussions to be had here:
I think (1) is not contentious. I'd maybe even advocate for making that a function that returns an error instead, and then changing the call sites to manually return the error: Re (2), I am not convinced that this is a persistent source of confusion that needs to be addressed by banning use of
It just doesn't seem to me like |
Additional data point, it seems the idiom that's developed in the rust community (citation needed) is that I'm personally also against this change. As Nikhil says, the current uses of |
No strong opinions on this. But if we end up not doing this, +1 on renaming |
@benesch and I discussed this and came to what we think is a reasonable consensus:
|
Here's the commit to do (1) per @umanwizard's suggestion: #8001 |
I'm in support of this philosophy, but it's unfortunately going to be harder to enforce than described here. The |
Can we just override it with an |
The principled solution seems to be: put that behind a feature flag, and have the crates that rely on it turn on that feature flag only for their test dependencies. But that's a lot of hassle for marginal benefit, IMO. Really, this (and some other things about our build process, like dead code detection, mandatory docs, etc.) are made more complicated by the fact that the crate is not intended to be a meaningful abstraction boundary in Materialize, and we have split ourselves into crates somewhat arbitrarily as a hack to improve compile times. |
Right, my general feeling is:
That leaves just |
FWIW I didn't expect this to have this much conversation, I very much believe that the |
@quodlibetor I'm still in favor of adding the lint, if there's a reasonable way to ignore it for the DummyCatalog case! |
Yeah I mean we could |
unimplemented!
has almost made it through code review in a place thatunsupported
was intended at least once, despite 5 people performing codereview (#7507). The unimplemented macro is just shorthand around
panic!("unimplemented");
so require that if folks really want to panic.