Open amcelroy opened 6 months ago
I have just encountered this issue as well.
The problem is that the lvgl
crate includes its own implementation of Box
(which represents memory allocations managed by LVGL). This implementation includes into_raw() as an instance method (with self
), contrary to Rust's implementation as an associated function (without self
) and thus must be used as Box::into_raw(...)
. This is intentionally done by the language designers to avoid confusion in cases where the inner type might define "into_raw" as an instance method of its own.
When the lvgl_alloc
feature is activated, the LVGL memory management code takes over as the global allocator. This makes the LVGL custom Box
type redundant since all boxes are in LVGL's heap already. So LVGL just switches over to the standard alloc
implementation instead. But .into_raw() is not the correct way to access real boxes, leading to this error.
To resolve this issue, the LVGL box should be updated to match the Rust convention of making into_raw
an associated function, not an instance method. Eventually, when the allocator_api
language feature is stabilized, the core Box
type will allow boxes to live in allocators besides the global one, and LVGL should remove its bespoke Box
type in favor of this new mechanism.
Hi,
I'm trying to use the latest version of the repo that uses
embedded-graphics
version 0.8.0. The crates.io version oflvgl
(version 0.6.2) seems to be usingembedded-graphics
version 0.7.1 and is causing dependency collisions. TheCargo.toml
for the project looks like:However, the following error is generated:
Edit: My build command is: