Move EvaluationCache::clear.

This commit is contained in:
Camille GILLOT 2020-01-22 14:00:55 +01:00
parent 551cc5ebe6
commit 735d664e74
2 changed files with 7 additions and 7 deletions

View File

@ -3560,13 +3560,6 @@ impl<'tcx> TraitObligation<'tcx> {
}
}
impl<'tcx> EvaluationCache<'tcx> {
/// Actually frees the underlying memory in contrast to what stdlib containers do on `clear`
pub fn clear(&self) {
*self.hashmap.borrow_mut() = Default::default();
}
}
impl<'o, 'tcx> TraitObligationStack<'o, 'tcx> {
fn list(&'o self) -> TraitObligationStackList<'o, 'tcx> {
TraitObligationStackList::with(self)

View File

@ -265,6 +265,13 @@ pub struct EvaluationCache<'tcx> {
>,
}
impl<'tcx> EvaluationCache<'tcx> {
/// Actually frees the underlying memory in contrast to what stdlib containers do on `clear`
pub fn clear(&self) {
*self.hashmap.borrow_mut() = Default::default();
}
}
#[derive(Clone, Eq, PartialEq)]
pub struct WithDepNode<T> {
dep_node: DepNodeIndex,