Simplify RegionConstraintCollector::vars_since_snapshot

This commit is contained in:
varkor 2019-03-20 01:54:53 +00:00
parent 92b2021b0a
commit 2a08860ae6

View File

@ -841,12 +841,7 @@ impl<'tcx> RegionConstraintCollector<'tcx> {
}
pub fn vars_since_snapshot(&self, mark: &RegionSnapshot) -> Vec<RegionVid> {
self.undo_log[mark.length..]
.iter()
.filter_map(|&elt| match elt {
AddVar(vid) => Some(vid),
_ => None,
}).collect()
self.unification_table.vars_since_snapshot(&mark.region_snapshot).collect()
}
/// See [`RegionInference::region_constraints_added_in_snapshot`].