-use crate::check::regionck::OutlivesEnvironmentExt;
use crate::constrained_generic_params::{identify_constrained_generic_params, Parameter};
+use crate::outlives::outlives_bounds::InferCtxtExt as _;
use rustc_ast as ast;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_errors::{pluralize, struct_span_err, Applicability, DiagnosticBuilder, ErrorGuaranteed};
return;
}
- let mut outlives_environment = OutlivesEnvironment::new(param_env);
+ let mut outlives_environment = OutlivesEnvironment::builder(param_env);
outlives_environment.add_implied_bounds(infcx, assumed_wf_types, body_id);
+ let outlives_environment = outlives_environment.build();
+
infcx.check_region_obligations_and_report_errors(body_def_id, &outlives_environment);
})
}
// region constraints get added and solved there and we need to test each
// call individually.
tcx.infer_ctxt().enter(|infcx| {
- let mut outlives_environment = OutlivesEnvironment::new(param_env);
- outlives_environment.add_implied_bounds(&infcx, wf_tys.clone(), id);
+ let outlives_environment = OutlivesEnvironment::with_bounds(
+ param_env,
+ Some(&infcx),
+ infcx.implied_bounds_tys(param_env, id, wf_tys.iter().map(|ty| *ty)),
+ );
let region_bound_pairs = outlives_environment.region_bound_pairs();
add_constraints(&infcx, region_bound_pairs);