Rollup merge of #133960 - jdonszelmann:remove-eq-on-attributes, r=notriddle

rustdoc: remove eq for clean::Attributes

This change removes the `PartialEq` and `Eq` implementations from `Attributes`. This implementation was not used, and whether the implementation is useful at all is questionable. I care about removing it, because I'm working #131229. While simplifying the representation of attributes, I intend to remove attr ids from attributes where possible. They're actually rarely useful. This piece of code uses them, but for no real reason, so I think simply removing the implementation makes most sense. Let me know if there are major objections to this.
This commit is contained in:
Matthias Krüger 2024-12-06 21:21:08 +01:00 committed by GitHub
commit d210b91331
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1241,19 +1241,6 @@ impl Attributes {
}
}
impl PartialEq for Attributes {
fn eq(&self, rhs: &Self) -> bool {
self.doc_strings == rhs.doc_strings
&& self
.other_attrs
.iter()
.map(|attr| attr.id)
.eq(rhs.other_attrs.iter().map(|attr| attr.id))
}
}
impl Eq for Attributes {}
#[derive(Clone, PartialEq, Eq, Debug, Hash)]
pub(crate) enum GenericBound {
TraitBound(PolyTrait, hir::TraitBoundModifiers),