diff --git a/crates/hir_def/src/child_by_source.rs b/crates/hir_def/src/child_by_source.rs index f40a7f80d31..f2e809ca9ce 100644 --- a/crates/hir_def/src/child_by_source.rs +++ b/crates/hir_def/src/child_by_source.rs @@ -80,6 +80,10 @@ impl ChildBySource for ModuleId { impl ChildBySource for ItemScope { fn child_by_source_to(&self, db: &dyn DefDatabase, res: &mut DynMap) { self.declarations().for_each(|item| add_module_def(db, res, item)); + self.unnamed_consts().for_each(|konst| { + let src = konst.lookup(db).source(db); + res[keys::CONST].insert(src, konst); + }); self.impls().for_each(|imp| add_impl(db, res, imp)); fn add_module_def(db: &dyn DefDatabase, map: &mut DynMap, item: ModuleDefId) { diff --git a/crates/ide_assists/src/handlers/remove_dbg.rs b/crates/ide_assists/src/handlers/remove_dbg.rs index 2862cfa9c20..c8226550fbe 100644 --- a/crates/ide_assists/src/handlers/remove_dbg.rs +++ b/crates/ide_assists/src/handlers/remove_dbg.rs @@ -30,7 +30,7 @@ pub(crate) fn remove_dbg(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { if new_contents.is_empty() { match_ast! { match it { - ast::BlockExpr(it) => { + ast::BlockExpr(_it) => { macro_call.syntax() .prev_sibling_or_token() .and_then(whitespace_start)