Rollup merge of #111132 - lcnr:nll-generalize, r=b-naber
cleanup nll generalizer followup to #108861
This commit is contained in:
commit
f5c50e3350
6 changed files with 20 additions and 113 deletions
|
@ -498,11 +498,11 @@ impl<'cx, 'tcx> BorrowckInferCtxt<'cx, 'tcx> {
|
|||
let next_region = self.infcx.next_region_var(origin);
|
||||
let vid = next_region.as_var();
|
||||
|
||||
if cfg!(debug_assertions) && !self.inside_canonicalization_ctxt() {
|
||||
if cfg!(debug_assertions) {
|
||||
debug!("inserting vid {:?} with origin {:?} into var_to_origin", vid, origin);
|
||||
let ctxt = get_ctxt_fn();
|
||||
let mut var_to_origin = self.reg_var_to_origin.borrow_mut();
|
||||
var_to_origin.insert(vid, ctxt);
|
||||
assert_eq!(var_to_origin.insert(vid, ctxt), None);
|
||||
}
|
||||
|
||||
next_region
|
||||
|
@ -520,11 +520,11 @@ impl<'cx, 'tcx> BorrowckInferCtxt<'cx, 'tcx> {
|
|||
let next_region = self.infcx.next_nll_region_var(origin);
|
||||
let vid = next_region.as_var();
|
||||
|
||||
if cfg!(debug_assertions) && !self.inside_canonicalization_ctxt() {
|
||||
if cfg!(debug_assertions) {
|
||||
debug!("inserting vid {:?} with origin {:?} into var_to_origin", vid, origin);
|
||||
let ctxt = get_ctxt_fn();
|
||||
let mut var_to_origin = self.reg_var_to_origin.borrow_mut();
|
||||
var_to_origin.insert(vid, ctxt);
|
||||
assert_eq!(var_to_origin.insert(vid, ctxt), None);
|
||||
}
|
||||
|
||||
next_region
|
||||
|
|
|
@ -131,9 +131,13 @@ impl<'tcx> TypeRelatingDelegate<'tcx> for NllTypeRelatingDelegate<'_, '_, 'tcx>
|
|||
ty::BoundRegionKind::BrEnv => BoundRegionInfo::Name(sym::env),
|
||||
};
|
||||
|
||||
if cfg!(debug_assertions) && !self.type_checker.infcx.inside_canonicalization_ctxt() {
|
||||
if cfg!(debug_assertions) {
|
||||
let mut var_to_origin = self.type_checker.infcx.reg_var_to_origin.borrow_mut();
|
||||
var_to_origin.insert(reg.as_var(), RegionCtxt::Placeholder(reg_info));
|
||||
let new = RegionCtxt::Placeholder(reg_info);
|
||||
let prev = var_to_origin.insert(reg.as_var(), new);
|
||||
if let Some(prev) = prev {
|
||||
assert_eq!(new, prev);
|
||||
}
|
||||
}
|
||||
|
||||
reg
|
||||
|
@ -146,9 +150,10 @@ impl<'tcx> TypeRelatingDelegate<'tcx> for NllTypeRelatingDelegate<'_, '_, 'tcx>
|
|||
universe,
|
||||
);
|
||||
|
||||
if cfg!(debug_assertions) && !self.type_checker.infcx.inside_canonicalization_ctxt() {
|
||||
if cfg!(debug_assertions) {
|
||||
let mut var_to_origin = self.type_checker.infcx.reg_var_to_origin.borrow_mut();
|
||||
var_to_origin.insert(reg.as_var(), RegionCtxt::Existential(None));
|
||||
let prev = var_to_origin.insert(reg.as_var(), RegionCtxt::Existential(None));
|
||||
assert_eq!(prev, None);
|
||||
}
|
||||
|
||||
reg
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue