rust-analyzer: not found error, while cargo check & build works fine
/Users/nick/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/test/src/test_result.rs:102:24
|
102 | Some(libc::SIGABRT) => TestResult::TrFailed,
| ^^^^^^^ not found in `libc`
rust-analyzer version: 0.4.1838-standalone (c06ca6cff 2024-02-11) + 0.3.1839-standalone (c06ca6cff 2024-02-11)
rustc version: rustc 1.78.0-nightly (b381d3ab2 2024-02-12)
OS: Mac(M1)
fresh project generated via: cargo generate esp-rs/esp-idf-template cargo
cargo build & check works fine and don’t throw this error, only r-a
if I remove the line in test_result.rs everything works fine and r-a finishes without an error
if you need further information or if I can do anything to narrow the scope down please just tell
About this issue
- Original URL
- State: closed
- Created 5 months ago
- Reactions: 4
- Comments: 20 (5 by maintainers)
I’m having the same issue, rust analyzer breaks when using an esp-idf project
@mrchantey I confirmed it: rust-analyzer works perfectly in esp-idf projects if you use rustc 1.77.0-nightly (2a3e63551 2023-12-30). The issue is rustc 1.78.0-nightly (ee9c7c940 2024-02-14).
Yes same got the error on an
esp-idfproject after updating rust nightly toSame problem here, temporarily I’m commenting out that offending line and it works:
seems plausible cause the line was added here, if I’m correct https://github.com/rust-lang/rust/commit/f622e832d41171578b6987d0b25b3a84d6d1c81c#diff-c91a894be23c4fb9ac51642c91c20500cdd48f7f0114b4b3c6a8a1cb47afa674
When I set the option
cargo.allTargetstofalse, this makes it work without patching the source. Indeed, passing--all-targetsimplies--tests.Doing this in my neovim+lazy.nvim setup works (for example) like this:
But note that this is only a workaround.
Enabling that setting does not resolve the issue.
Try setting
"rust-analyzer.cargo.allTargets": false,(needs latest nightly r-a, from 01.04.2024) if you are working on a no-std target. If you still run into that with that setting we’ll need more info.Pretty sure I was on the previous version
1.77.0-nightly