Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clippy error in test_result.rs #231

Closed
armandas opened this issue Aug 25, 2024 · 7 comments
Closed

Clippy error in test_result.rs #231

armandas opened this issue Aug 25, 2024 · 7 comments

Comments

@armandas
Copy link

When I run clippy on my project, I get the following error:

error[E0308]: mismatched types
   --> /home/armandas/.rustup/toolchains/esp/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`

Meta

rustc --version --verbose:

rustc 1.80.0-nightly (1b259e0b8 2024-07-22) (1.80.0.0)
binary: rustc
commit-hash: 1b259e0b8b2129dd3d62819a32f6d9b287e6b86c
commit-date: 2024-07-22
host: x86_64-unknown-linux-gnu
release: 1.80.0-nightly
LLVM version: 17.0.1

@cs-clarence
Copy link

i have this issue too

1 similar comment
@gentean
Copy link

gentean commented Oct 23, 2024

i have this issue too

@MabezDev
Copy link
Member

Does this still occur on the latest 1.82 toolchain?

@MabezDev
Copy link
Member

If someone could set up a min repro for me, that would be most useful.

@armandas
Copy link
Author

@MabezDev

I was trying to reproduce it on the esp-idf-template, but could not. After checking the differences between my project and the template, I found the lines below. The change was added in May (PR: esp-rs/esp-idf-template#212) and fixes the issue:

[[bin]]
name = "project-name"
harness = false # do not use the built in cargo test harness -> resolve rust-analyzer errors

As such, it's probably OK to close this?

@github-project-automation github-project-automation bot moved this from Todo to Done in esp-rs Oct 29, 2024
@cs-clarence
Copy link

cs-clarence commented Nov 10, 2024

@MabezDev

I was trying to reproduce it on the esp-idf-template, but could not. After checking the differences between my project and the template, I found the lines below. The change was added in May (PR: esp-rs/esp-idf-template#212) and fixes the issue:

[[bin]]
name = "project-name"
harness = false # do not use the built in cargo test harness -> resolve rust-analyzer errors

As such, it's probably OK to close this?

still not fixed for me, i'm using an old project that worked before but not working now after i updated, i found a related pr for this #232

i'm trying to make a minimal repro but it's hard to pinpoint what exactly is causing it

@cs-clarence
Copy link

cs-clarence commented Nov 10, 2024

i think i finally got a reproduction here

https://github.com/cs-clarence/esp-rs-min-repro

@MabezDev

MCU: esp32s3
Rust Version: 1.82
Edition: 2021

Steps to reproduce:

  1. Generate a project cargo generate esp-rs/esp-idf-template cargo
  2. Create a lib.rs in src folder
  3. Restart rust analyzer

image

Filed a new issue here #244

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

5 participants
@armandas @MabezDev @gentean @cs-clarence and others