Closed JuliDi closed 1 year ago
I am experiencing the same problem.
Ok, so I am still new to Rust and a hardly know what I am doing here, but it seems to work, so here it is:
After some searching I found this Reddit post, which says that the feature must be enabled using
#![feature(generic_associated_types)]
in order to work.
The error says the problem occurs in this file: ~/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-io-0.3.1/src/asynch.rs
, so I opened the src
directory containing the asynch.rs
and added the before-mentioned line
#![feature(generic_associated_types)]
to the top of the lib.rs
file.
Now it works for me. I don't really think that this is a solution, but I also don't think that it can break much either, as you can always just delete the ~/.cargo/registry/
directory to revert this change. Hope this might help!
Thanks for the hint! I was thinking about doing what the compiler suggests, as well. However, this can't be a permanent solution. FYI you do not need to mess with the registry afaik, if you use this https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#testing-a-bugfix
So either embedded-io needs to fix this (which I doubt, because there v0.3.1 is very recent and fixes some issue with nightly), or this repo needs some change – but I have no clue which.
Moreover, it doesn't work on the docker container either. There is an issue with rustc being too old (1.61 and comfy-table needs 1.62 or newer) when installing cargo-espflash. Some crate in the dependency tree apparently causes a lot of trouble.
Thanks for the explanation!
Just as an info for anyone else encountering the issue, the following steps can be used as a workaround:
embedded-io/src/lib.rs
add the following code at the top of the file:
#![feature(generic_associated_types)]
intro/hardware-check/Cargo.toml
add the following lines at the end
[patch.crates-io]
embedded-io = { path = "/path/to/embedded-io"}
Easier temp solution than cloning repo. Just override to a prev package version.
[patch.crates-io]
embedded-io = { git = "https://github.com/embassy-rs/embedded-io.git", tag = "v0.3.0"}
and then cargo update
Thanks to @elotom https://github.com/ivmarkov/rust-esp32-std-demo/issues/123#issuecomment-1300522982
Thanks @fakeplant ! Works like a charm. Embedded-io is now at release 0.4.0 but the issue seems to persist.
This should now be fixed with #125
After following the instructions in the book, I tried building the Hello Board project with
cargo build --target riscv32imc-esp-espidf
. The build then fails with many errors of the following type:My rust toolchain is up to date and the specific version requested in the book is available: