Closed cicilzx closed 4 months ago
This is intentional. (And is a link error not a panic)
The tests are using the crate no-panic
to assert that it is impossible for the hasher to cause a panic. This works by writing a test where a macro injects a call to a non-existent library inside of a panic catch block. Then if the optimizer is able to prove this code is unreachable it will be deleted and no link error will occur. For this to work the optimizer usually needs to be turned up to at least O2.
Hi, I've noticed that when running test cases for this crate, I get linking errors when using certain specific optimization levels, not sure if it's a problem with the crate or with rustc.
I am using cargo version:
cargo 1.77.0-nightly (7bb7b5395 2024-01-20)
, and below is an example of triggering the issue.By using the following command:
The tests will run successfully like this:
However, if I change the optimization level to 0/1/z, for example, with the command:
It will produce the follow panic: