-
-
Notifications
You must be signed in to change notification settings - Fork 3.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
#[no_panic]
math
#16925
#[no_panic]
math
#16925
Conversation
Hmm, while a cool library, I'm not sure whether we actually want to use this. |
Perhaps |
I agree with @Victoronz and I also question what value this actually brings to Bevy users. It would be one thing if I would much prefer if we just:
|
It brings value to bevy engine developers, ideally. It points out where documentation is missing or where an algorithm might be improved. |
I'm against including this for everyone. It could maybe be an optional dependency with a dedicated step in CI to check it. It depends if the bevy_math people are interested enough in this. And it's not possible to merge this PR with this title |
The problem is that users will experience the errors, not us. If users report us compilation failures, we won't have a reliable way to fix them either, aside from just removing
Even if default compilation doesn't link them in, some non-default linker, codegen backend, dynamic linking, or compilation behavior might. I personally do not think preventing panics from being compiled in is worth obstructing day to day Rust usage. |
Based on the feedback, I was going to put it behind a config with a check in CI that uses that feature. |
I think this is a good idea. |
f687926
to
22a74f0
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.
Much better! Minor suggestion around making no_panic
an optional dependency. I also realised we can probably test the const
functions by wrapping them in a non-const
function and asserting that wrapper is #[no_panic]
.
Which then leads me to wonder, maybe a future PR could refactor all the no_panic
stuff into tests
instead, leaving no_panic
as a dev-dependency
. Outside scope for this PR IMO.
I like the idea of having both; I wish it didn't require code duplication, though. |
|
Objective
bevy_math
beingno_panic
would be cool.Solution
Add
#[no_panic]
to allpub fn
s.Testing
It compiles