Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/item_scope.rs')
-rw-r--r--crates/hir-def/src/item_scope.rs26
1 files changed, 2 insertions, 24 deletions
diff --git a/crates/hir-def/src/item_scope.rs b/crates/hir-def/src/item_scope.rs
index 0e6826a75a..2b059d1f8d 100644
--- a/crates/hir-def/src/item_scope.rs
+++ b/crates/hir-def/src/item_scope.rs
@@ -241,30 +241,8 @@ impl ItemScope {
})
}
- pub fn unnamed_consts<'a>(
- &'a self,
- db: &'a dyn DefDatabase,
- ) -> impl Iterator<Item = ConstId> + 'a {
- // FIXME: Also treat consts named `_DERIVE_*` as unnamed, since synstructure generates those.
- // Should be removed once synstructure stops doing that.
- let synstructure_hack_consts = self.values.values().filter_map(|(item, _, _)| match item {
- &ModuleDefId::ConstId(id) => {
- let loc = id.lookup(db);
- let item_tree = loc.id.item_tree(db);
- if item_tree[loc.id.value]
- .name
- .as_ref()
- .map_or(false, |n| n.to_smol_str().starts_with("_DERIVE_"))
- {
- Some(id)
- } else {
- None
- }
- }
- _ => None,
- });
-
- self.unnamed_consts.iter().copied().chain(synstructure_hack_consts)
+ pub fn unnamed_consts(&self) -> impl Iterator<Item = ConstId> + '_ {
+ self.unnamed_consts.iter().copied()
}
/// Iterate over all module scoped macros