1
Fork 0

simplify applying closure requirements

Don't use `ConstraintCategory::ClosureBounds`!
Set the category and the span for the promoted constraints to that of
the original constraint earlier than before.
This eliminates the need for `closure_bounds_mapping`.
This commit is contained in:
Ali MJ Al-Nasrawy 2022-10-03 12:14:48 +03:00
parent 81ff7e7385
commit df668b9fb9
9 changed files with 97 additions and 237 deletions

View file

@ -163,6 +163,7 @@ impl<'s, 'tcx, D: ConstraintGraphDirecton> Iterator for Edges<'s, 'tcx, D> {
span: DUMMY_SP,
category: ConstraintCategory::Internal,
variance_info: VarianceDiagInfo::default(),
from_closure: false,
})
} else {
None

View file

@ -96,6 +96,9 @@ pub struct OutlivesConstraint<'tcx> {
/// Variance diagnostic information
pub variance_info: VarianceDiagInfo<'tcx>,
/// If this constraint is promoted from closure requirements.
pub from_closure: bool,
}
impl<'tcx> fmt::Debug for OutlivesConstraint<'tcx> {