rust-embedded / rust-embedded/heapless

Build error when compiling with `esp-idf`

Open
#599 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
2k
Forks
253
Avg merge
1d 2h
Merged PRs (30d)
1

Description

I get this error:

error[E0223]: ambiguous associated type
   --> /home/esp/.cargo/registry/src/index.crates.io-6f17d22bba15001f/heapless-0.9.1/src/c_string.rs:181:17
    |
181 |             Err(FromBytesWithNulError::InteriorNul { position }) => {
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
help: if there were a trait named `Example` with associated type `InteriorNul` implemented for `FromBytesWithNulError`, you could use the fully-qualified path
    |
181 |             Err(<FromBytesWithNulError as Example>::InteriorNul { position }) => {
    |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0599]: no associated item named `NotNulTerminated` found for struct `FromBytesWithNulError` in the current scope
   --> /home/esp/.cargo/registry/src/index.crates.io-6f17d22bba15001f/heapless-0.9.1/src/c_string.rs:184:40
    |
184 |             Err(FromBytesWithNulError::NotNulTerminated) => {
    |                                        ^^^^^^^^^^^^^^^^ associated item not found in `FromBytesWithNulError`

Which seems to be coming from this package.

This happens when using with HistoryBuf to be more exact

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the build with esp-idf and HistoryBuf, then inspect heapless-0.9.1/src/c_string.rs around lines 181 and 184 where the reported errors occur. Compare the available FromBytesWithNulError items with the failing patterns; done means the same HistoryBuf build compiles without these errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.