mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-28 18:43:01 +00:00
Fix dyn compatibility code bypassing callable_item_signature query
This commit is contained in:
parent
9e0af2bf13
commit
6e06115e6d
3 changed files with 4 additions and 5 deletions
|
|
@ -150,7 +150,7 @@ pub trait HirDatabase: DefDatabase + std::fmt::Debug {
|
|||
#[salsa::invoke_actual(crate::lower::field_types_query)]
|
||||
fn field_types(&self, var: VariantId) -> Arc<ArenaMap<LocalFieldId, Binders<Ty>>>;
|
||||
|
||||
#[salsa::invoke_actual(crate::lower::callable_item_sig)]
|
||||
#[salsa::invoke_actual(crate::lower::callable_item_signature_query)]
|
||||
fn callable_item_signature(&self, def: CallableDefId) -> PolyFnSig;
|
||||
|
||||
#[salsa::invoke_actual(crate::lower::return_type_impl_traits)]
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ use crate::{
|
|||
db::HirDatabase,
|
||||
from_assoc_type_id, from_chalk_trait_id,
|
||||
generics::{generics, trait_self_param_idx},
|
||||
lower::callable_item_sig,
|
||||
to_chalk_trait_id,
|
||||
utils::elaborate_clause_supertraits,
|
||||
};
|
||||
|
|
@ -377,7 +376,7 @@ where
|
|||
cb(MethodViolationCode::AsyncFn)?;
|
||||
}
|
||||
|
||||
let sig = callable_item_sig(db, func.into());
|
||||
let sig = db.callable_item_signature(func.into());
|
||||
if sig.skip_binders().params().iter().skip(1).any(|ty| {
|
||||
contains_illegal_self_type_reference(
|
||||
db,
|
||||
|
|
@ -558,7 +557,7 @@ fn receiver_for_self_ty(db: &dyn HirDatabase, func: FunctionId, ty: Ty) -> Optio
|
|||
if idx == trait_self_idx { ty.clone().cast(Interner) } else { arg.clone() }
|
||||
}),
|
||||
);
|
||||
let sig = callable_item_sig(db, func.into());
|
||||
let sig = db.callable_item_signature(func.into());
|
||||
let sig = sig.substitute(Interner, &subst);
|
||||
sig.params_and_return.first().cloned()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -713,7 +713,7 @@ impl<'a> TyLoweringContext<'a> {
|
|||
}
|
||||
|
||||
/// Build the signature of a callable item (function, struct or enum variant).
|
||||
pub(crate) fn callable_item_sig(db: &dyn HirDatabase, def: CallableDefId) -> PolyFnSig {
|
||||
pub(crate) fn callable_item_signature_query(db: &dyn HirDatabase, def: CallableDefId) -> PolyFnSig {
|
||||
match def {
|
||||
CallableDefId::FunctionId(f) => fn_sig_for_fn(db, f),
|
||||
CallableDefId::StructId(s) => fn_sig_for_struct_constructor(db, s),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue