diff options
| author | Michael Goulet <michael@errs.io> | 2025-01-25 03:03:39 +0000 | 
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-01-28 18:55:03 +0000 | 
| commit | 2b8930c71c8040d338f99e1b1be6f1056edd6638 (patch) | |
| tree | 28f8f86fad208abcfa6716b93393453684f7d79e /compiler/rustc_trait_selection/src/traits/coherence.rs | |
| parent | fdd1a3b02687817cea41f6bacae3d5fbed2b2cd0 (diff) | |
| download | rust-2b8930c71c8040d338f99e1b1be6f1056edd6638.tar.gz rust-2b8930c71c8040d338f99e1b1be6f1056edd6638.zip  | |
Consolidate OutlivesEnv construction with resolve_regions
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits/coherence.rs')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/coherence.rs | 6 | 
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/coherence.rs b/compiler/rustc_trait_selection/src/traits/coherence.rs index 50d47d20e1a..7ee9eb45309 100644 --- a/compiler/rustc_trait_selection/src/traits/coherence.rs +++ b/compiler/rustc_trait_selection/src/traits/coherence.rs @@ -9,7 +9,7 @@ use std::fmt::Debug; use rustc_data_structures::fx::{FxHashSet, FxIndexSet}; use rustc_errors::{Diag, EmissionGuarantee}; use rustc_hir::def::DefKind; -use rustc_hir::def_id::DefId; +use rustc_hir::def_id::{CRATE_DEF_ID, DefId}; use rustc_infer::infer::{DefineOpaqueTypes, InferCtxt, TyCtxtInferExt}; use rustc_infer::traits::PredicateObligations; use rustc_middle::bug; @@ -27,7 +27,6 @@ use tracing::{debug, instrument, warn}; use super::ObligationCtxt; use crate::error_reporting::traits::suggest_new_overflow_limit; use crate::infer::InferOk; -use crate::infer::outlives::env::OutlivesEnvironment; use crate::solve::inspect::{InspectGoal, ProofTreeInferCtxtExt, ProofTreeVisitor}; use crate::solve::{SolverDelegate, deeply_normalize_for_diagnostics, inspect}; use crate::traits::query::evaluate_obligation::InferCtxtExt; @@ -596,8 +595,7 @@ fn try_prove_negated_where_clause<'tcx>( // FIXME: We could use the assumed_wf_types from both impls, I think, // if that wasn't implemented just for LocalDefId, and we'd need to do // the normalization ourselves since this is totally fallible... - let outlives_env = OutlivesEnvironment::new(param_env); - let errors = ocx.resolve_regions(&outlives_env); + let errors = ocx.resolve_regions(CRATE_DEF_ID, param_env, []); if !errors.is_empty() { return false; }  | 
