Closed xbladesub closed 1 year ago
I have the same issue using thiserror::Error
on the latest nightly build
I upgraded my rust version and got similar errors for bevy::{AsBindGroup, TypeUuid}
, sqlx::FromRow
and serde::{Serialize, Deserialize}
. Currently using astro-nvim 3.1.1. with the following config init.lua
in my user config
return {
lsp = {
setup_handlers = {
-- add custom handler
rust_analyzer = function(_, opts) require("rust-tools").setup { server = opts } end
},
},
plugins = {
{
"simrat39/rust-tools.nvim", -- add lsp plugin
opts = {
['rust-analyzer'] = {
procMacro = {
enable = true,
},
}
},
},
{
"williamboman/mason-lspconfig.nvim",
opts = {
ensure_installed = { "rust_analyzer" },
},
},
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = { "lua" },
},
},
},
}
I got the same error and it was fixed after upgrading rust-analyzer
- I'm using version 0.3.1443-standalone
now.
The process was the same as installing: https://rust-analyzer.github.io/manual.html#installation
Can confirm. Upgrading rust-analyzer seems to fix the problem.
I have just upgraded rust-analyzer to the latest and still get this problem. I've also run rustup update
and cargo clean
$ rust-analyzer --version
rust-analyzer 0.3.1489-standalone
I managed to get mine to work by telling rust-tools/lsp to use the rust-analyzer installed by rustup component add --toolchain X rust-analyzer
Copying that rust-analyzer elsewhere into my path wasn't enough. I had to reference it in place. So I tweaked my nvim config a bit.
In the future I will figure out a way to make it adapt to the currently active toolchain. For now, this'll have to do.
rt.setup({
server = {
cmd = { '/home/me/.rustup/toolchains/nightly-2023-04-20-x86_64-unknown-linux-gnu/bin/rust-analyzer' },
...
I managed to get mine to work by telling rust-tools/lsp to use the rust-analyzer installed by
rustup component add --toolchain X rust-analyzer
Copying that rust-analyzer elsewhere into my path wasn't enough. I had to reference it in place. So I tweaked my nvim config a bit.In the future I will figure out a way to make it adapt to the currently active toolchain. For now, this'll have to do.
rt.setup({ server = { cmd = { '/home/me/.rustup/toolchains/nightly-2023-04-20-x86_64-unknown-linux-gnu/bin/rust-analyzer' }, ...
Since rustup 1.26, they've added a proxy for rust-analyzer, so you probably don't need to specify the complete path.
Since rustup 1.26, they've added a proxy for rust-analyzer, so you probably don't need to specify the complete path.
Interestingly. If I change command to rust-analyzer
or remove cmd = { '...' }
entirely... the `dylib loading failed" error returns.
I wonder if this is somehow related to our usage of rust-toolchain.toml
at the root of our project, changing the toolchain to nightly. Maybe the proxy isn't working correctly for rust-analyzer-proc-macro-srv
?
I started to getting this, not sure probably after update to new nightly version.
My config:
versions: