New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rust Analyzer shows wrong warning SHA1 hasher finalize #15242
Comments
This is rust-analyzer's repository, not intellij-rust's. Can you check if you're reporting rust-analyzer's issue or intellij-rust's issue? |
We don't show any errors, but we don't resolve EDIT: use sha1::{Digest, Sha1};
fn main() {
let mut hasher = <Sha1 as Digest>::new();
hasher.update("afdfs");
let hashed_auth_key = format!("{:x}", hasher.finalize());
dbg!(hashed_auth_key);
} |
Thanks for taking a look at it 😄 |
Is it possible to bisect this? I think it's a relatively recent regression. |
The bug in my comment above is not a recent regression, but it was less noticeable before. The "no such associated item" in RustCrypto/hashes#529 is a recently-added diagnostic that makes the bug more visible. We've just marked it as experimental so it will go away next week, but that doesn't fix the underlying problem. |
rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)
rustc version: (eg. output of
rustc -V
) 1.70relevant settings: (eg. client settings, or environment variables like
CARGO
,RUSTC
,RUSTUP_HOME
orCARGO_HOME
): %In IntelliJ the Rust plugin in version 0.4.197.5401-231 shows a warning when using the SHA-1 crate.
In this part of the code it complains that hasher.finalize()
CtOutput<CoreWrapper<Sha1Core>>
doesn't implementLowerHex
(required by {:x}). The code compiles and it also works in my open source production environment.The text was updated successfully, but these errors were encountered: