aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/resolve.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/resolve.rs')
-rw-r--r--crates/ra_hir/src/resolve.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/crates/ra_hir/src/resolve.rs b/crates/ra_hir/src/resolve.rs
index c8be27e54..e2a7639b0 100644
--- a/crates/ra_hir/src/resolve.rs
+++ b/crates/ra_hir/src/resolve.rs
@@ -221,6 +221,18 @@ impl Resolver {
221 pub(crate) fn krate(&self) -> Option<Crate> { 221 pub(crate) fn krate(&self) -> Option<Crate> {
222 self.module().map(|t| t.0.krate()) 222 self.module().map(|t| t.0.krate())
223 } 223 }
224
225 pub(crate) fn where_predicates_in_scope<'a>(
226 &'a self,
227 ) -> impl Iterator<Item = &'a crate::generics::WherePredicate> + 'a {
228 self.scopes
229 .iter()
230 .filter_map(|scope| match scope {
231 Scope::GenericParams(params) => Some(params),
232 _ => None,
233 })
234 .flat_map(|params| params.where_predicates.iter())
235 }
224} 236}
225 237
226impl Resolver { 238impl Resolver {