Skip to content

Commit 9814d79

Browse files
committed
Auto merge of rust-lang#14035 - Veykril:ast-id-arg, r=Veykril
minor: Remove unnecessary arg in `LowerCtx::ast_id`
2 parents dd673ee + 4a677e9 commit 9814d79

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

crates/hir-def/src/body/lower.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ impl<'a> LowerCtx<'a> {
6767
Path::from_src(ast, self)
6868
}
6969

70-
pub(crate) fn ast_id<N: AstNode>(&self, db: &dyn DefDatabase, item: &N) -> Option<AstId<N>> {
70+
pub(crate) fn ast_id<N: AstNode>(&self, item: &N) -> Option<AstId<N>> {
7171
let &(file_id, ref ast_id_map) = self.ast_id_map.as_ref()?;
72-
let ast_id_map = ast_id_map.get_or_init(|| db.ast_id_map(file_id));
72+
let ast_id_map = ast_id_map.get_or_init(|| self.db.ast_id_map(file_id));
7373
Some(InFile::new(file_id, ast_id_map.ast_id(item)))
7474
}
7575
}

crates/hir-def/src/type_ref.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ impl TypeRef {
240240
TypeRef::DynTrait(type_bounds_from_ast(ctx, inner.type_bound_list()))
241241
}
242242
ast::Type::MacroType(mt) => match mt.macro_call() {
243-
Some(mc) => ctx.ast_id(ctx.db, &mc).map(TypeRef::Macro).unwrap_or(TypeRef::Error),
243+
Some(mc) => ctx.ast_id(&mc).map(TypeRef::Macro).unwrap_or(TypeRef::Error),
244244
None => TypeRef::Error,
245245
},
246246
}

0 commit comments

Comments
 (0)