Make GenericParams::where_predicates private

This commit is contained in:
Lukas Wirth 2024-07-02 11:27:56 +02:00
parent 372e2d22e6
commit be1ea4028b
5 changed files with 12 additions and 8 deletions

View file

@ -161,7 +161,7 @@ pub enum GenericParamDataRef<'a> {
pub struct GenericParams {
type_or_consts: Arena<TypeOrConstParamData>,
pub lifetimes: Arena<LifetimeParamData>,
pub where_predicates: Box<[WherePredicate]>,
where_predicates: Box<[WherePredicate]>,
}
impl ops::Index<LocalTypeOrConstParamId> for GenericParams {
@ -228,6 +228,11 @@ impl GenericParams {
self.len() == 0
}
#[inline]
pub fn where_predicates(&self) -> std::slice::Iter<'_, WherePredicate> {
self.where_predicates.iter()
}
/// Iterator of type_or_consts field
#[inline]
pub fn iter_type_or_consts(