Closed leonjia0112 closed 5 years ago
Try building it in release mode or with:
[profile.dev]
opt-level = 1
Binary crates typically require some optimization to eliminate panic codepaths (while library crates often do not).
Thanks for your info. Good to know the panic difference between bin and lib. 👍
Are you going to update this crate to compatible with regular cargo build
for the binary crate in the future?
This can't be changed in this crate. The compiler is what performs the relevant optimization. It's not clear that we want the compiler to perform any additional optimization when building with opt-level = 0. I believe setting opt-level = 1 is the correct solution. Will add a note to the documentation.
You are right. Setting the optimization level would solve this problem. Thanks.
My rustc version is
1.31.0
. I tried the example in the doc but it still panic with the linker error.Even this code would have a linker error
Is something wrong with my usage or the crate itself?