1
Fork 0

Rollup merge of #131652 - compiler-errors:modifiers, r=Nadrieril,jieyouxu

Move polarity into `PolyTraitRef` rather than storing it on the side

Arguably we could move these modifiers into `TraitRef` instead of `PolyTraitRef`, but I see `TraitRef` as simply the *path* part of the trait ref. It doesn't really matter -- refactoring this further is much easier now.
This commit is contained in:
Matthias Krüger 2024-10-15 05:11:37 +02:00 committed by GitHub
commit 4d53a28cac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
48 changed files with 216 additions and 199 deletions

View file

@ -333,12 +333,12 @@ fn contains_maybe_sized_bound_on_pointee(predicates: &[WherePredicate], pointee:
}
fn is_maybe_sized_bound(bound: &GenericBound) -> bool {
if let GenericBound::Trait(
trait_ref,
TraitBoundModifiers { polarity: ast::BoundPolarity::Maybe(_), .. },
) = bound
if let GenericBound::Trait(trait_ref) = bound
&& let TraitBoundModifiers { polarity: ast::BoundPolarity::Maybe(_), .. } =
trait_ref.modifiers
&& is_sized_marker(&trait_ref.trait_ref.path)
{
is_sized_marker(&trait_ref.trait_ref.path)
true
} else {
false
}