Complete field replacing
This commit is contained in:
parent
3a85e47f6a
commit
3ffcb2658c
@ -811,8 +811,13 @@ pub(super) fn replace_fields(
|
||||
pats: impl IntoIterator<Item = Pat>,
|
||||
) -> Self {
|
||||
let pats = {
|
||||
let mut arena = cx.pattern_arena.borrow_mut();
|
||||
pats.into_iter().map(move |pat| /* arena.alloc(pat) */ todo!()).collect()
|
||||
let tys: SmallVec<[Ty; 2]> = match self {
|
||||
Fields::Vec(pats) => pats.iter().copied().map(|pat| cx.type_of(pat)).collect(),
|
||||
};
|
||||
pats.into_iter()
|
||||
.zip(tys.into_iter())
|
||||
.map(move |(pat, ty)| cx.alloc_pat(pat, &ty))
|
||||
.collect()
|
||||
};
|
||||
|
||||
match self {
|
||||
|
Loading…
Reference in New Issue
Block a user