Futures-Util version issue

303 Views Asked by At

My code was working fine until today I got the error

error: the 'rustc.exe' binary, normally provided by the 'rustc' component, is not applicable to the 'stable-x86_64-pc-windows-msvc' toolchain

I fixed it with rustup toolchain install stable

After that I am having dependency issue with futures-util.

My toml file is:

[package]
name = "rusting"
version = "0.1.0"
edition = "2021"

    # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
    
    [dependencies]
    rand = "0.8.5"
    
    schnorr_fun = "0.8.2"
    
    chrono = "0.4.24"
    
    tokio = { version = "1.27.0", features = ["full"] }
    
    futures = "0.3.28"
    
    schnorrkel = "0.10.2"
    
    serde_json = "1.0.95"

I am getting error (after running cargo run):

  Compiling autocfg v1.1.0
   Compiling proc-macro2 v1.0.56
   Compiling cfg-if v1.0.0
   Compiling unicode-ident v1.0.8
   Compiling quote v1.0.26
   Compiling version_check v0.9.4
   Compiling typenum v1.16.0
   Compiling windows_x86_64_msvc v0.42.2
   Compiling getrandom v0.2.9
   Compiling winapi v0.3.9
   Compiling rand_core v0.6.4
   Compiling generic-array v0.14.7
   Compiling futures-core v0.3.28
   Compiling slab v0.4.8
   Compiling windows-targets v0.42.2
   Compiling futures-task v0.3.28                                                                                                                                               
   Compiling futures-channel v0.3.28
   Compiling serde v1.0.160
   Compiling memchr v2.5.0                                                                                                                                                      
   Compiling windows-sys v0.45.0                                                                                                                                                
   Compiling lock_api v0.4.9
   Compiling num-traits v0.2.15
   Compiling syn v2.0.15
   Compiling futures-util v0.3.28
   Compiling libc v0.2.142
   Compiling subtle-ng v2.5.0
   Compiling log v0.4.17
   Compiling futures-sink v0.3.28
   Compiling parking_lot_core v0.9.7
   Compiling pin-project-lite v0.2.9
   Compiling num-integer v0.1.45
   Compiling pin-utils v0.1.0
   Compiling byteorder v1.4.3
   Compiling futures-io v0.3.28
   Compiling crypto-common v0.1.6
   Compiling digest v0.9.0
   Compiling scopeguard v1.1.0
   Compiling smallvec v1.10.0
   Compiling digest v0.10.6
   Compiling block-buffer v0.9.0
   Compiling tokio v1.27.0
   Compiling ppv-lite86 v0.2.17
   Compiling cpufeatures v0.2.7
   Compiling opaque-debug v0.3.0
   Compiling keccak v0.1.3
   Compiling serde_json v1.0.96
   Compiling sha2 v0.9.9
   Compiling rand_chacha v0.3.1
   Compiling mio v0.8.6
   Compiling parking_lot v0.12.1
   Compiling time v0.1.45
   Compiling socket2 v0.4.9
   Compiling secp256kfun v0.8.2
   Compiling itoa v1.0.6
   Compiling bytes v1.4.0
   Compiling arrayvec v0.7.2
   Compiling arrayref v0.3.7
   Compiling ryu v1.0.13
   Compiling num_cpus v1.15.0
   Compiling chrono v0.4.24
   Compiling rand v0.8.5
   Compiling schnorr_fun v0.8.2
   Compiling serde_bytes v0.11.9
   Compiling zeroize_derive v1.4.2
   Compiling futures-macro v0.3.28
   Compiling tokio-macros v2.0.0
   Compiling zeroize v1.6.0
   Compiling curve25519-dalek-ng v4.1.1
   Compiling merlin v3.0.0
   Compiling schnorrkel v0.10.2
error: could not compile `futures-util`

Caused by:
  process didn't exit successfully: `rustc --crate-name futures_util --edition=2018 C:\Users\write\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=175 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg "feature=\"alloc\"" --cfg "feature=\"async-await\"" --cfg "feature=\"async-await-macro\"" --cfg "feature=\"channel\"" --cfg "feature=\"futures-channel\"" --cfg "feature=\"futures-io\"" --cfg "feature=\"futures-macro\"" --cfg "feature=\"futures-sink\"" --cfg "feature=\"io\"" --cfg "feature=\"memchr\"" --cfg "feature=\"sink\"" --cfg "feature=\"slab\"" --cfg "feature=\"std\"" -C metadata=13742af156b34500 -C extra-filename=-13742af156b34500 --out-dir C:\Users\write\OneDrive\Desktop\rustMainWorks\rusting\target\debug\deps -L dependency=C:\Users\write\OneDrive\Desktop\rustMainWorks\rusting\target\debug\deps --extern futures_channel=C:\Users\write\OneDrive\Desktop\rustMainWorks\rusting\target\debug\deps\libfutures_channel-3e8bb2b5c1dc081e.rmeta --extern futures_core=C:\Users\write\OneDrive\Desktop\rustMainWorks\rusting\target\debug\deps\libfutures_core-f90c1bbd638684b0.rmeta --extern futures_io=C:\Users\write\OneDrive\Desktop\rustMainWorks\rusting\target\debug\deps\libfutures_io-71770888c0d02b09.rmeta --extern futures_macro=C:\Users\write\OneDrive\Desktop\rustMainWorks\rusting\target\debug\deps\futures_macro-2cc5ad0e7c87dece.dll --extern futures_sink=C:\Users\write\OneDrive\Desktop\rustMainWorks\rusting\target\debug\deps\libfutures_sink-c2d4171c0b21bc55.rmeta --extern futures_task=C:\Users\write\OneDrive\Desktop\rustMainWorks\rusting\target\debug\deps\libfutures_task-ed665921dfd5aad9.rmeta --extern memchr=C:\Users\write\OneDrive\Desktop\rustMainWorks\rusting\target\debug\deps\libmemchr-0d3a18afe7a073e7.rmeta --extern pin_project_lite=C:\Users\write\OneDrive\Desktop\rustMainWorks\rusting\target\debug\deps\libpin_project_lite-ae131f81c3df234f.rmeta --extern pin_utils=C:\Users\write\OneDrive\Desktop\rustMainWorks\rusting\target\debug\deps\libpin_utils-55686e91c4a501a2.rmeta --extern slab=C:\Users\write\OneDrive\Desktop\rustMainWorks\rusting\target\debug\deps\libslab-c0d5a42b8ab0b0ff.rmeta --cap-lints allow` (exit code: 1263094860)

I can understand there's some dependancy clash. But I cant fix it. Maybe tokio also is using a future crate with a different dependency. Any help please.

1

There are 1 best solutions below

0
Zubayr On

I found the solution by myself.

First just try

cargo clean

followed by

cargo update

Then try cargo run

If it doesn't work, just restart your ide (for me vs code) and try cargo clean again.