Skip to content

collection_is_never_read says never used when hashing #11923

@SUPERCILEX

Description

@SUPERCILEX

Summary

Real code:

impl<'ctx, S> Hash for DependencyGraph<'ctx, S> { fn hash<H: Hasher>(&self, state: &mut H) { let mut ops = Vec::with_capacity(self.edges.len()); for (from, nodes) in self.edges.values() { ops.push(from.get_opcode()); for node in nodes { ops.push(node.get_opcode()); } } ops.sort_unstable_by_key(|&op| op as u32); ops.hash(state); } }

Lint Name

collection_is_never_read

Reproducer

https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=f56ee19eab842503346eb77f36c6cb51

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveL-nurseryLint: Currently in the nursery group

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions