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.54k stars 600 forks source link

Compilation fails for some std-widgets in no_std #2510

Closed medhefgo closed 1 year ago

medhefgo commented 1 year ago

At least these widgets will cause compilation to fail under no_std: CheckBox, ComboBox, SpinBox, StandardTableView

Excerpt of the compilation failure:

error[E0433]: failed to resolve: use of undeclared type `Path`
   --> /home/medhefgo/slint/target/x86_64-unknown-uefi/debug/build/uefi-demo-a34c6c6fb9018316/out/demo.rs:838:16
    |
838 |              + r#Path :: FIELD_OFFSETS . r#elements) . apply_pin (_self) . set ({
    |                ^^^^^^ use of undeclared type `Path`

This is easy to reproduce with https://github.com/slint-ui/slint/pull/2509 by simply adding any affected widget to the demo.slint file.

tronical commented 1 year ago

Yes indeed, this is basically the same issue as #2026 : The software renderer does not support Path rendering at the moment, which is why the Path element is not included in the no_std builds. Once the software renderer supports it, we can remove the #[cfg(feature = "std")] guard from mod path; in items.rs.

Closing this as a duplicate for now (but a very legit issue, of course :)