Consolidate OutlivesEnv construction with resolve_regions

This commit is contained in:
Michael Goulet
2025-01-25 03:03:39 +00:00
parent fdd1a3b026
commit 2b8930c71c
16 changed files with 75 additions and 121 deletions

View File

@@ -80,7 +80,6 @@ use rustc_errors::{Diag, ErrorGuaranteed, pluralize, struct_span_code_err};
use rustc_hir::def_id::{DefId, LocalDefId};
use rustc_hir::intravisit::Visitor;
use rustc_index::bit_set::DenseBitSet;
use rustc_infer::infer::outlives::env::OutlivesEnvironment;
use rustc_infer::infer::{self, TyCtxtInferExt as _};
use rustc_infer::traits::ObligationCause;
use rustc_middle::query::Providers;
@@ -655,8 +654,7 @@ pub fn check_function_signature<'tcx>(
}
}
let outlives_env = OutlivesEnvironment::new(param_env);
if let Err(e) = ocx.resolve_regions_and_report_errors(local_id, &outlives_env) {
if let Err(e) = ocx.resolve_regions_and_report_errors(local_id, param_env, []) {
return Err(e);
}