zed
zed copied to clipboard
Linting errors for implementation of panic handling with `no_std`
Check for existing issues
- [X] Completed
Describe the bug / provide steps to reproduce it
I am trying to implement panic handling with no_std
, targeting wasm. I have the following implementation:
#![no_std]
#[panic_handler]
fn handle_panic(_: &core::panic::PanicInfo) -> ! {
loop {}
}
I receive the following error in zed for the handle_panic
function:
E0152
found duplicate lang item panic_impl
the lang item is first defined in crate std (which test depends on)...
I don't have any crate called test
. My build .cargo/config.toml
look like the following:
[build]
target = "wasm32-unknown-unknown"
[profile.dev]
opt-level = 0
debug = true
[profile.release]
opt-level = 3
debug = false
I have tried setting rust-analyzer
properties in my zed settings (cargo.target = "wasm32-unknwon-unknown
, and checkOnSave.targets = false
, to no avail.)
Environment
Zed 0.66.1 – /Applications/Zed.app macOS 12.6 architecture x86_64
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your ~/Library/Logs/Zed/Zed.log
file to this issue
No response
Same issue here. Any solution found yet ?
Not from my side. On Linux now and not using zed until there is a release.
Found the solution! Add the following to settings.json
:
"lsp": {
"rust-analyzer": {
"initialization_options": {
"check": {
"allTargets": false
}
}
}
}