Skip to content

Commit 1bf840b

Browse files
authored
Merge pull request #19566 from flodiebold/push-vzpyzvpkwkyt
Fix dyn compatibility code bypassing callable_item_signature query
2 parents 6427d41 + 6e06115 commit 1bf840b

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

crates/hir-ty/src/db.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ pub trait HirDatabase: DefDatabase + std::fmt::Debug {
150150
#[salsa::invoke_actual(crate::lower::field_types_query)]
151151
fn field_types(&self, var: VariantId) -> Arc<ArenaMap<LocalFieldId, Binders<Ty>>>;
152152

153-
#[salsa::invoke_actual(crate::lower::callable_item_sig)]
153+
#[salsa::invoke_actual(crate::lower::callable_item_signature_query)]
154154
fn callable_item_signature(&self, def: CallableDefId) -> PolyFnSig;
155155

156156
#[salsa::invoke_actual(crate::lower::return_type_impl_traits)]

crates/hir-ty/src/dyn_compatibility.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ use crate::{
2121
db::HirDatabase,
2222
from_assoc_type_id, from_chalk_trait_id,
2323
generics::{generics, trait_self_param_idx},
24-
lower::callable_item_sig,
2524
to_chalk_trait_id,
2625
utils::elaborate_clause_supertraits,
2726
};
@@ -377,7 +376,7 @@ where
377376
cb(MethodViolationCode::AsyncFn)?;
378377
}
379378

380-
let sig = callable_item_sig(db, func.into());
379+
let sig = db.callable_item_signature(func.into());
381380
if sig.skip_binders().params().iter().skip(1).any(|ty| {
382381
contains_illegal_self_type_reference(
383382
db,
@@ -558,7 +557,7 @@ fn receiver_for_self_ty(db: &dyn HirDatabase, func: FunctionId, ty: Ty) -> Optio
558557
if idx == trait_self_idx { ty.clone().cast(Interner) } else { arg.clone() }
559558
}),
560559
);
561-
let sig = callable_item_sig(db, func.into());
560+
let sig = db.callable_item_signature(func.into());
562561
let sig = sig.substitute(Interner, &subst);
563562
sig.params_and_return.first().cloned()
564563
}

crates/hir-ty/src/lower.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ impl<'a> TyLoweringContext<'a> {
713713
}
714714

715715
/// Build the signature of a callable item (function, struct or enum variant).
716-
pub(crate) fn callable_item_sig(db: &dyn HirDatabase, def: CallableDefId) -> PolyFnSig {
716+
pub(crate) fn callable_item_signature_query(db: &dyn HirDatabase, def: CallableDefId) -> PolyFnSig {
717717
match def {
718718
CallableDefId::FunctionId(f) => fn_sig_for_fn(db, f),
719719
CallableDefId::StructId(s) => fn_sig_for_struct_constructor(db, s),

0 commit comments

Comments
 (0)