mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Impl Fold for CallableSig
This commit is contained in:
parent
7e541e69b1
commit
b24e6f6030
1 changed files with 18 additions and 0 deletions
|
@ -35,6 +35,7 @@ use std::sync::Arc;
|
||||||
use base_db::salsa;
|
use base_db::salsa;
|
||||||
use chalk_ir::{
|
use chalk_ir::{
|
||||||
cast::{CastTo, Caster},
|
cast::{CastTo, Caster},
|
||||||
|
fold::Fold,
|
||||||
interner::HasInterner,
|
interner::HasInterner,
|
||||||
UintTy,
|
UintTy,
|
||||||
};
|
};
|
||||||
|
@ -203,6 +204,23 @@ impl CallableSig {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Fold<Interner> for CallableSig {
|
||||||
|
type Result = CallableSig;
|
||||||
|
|
||||||
|
fn fold_with<'i>(
|
||||||
|
self,
|
||||||
|
folder: &mut dyn chalk_ir::fold::Folder<'i, Interner>,
|
||||||
|
outer_binder: DebruijnIndex,
|
||||||
|
) -> chalk_ir::Fallible<Self::Result>
|
||||||
|
where
|
||||||
|
Interner: 'i,
|
||||||
|
{
|
||||||
|
let vec = self.params_and_return.to_vec();
|
||||||
|
let folded = vec.fold_with(folder, outer_binder)?;
|
||||||
|
Ok(CallableSig { params_and_return: folded.into(), is_varargs: self.is_varargs })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
|
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
|
||||||
pub enum ImplTraitId {
|
pub enum ImplTraitId {
|
||||||
ReturnTypeImplTrait(hir_def::FunctionId, u16),
|
ReturnTypeImplTrait(hir_def::FunctionId, u16),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue