Skip to content

compilation failure with "cargo check --tests" for espidf #125714

@benstockil

Description

@benstockil

Running cargo check --tests fails to compile test for the esp-idf-template (tested on mcu esp32-c3, default template options).

   Compiling test v0.0.0 (/home/ben/.local/share/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/test)
error[E0308]: mismatched types
   --> /home/ben/.local/share/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/test/src/test_result.rs:102:18
    |
101 |         None => match status.signal() {
    |                       --------------- this expression has type `Option<i32>`
102 |             Some(libc::SIGABRT) => TestResult::TrFailed,
    |                  ^^^^^^^^^^^^^ expected `i32`, found `usize`

For more information about this error, try `rustc --explain E0308`.
error: could not compile `test` (lib) due to 1 previous error

rust-lang/libc#3658 introduced these constants for espidf, where previously the error was a missing constant altogether (rust-lang/rust-analyzer#16552).

Steps to Reproduce

  • cargo generate esp-rs/esp-idf-template cargo
    • Which MCU to target?: esp32c3
    • Configure advanced template options?: false
  • cd <project name> && cargo check --tests

Meta

rustc --version --verbose:

rustc 1.80.0-nightly (da159eb33 2024-05-28)
binary: rustc
commit-hash: da159eb331b27df528185c616b394bb0e1d2a4bd
commit-date: 2024-05-28
host: x86_64-unknown-linux-gnu
release: 1.80.0-nightly
LLVM version: 18.1.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.O-ESP-IDFTarget: Espressif IoT Development FrameworkT-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions