slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.72k stars 615 forks source link

Error running `cargo doc` with non-default features #5743

Closed Enyium closed 4 months ago

Enyium commented 4 months ago

I turned default features off with default-features = false in Cargo.toml and didn't enable the renderer-software feature. Then I ran cargo doc and got the following error:

error[E0432]: unresolved import `crate::platform::software_renderer`
   --> C:\Users\redacted\.cargo\registry\src\index.crates.io-6f17d22bba15001f\slint-1.7.1\docs.rs:150:26
    |
150 |     use crate::platform::software_renderer::*;
    |                          ^^^^^^^^^^^^^^^^^ could not find `software_renderer` in `platform`

Adding the renderer-software feature fixed the problem. Seems to me like there's a conditional-compilation directive missing.


See #5742 for the reason why I wanted to see the docs. The feature set at that point was just what I previously settled on.

Exact dependency line:

slint = { version = "1.7.1", default-features = false, features = ["compat-1-2", "std", "gettext", "accessibility", "backend-winit", "renderer-skia"] }
ogoffart commented 4 months ago

Thanks for reporting the issue. Fixed with commit https://github.com/slint-ui/slint/commit/195a54359c11249ccfba4bf41e5a830bb94221c2