Skip to content
Prev Previous commit
Responding to reviewer feedback
  • Loading branch information
CrooseGit committed Oct 13, 2025
commit f9cf338ae48eb0c0ad7c9900b5b8d0ecc286eae5
2 changes: 2 additions & 0 deletions compiler/rustc_lint/src/redundant_sizedness_bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ fn check_redundant_sizedness_bounds(
let redundant_sized_params: DefIdMap<_> = type_param_bounds(generics)
.filter(|bound| {
bound.trait_bound.trait_ref.trait_def_id() == Some(redundant_bound)
// Here we wish to compare the variant of the enum `BoundPolarity` whilst
// disregarding the contents of the variant.
&& std::mem::discriminant(&bound.trait_bound.modifiers.polarity)
== std::mem::discriminant(&redundant_bound_polarity)
})
Expand Down
Loading