Closed paulkre closed 2 years ago
What's your :CocCommand rust-analyzer.serverVersion
output?
rust-analyzer 0.0.0 (5342f47f4 2022-07-09)
Tested with code in https://github.com/rust-lang/rust-analyzer/issues/12450, can't reproduce
use std::error::Error;
fn main() {
// do_something_async is a non-async function that blocks on the tokio runtime
// It returns a plain Result
// Rust Analyzer thinks do_something_async returns a Future and puts a red squiggle here
// but it compiles without errors
let x: Result<_,_> = do_something_async();
println!("async result is {:?}",x);
}
#[tokio::main]
async fn do_something_async() -> Result<(), Box<dyn Error + Send + Sync>> {
println!("async stuff goes here...");
Ok(())
}
coc-rust-analyzer 0.65.2 and rust-analyzer 0.0.0 (5342f47f4 2022-07-09)
Could this be a problem with the fact that I'm using an arm64
system? This is the full error message:
[rust-analyzer unresolved-proc-macro] [E] proc macro `main` not expanded:
2 Cannot create expander for ...
3 target/debug/deps/libtokio_macros-7a64d8cf37bb7726.dylib: Io(Custom { kind:
4 InvalidData, error: DlOpen { desc: "dlopen(...
5 .../target/debug/deps/libtokio_macros-7a64d8cf37bb7726.dylib, 0x000A):
6 tried: \'.../target/debug/deps/
7 libtokio_macros-7a64d8cf37bb7726.dylib\' (mach-o file, but is an incompatible
8 architecture (have \'arm64\', need \'x86_64\'))" } })
It's rust-analyzer's issue.
It works fine using VSCode though.
I'm getting this error at the
#[tokio::main]
macro:This should already be fixed (https://github.com/rust-lang/rust-analyzer/issues/12450) but I'm still getting the error even after running
:CocUpdate
.