Skip to content

v0.8.0 impl VisitMap for HashSet breaking change #763

@Boshen

Description

@Boshen
error[E0277]: the trait bound `HashSet<N, FxBuildHasher>: VisitMap<N>` is not satisfied
   --> crates/oxc_cfg/src/visit.rs:105:13
    |
105 |             dfs_visitor(graph, start, &mut visitor, discovered, finished, time),
    |             ^^^^^^^^^^^ the trait `VisitMap<N>` is not implemented for `HashSet<N, FxBuildHasher>`
    |
    = help: the following other types implement trait `VisitMap<N>`:
              `fixedbitset::FixedBitSet` implements `VisitMap<Ix>`
              `hashbrown::set::HashSet<N, S>` implements `VisitMap<N>`
note: required by a bound in `dfs_visitor`
   --> crates/oxc_cfg/src/visit.rs:122:8
    |
112 | fn dfs_visitor<G, M, F, C>(
    |    ----------- required by a bound in this function
...
122 |     M: VisitMap<G::NodeId>,
    |        ^^^^^^^^^^^^^^^^^^^ required by this bound in `dfs_visitor`

I am using std::collections::HashSet.


#747 made this change https://github.com/petgraph/petgraph/pull/747/files#diff-c4360dd06fc5c65c90d25ec01cef6d32381a3c1be22f5acfca1de66de272e60b

- use std::collections::HashSet;
+ use hashbrown::HashSet;

Not sure whether this is intentional or should be feature gated with no_std cc @bushrat011899

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions