mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
Support function pointer MIR lowering
This commit is contained in:
parent
1b85b43e6f
commit
a063f000ff
14 changed files with 468 additions and 164 deletions
|
@ -576,10 +576,14 @@ where
|
|||
}
|
||||
|
||||
pub fn callable_sig_from_fnonce(
|
||||
self_ty: &Ty,
|
||||
mut self_ty: &Ty,
|
||||
env: Arc<TraitEnvironment>,
|
||||
db: &dyn HirDatabase,
|
||||
) -> Option<CallableSig> {
|
||||
if let Some((ty, _, _)) = self_ty.as_reference() {
|
||||
// This will happen when it implements fn or fn mut, since we add a autoborrow adjustment
|
||||
self_ty = ty;
|
||||
}
|
||||
let krate = env.krate;
|
||||
let fn_once_trait = FnTrait::FnOnce.get_id(db, krate)?;
|
||||
let output_assoc_type = db.trait_data(fn_once_trait).associated_type_by_name(&name![Output])?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue