Skip to content
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

rhai-autodocs fails to compile if rhai is using the no_float feature flag #29

Closed
VorpalBlade opened this issue Jul 3, 2024 · 4 comments · Fixed by #30
Closed

rhai-autodocs fails to compile if rhai is using the no_float feature flag #29

VorpalBlade opened this issue Jul 3, 2024 · 4 comments · Fixed by #30

Comments

@VorpalBlade
Copy link

If you use rhai with no_float, then rhai-autodocs doesn't build. Due to feature unification I don't think there is a way around this. Probably rhai-autodocs also need a no_float flag and to disable that float code if rhai is built without it?

error[E0412]: cannot find type `FLOAT` in crate `rhai`
   --> /home/arvid/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rhai-autodocs-0.6.1/src/function.rs:67:53
    |
67  |     let ty = ty.replace(std::any::type_name::<rhai::FLOAT>(), "float");
    |                                                     ^^^^^ not found in `rhai`
    |
note: found an item that was configured out
   --> /home/arvid/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rhai-1.19.0/src/lib.rs:198:10
    |
198 | pub type FLOAT = f64;
    |          ^^^^^
note: found an item that was configured out
   --> /home/arvid/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rhai-1.19.0/src/lib.rs:208:10
    |
208 | pub type FLOAT = f32;
    |          ^^^^^

For more information about this error, try `rustc --explain E0412`.
error: could not compile `rhai-autodocs` (lib) due to 1 previous error
@ltabis
Copy link
Owner

ltabis commented Jul 3, 2024

Hi @VorpalBlade, thank you for the report.
Mirroring Rhai's feature flag seems reasonable to me, so I made a quick PR here #30.
I tested it on my end and it seems to work fine, but I would encourage you to try it with your code.

@VorpalBlade
Copy link
Author

I seem unable to test it. Usually the following works:

[patch.crates-io]
rhai-autodocs = { git = "https://github.com/ltabis/rhai-autodocs.git", branch = "fix/feature_flags#29" }

I suspect cargo gets confused by the #? I tested url-encoding it as well to no avail.

@VorpalBlade
Copy link
Author

I cloned it and used a path override instead, this seems to have worked. Build and behaviour seems to work fine. Thanks!

@ltabis ltabis closed this as completed in #30 Jul 3, 2024
@ltabis
Copy link
Owner

ltabis commented Jul 3, 2024

You can use rhai-autodocs 0.6.2 now https://github.com/ltabis/rhai-autodocs/releases/tag/v0.6.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants