ruff
9c179314 - Remove `Hash` and `Eq` from `AstNodeRef` for types not implementing `Eq` or `Hash` (#16100)

Commit
215 days ago
Remove `Hash` and `Eq` from `AstNodeRef` for types not implementing `Eq` or `Hash` (#16100) ## Summary This is a follow up to https://github.com/astral-sh/ruff/pull/15763#discussion_r1949681336 It reverts the change to using ptr equality for `AstNodeRef`s, which in turn removes the `Eq`, `PartialEq`, and `Hash` implementations for `AstNodeRef`s parametrized with AST nodes. Cheap comparisons shouldn't be needed because the node field is generally marked as `[#tracked]` and `#[no_eq]` and removing the implementations even enforces that those attributes are set on all `AstNodeRef` fields (which is good). The only downside this has is that we technically wouldn't have to mark the `Unpack::target` as `#[tracked]` because the `target` field is accessed in every query accepting `Unpack` as an argument. Overall, enforcing the use of `#[tracked]` seems like a good trade off, espacially considering that it's very likely that we'd probably forget to mark the `Unpack::target` field as tracked if we add a new `Unpack` query that doesn't access the target. ## Test Plan `cargo test`
Author
Parents
Loading