RustCrypto / hashes

Collection of cryptographic hash functions written in pure Rust
1.76k stars 239 forks source link

"no such associated item" in IDE but build succeeds #529

Closed alshdavid closed 6 months ago

alshdavid commented 6 months ago

In VSCode I am getting this error: image

no such associated itemrust-analyzer[E0599](https://doc.rust-lang.org/stable/error_codes/E0599.html)
sha2
pub type Sha256 = CoreWrapper<CtVariableCoreWrapper<Sha256VarCore, U32, OidSha256>> // size = 112 (0x70), align = 0x8

However cargo build succeeds without issue.

$ uname -a
Linux fedora 6.6.8-200.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 21 04:01:49 UTC 2023 x86_64 GNU/Linux

$ cargo version
cargo 1.75.0 (1d8b05cdd 2023-11-20)

Have I misconfigured something?

newpavlov commented 6 months ago

Are you using a Nightly toolchain? Try to update it or switch to stable. If it does not help. then I think it's better to ask in the rust-analyzer repository after looking for similar issues.

alshdavid commented 6 months ago

Appears this can be solved for now with this syntax:

let mut hasher = <Sha256 as Digest>::new();

https://github.com/rust-lang/rust-analyzer/issues/15242

newpavlov commented 6 months ago

Closing in favor of the rust-analyzer issue. Hopefully, it will be fixed soon.