fmckeogh / usb-pd-rs

USB-PD and associated hardware driver libraries in Rust
MIT License
19 stars 4 forks source link

Fix rust-analyzer error test #21

Closed okhsunrog closed 4 months ago

okhsunrog commented 4 months ago

When adding this project to RustRover IDE or VS Code rust-analyzer runs on project sync. It fails with this message:

error[E0308]: mismatched types
   --> /home/okhsunrog/.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`

I suggest adding harness = false to disable these checks. You can take a look here, for example: https://github.com/rust-lang/rust/issues/125714 https://github.com/esp-rs/esp-idf-template/commit/d084765561bd827d94eece13dedec90e97928e99

The commit in my branch fixes the issue.

fmckeogh commented 4 months ago

LGTM, thanks! Do you mind fixing the CI error and I'll merge this in?:)

okhsunrog commented 4 months ago

Sure, I'll fix it

okhsunrog commented 4 months ago

fixed