Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/generics.rs')
-rw-r--r--crates/hir-def/src/generics.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/hir-def/src/generics.rs b/crates/hir-def/src/generics.rs
index 8570bac9a9..fe9004fcc6 100644
--- a/crates/hir-def/src/generics.rs
+++ b/crates/hir-def/src/generics.rs
@@ -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(