-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
A-cargocargo related issuescargo related issuesS-blockedStatus: marked as blocked ❌ on something else such as an RFC or other implementation work.Status: marked as blocked ❌ on something else such as an RFC or other implementation work.
Description
When different targets use different features of a create, RA considers all of them active at the same time.
Cargo.toml:
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
poll-promise = { version = "0.2.0", features = ["tokio"] }
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen-futures = "0.4"
poll-promise = { version = "0.2.0", features = ["web"] }
main.rs:
fn main() {
let _ = poll_promise::Promise::spawn_async(async {
todo!()
}); // Expected 2 arguments, found 1
}
This is how arguments in spawn_async
are defined:
pub fn spawn_async(
#[cfg(feature = "tokio")] future: impl std::future::Future<Output = T> + 'static + Send,
#[cfg(feature = "web")] future: impl std::future::Future<Output = T> + 'static,
) -> Self {
rust-analyzer version: 0.3.1575-standalone
rustc version: 1.70.0 (90c541806 2023-05-31)
relevant settings: None
Metadata
Metadata
Assignees
Labels
A-cargocargo related issuescargo related issuesS-blockedStatus: marked as blocked ❌ on something else such as an RFC or other implementation work.Status: marked as blocked ❌ on something else such as an RFC or other implementation work.