fold substs
This commit is contained in:
parent
4e8fb743cc
commit
711e736262
1 changed files with 1 additions and 9 deletions
|
|
@ -396,15 +396,7 @@ impl<'tcx> TypeFoldable<'tcx> for SubstsRef<'tcx> {
|
|||
}
|
||||
}
|
||||
0 => Ok(self),
|
||||
_ => {
|
||||
let params: SmallVec<[_; 8]> =
|
||||
self.iter().map(|k| k.try_fold_with(folder)).collect::<Result<_, _>>()?;
|
||||
if params[..] == self[..] {
|
||||
Ok(self)
|
||||
} else {
|
||||
Ok(folder.tcx().intern_substs(¶ms))
|
||||
}
|
||||
}
|
||||
_ => ty::util::fold_list(self, folder, |tcx, v| tcx.intern_substs(v)),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue