Name resolution and completion don't work with async_std/tokio/reqwest crates
See original GitHub issueEnvironment
- IntelliJ Rust plugin version: 0.2.109.2149-192
- Rust toolchain version: 1.39.0
- IDE name and version: Clion 2019.2.1
- Operating system: Ubuntu 19.10
Problem description
#[cfg(feature = "...")]
in macros could not be found.
https://github.com/async-rs/async-std/blob/f611ceccc87aaf6b6cfb5bdee8bfffaffee5498f/src/utils.rs#L134-L144 https://github.com/async-rs/async-std/blob/f611ceccc87aaf6b6cfb5bdee8bfffaffee5498f/src/lib.rs#L203-L211
/// Declares std items.
#[allow(unused_macros)]
#[doc(hidden)]
macro_rules! cfg_std {
($($item:item)*) => {
$(
#[cfg(feature = "std")]
$item
)*
}
}
cfg_std! {
// ...
pub mod task;
}
Steps to reproduce
The plugin cannot find the declaration of block_on
to go. But it cound find after changing cfg_std! { pub mod task;}
to #[cfg(feature = "std")]pub mod task;
.
use async_std::task;
fn main() {
task::block_on(async {
println!("Hello, world!");
})
}
Issue Analytics
- State:
- Created 4 years ago
- Reactions:28
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Using async-std (was reqwest) - #20 by Rustafarian - help - The ...
I am trying to use the simple example in reqwest but had run into a "dogs dinner" ... feature where the library name...
Read more >Rust JNI async callback with Tokio and Reqwest for Android
I want to do execute requests in Rust and return the result to Android asynchronously with callback. I'm testing code to execute the...
Read more >Request coalescing in async Rust - fasterthanli.me
A simple web server; The case for async; Enter tokio ... to use netcat to open a TCP connection to our server, send...
Read more >reqwest - crates.io: Rust Package Registry
An ergonomic, batteries-included HTTP Client for Rust. Plain bodies, JSON, urlencoded, multipart; Customizable redirect policy; HTTP Proxies ...
Read more >thirtyfour 0.27.2 - Docs.rs
... should work. Async only ( tokio and async-std runtimes supported via feature flags). For synchronous support, use the thirtyfour_sync crate instead.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It’s fixed in #4914 and will be landed in the next release (I hope). Note, intellisense features (name resolution, completion, etc) should work correctly only with new experimental macro expansion engine (see #3628). So, let’s keep this issue open until new macro expansion engine is enabled by default
The issue has been known for a long time. The new macro expansion engine (#3628) doesn’t solve it for now. Recently we discussed some possible solutions, so I’ll try to prototype something.