remove an unused DefId
This commit is contained in:
parent
a3beeaa84d
commit
24799e3720
11 changed files with 28 additions and 74 deletions
|
@ -4,7 +4,6 @@
|
||||||
//! and use that to decide when one free region outlives another, and so forth.
|
//! and use that to decide when one free region outlives another, and so forth.
|
||||||
|
|
||||||
use rustc_data_structures::transitive_relation::TransitiveRelation;
|
use rustc_data_structures::transitive_relation::TransitiveRelation;
|
||||||
use rustc_hir::def_id::DefId;
|
|
||||||
use rustc_middle::ty::{self, Lift, Region, TyCtxt};
|
use rustc_middle::ty::{self, Lift, Region, TyCtxt};
|
||||||
|
|
||||||
/// Combines a `FreeRegionMap` and a `TyCtxt`.
|
/// Combines a `FreeRegionMap` and a `TyCtxt`.
|
||||||
|
@ -14,16 +13,13 @@ use rustc_middle::ty::{self, Lift, Region, TyCtxt};
|
||||||
pub(crate) struct RegionRelations<'a, 'tcx> {
|
pub(crate) struct RegionRelations<'a, 'tcx> {
|
||||||
pub tcx: TyCtxt<'tcx>,
|
pub tcx: TyCtxt<'tcx>,
|
||||||
|
|
||||||
/// The context used for debug messages
|
|
||||||
pub context: DefId,
|
|
||||||
|
|
||||||
/// Free-region relationships.
|
/// Free-region relationships.
|
||||||
pub free_regions: &'a FreeRegionMap<'tcx>,
|
pub free_regions: &'a FreeRegionMap<'tcx>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, 'tcx> RegionRelations<'a, 'tcx> {
|
impl<'a, 'tcx> RegionRelations<'a, 'tcx> {
|
||||||
pub fn new(tcx: TyCtxt<'tcx>, context: DefId, free_regions: &'a FreeRegionMap<'tcx>) -> Self {
|
pub fn new(tcx: TyCtxt<'tcx>, free_regions: &'a FreeRegionMap<'tcx>) -> Self {
|
||||||
Self { tcx, context, free_regions }
|
Self { tcx, free_regions }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn lub_free_regions(&self, r_a: Region<'tcx>, r_b: Region<'tcx>) -> Region<'tcx> {
|
pub fn lub_free_regions(&self, r_a: Region<'tcx>, r_b: Region<'tcx>) -> Region<'tcx> {
|
||||||
|
|
|
@ -120,13 +120,9 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
|
||||||
) -> LexicalRegionResolutions<'tcx> {
|
) -> LexicalRegionResolutions<'tcx> {
|
||||||
let mut var_data = self.construct_var_data(self.tcx());
|
let mut var_data = self.construct_var_data(self.tcx());
|
||||||
|
|
||||||
// Dorky hack to cause `dump_constraints` to only get called
|
if cfg!(debug_assertions) {
|
||||||
// if debug mode is enabled:
|
self.dump_constraints();
|
||||||
debug!(
|
}
|
||||||
"----() End constraint listing (context={:?}) {:?}---",
|
|
||||||
self.region_rels.context,
|
|
||||||
self.dump_constraints(self.region_rels)
|
|
||||||
);
|
|
||||||
|
|
||||||
let graph = self.construct_graph();
|
let graph = self.construct_graph();
|
||||||
self.expand_givens(&graph);
|
self.expand_givens(&graph);
|
||||||
|
@ -156,8 +152,8 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn dump_constraints(&self, free_regions: &RegionRelations<'_, 'tcx>) {
|
#[instrument(level = "debug", skip(self))]
|
||||||
debug!("----() Start constraint listing (context={:?}) ()----", free_regions.context);
|
fn dump_constraints(&self) {
|
||||||
for (idx, (constraint, _)) in self.data.constraints.iter().enumerate() {
|
for (idx, (constraint, _)) in self.data.constraints.iter().enumerate() {
|
||||||
debug!("Constraint {} => {:?}", idx, constraint);
|
debug!("Constraint {} => {:?}", idx, constraint);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1267,7 +1267,6 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
||||||
/// `resolve_vars_if_possible` as well as `fully_resolve`.
|
/// `resolve_vars_if_possible` as well as `fully_resolve`.
|
||||||
pub fn resolve_regions(
|
pub fn resolve_regions(
|
||||||
&self,
|
&self,
|
||||||
region_context: DefId,
|
|
||||||
outlives_env: &OutlivesEnvironment<'tcx>,
|
outlives_env: &OutlivesEnvironment<'tcx>,
|
||||||
) -> Vec<RegionResolutionError<'tcx>> {
|
) -> Vec<RegionResolutionError<'tcx>> {
|
||||||
let (var_infos, data) = {
|
let (var_infos, data) = {
|
||||||
|
@ -1286,8 +1285,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
||||||
.into_infos_and_data()
|
.into_infos_and_data()
|
||||||
};
|
};
|
||||||
|
|
||||||
let region_rels =
|
let region_rels = &RegionRelations::new(self.tcx, outlives_env.free_region_map());
|
||||||
&RegionRelations::new(self.tcx, region_context, outlives_env.free_region_map());
|
|
||||||
|
|
||||||
let (lexical_region_resolutions, errors) =
|
let (lexical_region_resolutions, errors) =
|
||||||
lexical_region_resolve::resolve(outlives_env.param_env, region_rels, var_infos, data);
|
lexical_region_resolve::resolve(outlives_env.param_env, region_rels, var_infos, data);
|
||||||
|
@ -1302,12 +1300,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
||||||
/// result. After this, no more unification operations should be
|
/// result. After this, no more unification operations should be
|
||||||
/// done -- or the compiler will panic -- but it is legal to use
|
/// done -- or the compiler will panic -- but it is legal to use
|
||||||
/// `resolve_vars_if_possible` as well as `fully_resolve`.
|
/// `resolve_vars_if_possible` as well as `fully_resolve`.
|
||||||
pub fn resolve_regions_and_report_errors(
|
pub fn resolve_regions_and_report_errors(&self, outlives_env: &OutlivesEnvironment<'tcx>) {
|
||||||
&self,
|
let errors = self.resolve_regions(outlives_env);
|
||||||
region_context: DefId,
|
|
||||||
outlives_env: &OutlivesEnvironment<'tcx>,
|
|
||||||
) {
|
|
||||||
let errors = self.resolve_regions(region_context, outlives_env);
|
|
||||||
|
|
||||||
if !self.is_tainted_by_errors() {
|
if !self.is_tainted_by_errors() {
|
||||||
// As a heuristic, just skip reporting region errors
|
// As a heuristic, just skip reporting region errors
|
||||||
|
|
|
@ -317,14 +317,13 @@ fn negative_impl<'cx, 'tcx>(
|
||||||
let (subject2, obligations) =
|
let (subject2, obligations) =
|
||||||
impl_subject_and_oblig(selcx, impl_env, impl2_def_id, impl2_substs);
|
impl_subject_and_oblig(selcx, impl_env, impl2_def_id, impl2_substs);
|
||||||
|
|
||||||
!equate(&infcx, impl_env, impl1_def_id, subject1, subject2, obligations)
|
!equate(&infcx, impl_env, subject1, subject2, obligations)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn equate<'cx, 'tcx>(
|
fn equate<'cx, 'tcx>(
|
||||||
infcx: &InferCtxt<'cx, 'tcx>,
|
infcx: &InferCtxt<'cx, 'tcx>,
|
||||||
impl_env: ty::ParamEnv<'tcx>,
|
impl_env: ty::ParamEnv<'tcx>,
|
||||||
impl1_def_id: DefId,
|
|
||||||
subject1: ImplSubject<'tcx>,
|
subject1: ImplSubject<'tcx>,
|
||||||
subject2: ImplSubject<'tcx>,
|
subject2: ImplSubject<'tcx>,
|
||||||
obligations: impl Iterator<Item = PredicateObligation<'tcx>>,
|
obligations: impl Iterator<Item = PredicateObligation<'tcx>>,
|
||||||
|
@ -341,7 +340,7 @@ fn equate<'cx, 'tcx>(
|
||||||
let opt_failing_obligation = obligations
|
let opt_failing_obligation = obligations
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.chain(more_obligations)
|
.chain(more_obligations)
|
||||||
.find(|o| negative_impl_exists(selcx, impl_env, impl1_def_id, o));
|
.find(|o| negative_impl_exists(selcx, impl_env, o));
|
||||||
|
|
||||||
if let Some(failing_obligation) = opt_failing_obligation {
|
if let Some(failing_obligation) = opt_failing_obligation {
|
||||||
debug!("overlap: obligation unsatisfiable {:?}", failing_obligation);
|
debug!("overlap: obligation unsatisfiable {:?}", failing_obligation);
|
||||||
|
@ -356,18 +355,17 @@ fn equate<'cx, 'tcx>(
|
||||||
fn negative_impl_exists<'cx, 'tcx>(
|
fn negative_impl_exists<'cx, 'tcx>(
|
||||||
selcx: &SelectionContext<'cx, 'tcx>,
|
selcx: &SelectionContext<'cx, 'tcx>,
|
||||||
param_env: ty::ParamEnv<'tcx>,
|
param_env: ty::ParamEnv<'tcx>,
|
||||||
region_context: DefId,
|
|
||||||
o: &PredicateObligation<'tcx>,
|
o: &PredicateObligation<'tcx>,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
let infcx = &selcx.infcx().fork();
|
let infcx = &selcx.infcx().fork();
|
||||||
|
|
||||||
if resolve_negative_obligation(infcx, param_env, region_context, o) {
|
if resolve_negative_obligation(infcx, param_env, o) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to prove a negative obligation exists for super predicates
|
// Try to prove a negative obligation exists for super predicates
|
||||||
for o in util::elaborate_predicates(infcx.tcx, iter::once(o.predicate)) {
|
for o in util::elaborate_predicates(infcx.tcx, iter::once(o.predicate)) {
|
||||||
if resolve_negative_obligation(infcx, param_env, region_context, &o) {
|
if resolve_negative_obligation(infcx, param_env, &o) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -379,7 +377,6 @@ fn negative_impl_exists<'cx, 'tcx>(
|
||||||
fn resolve_negative_obligation<'cx, 'tcx>(
|
fn resolve_negative_obligation<'cx, 'tcx>(
|
||||||
infcx: &InferCtxt<'cx, 'tcx>,
|
infcx: &InferCtxt<'cx, 'tcx>,
|
||||||
param_env: ty::ParamEnv<'tcx>,
|
param_env: ty::ParamEnv<'tcx>,
|
||||||
region_context: DefId,
|
|
||||||
o: &PredicateObligation<'tcx>,
|
o: &PredicateObligation<'tcx>,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
let tcx = infcx.tcx;
|
let tcx = infcx.tcx;
|
||||||
|
@ -409,7 +406,7 @@ fn resolve_negative_obligation<'cx, 'tcx>(
|
||||||
|
|
||||||
infcx.process_registered_region_obligations(outlives_env.region_bound_pairs_map(), param_env);
|
infcx.process_registered_region_obligations(outlives_env.region_bound_pairs_map(), param_env);
|
||||||
|
|
||||||
let errors = infcx.resolve_regions(region_context, &outlives_env);
|
let errors = infcx.resolve_regions(&outlives_env);
|
||||||
|
|
||||||
if !errors.is_empty() {
|
if !errors.is_empty() {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -198,17 +198,13 @@ pub fn type_known_to_meet_bound_modulo_regions<'a, 'tcx>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[instrument(level = "debug", skip(tcx, elaborated_env))]
|
||||||
fn do_normalize_predicates<'tcx>(
|
fn do_normalize_predicates<'tcx>(
|
||||||
tcx: TyCtxt<'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
region_context: DefId,
|
|
||||||
cause: ObligationCause<'tcx>,
|
cause: ObligationCause<'tcx>,
|
||||||
elaborated_env: ty::ParamEnv<'tcx>,
|
elaborated_env: ty::ParamEnv<'tcx>,
|
||||||
predicates: Vec<ty::Predicate<'tcx>>,
|
predicates: Vec<ty::Predicate<'tcx>>,
|
||||||
) -> Result<Vec<ty::Predicate<'tcx>>, ErrorGuaranteed> {
|
) -> Result<Vec<ty::Predicate<'tcx>>, ErrorGuaranteed> {
|
||||||
debug!(
|
|
||||||
"do_normalize_predicates(predicates={:?}, region_context={:?}, cause={:?})",
|
|
||||||
predicates, region_context, cause,
|
|
||||||
);
|
|
||||||
let span = cause.span;
|
let span = cause.span;
|
||||||
tcx.infer_ctxt().enter(|infcx| {
|
tcx.infer_ctxt().enter(|infcx| {
|
||||||
// FIXME. We should really... do something with these region
|
// FIXME. We should really... do something with these region
|
||||||
|
@ -240,7 +236,7 @@ fn do_normalize_predicates<'tcx>(
|
||||||
// cares about declarations like `'a: 'b`.
|
// cares about declarations like `'a: 'b`.
|
||||||
let outlives_env = OutlivesEnvironment::new(elaborated_env);
|
let outlives_env = OutlivesEnvironment::new(elaborated_env);
|
||||||
|
|
||||||
infcx.resolve_regions_and_report_errors(region_context, &outlives_env);
|
infcx.resolve_regions_and_report_errors(&outlives_env);
|
||||||
|
|
||||||
let predicates = match infcx.fully_resolve(predicates) {
|
let predicates = match infcx.fully_resolve(predicates) {
|
||||||
Ok(predicates) => predicates,
|
Ok(predicates) => predicates,
|
||||||
|
@ -269,9 +265,9 @@ fn do_normalize_predicates<'tcx>(
|
||||||
|
|
||||||
// FIXME: this is gonna need to be removed ...
|
// FIXME: this is gonna need to be removed ...
|
||||||
/// Normalizes the parameter environment, reporting errors if they occur.
|
/// Normalizes the parameter environment, reporting errors if they occur.
|
||||||
|
#[instrument(level = "debug", skip(tcx))]
|
||||||
pub fn normalize_param_env_or_error<'tcx>(
|
pub fn normalize_param_env_or_error<'tcx>(
|
||||||
tcx: TyCtxt<'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
region_context: DefId,
|
|
||||||
unnormalized_env: ty::ParamEnv<'tcx>,
|
unnormalized_env: ty::ParamEnv<'tcx>,
|
||||||
cause: ObligationCause<'tcx>,
|
cause: ObligationCause<'tcx>,
|
||||||
) -> ty::ParamEnv<'tcx> {
|
) -> ty::ParamEnv<'tcx> {
|
||||||
|
@ -289,12 +285,6 @@ pub fn normalize_param_env_or_error<'tcx>(
|
||||||
// parameter environments once for every fn as it goes,
|
// parameter environments once for every fn as it goes,
|
||||||
// and errors will get reported then; so outside of type inference we
|
// and errors will get reported then; so outside of type inference we
|
||||||
// can be sure that no errors should occur.
|
// can be sure that no errors should occur.
|
||||||
|
|
||||||
debug!(
|
|
||||||
"normalize_param_env_or_error(region_context={:?}, unnormalized_env={:?}, cause={:?})",
|
|
||||||
region_context, unnormalized_env, cause
|
|
||||||
);
|
|
||||||
|
|
||||||
let mut predicates: Vec<_> =
|
let mut predicates: Vec<_> =
|
||||||
util::elaborate_predicates(tcx, unnormalized_env.caller_bounds().into_iter())
|
util::elaborate_predicates(tcx, unnormalized_env.caller_bounds().into_iter())
|
||||||
.map(|obligation| obligation.predicate)
|
.map(|obligation| obligation.predicate)
|
||||||
|
@ -338,7 +328,6 @@ pub fn normalize_param_env_or_error<'tcx>(
|
||||||
);
|
);
|
||||||
let Ok(non_outlives_predicates) = do_normalize_predicates(
|
let Ok(non_outlives_predicates) = do_normalize_predicates(
|
||||||
tcx,
|
tcx,
|
||||||
region_context,
|
|
||||||
cause.clone(),
|
cause.clone(),
|
||||||
elaborated_env,
|
elaborated_env,
|
||||||
predicates,
|
predicates,
|
||||||
|
@ -362,7 +351,6 @@ pub fn normalize_param_env_or_error<'tcx>(
|
||||||
);
|
);
|
||||||
let Ok(outlives_predicates) = do_normalize_predicates(
|
let Ok(outlives_predicates) = do_normalize_predicates(
|
||||||
tcx,
|
tcx,
|
||||||
region_context,
|
|
||||||
cause,
|
cause,
|
||||||
outlives_env,
|
outlives_env,
|
||||||
outlives_predicates,
|
outlives_predicates,
|
||||||
|
|
|
@ -211,7 +211,7 @@ fn param_env(tcx: TyCtxt<'_>, def_id: DefId) -> ty::ParamEnv<'_> {
|
||||||
tcx.hir().maybe_body_owned_by(id).map_or(id, |body| body.hir_id)
|
tcx.hir().maybe_body_owned_by(id).map_or(id, |body| body.hir_id)
|
||||||
});
|
});
|
||||||
let cause = traits::ObligationCause::misc(tcx.def_span(def_id), body_id);
|
let cause = traits::ObligationCause::misc(tcx.def_span(def_id), body_id);
|
||||||
traits::normalize_param_env_or_error(tcx, def_id, unnormalized_env, cause)
|
traits::normalize_param_env_or_error(tcx, unnormalized_env, cause)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Elaborate the environment.
|
/// Elaborate the environment.
|
||||||
|
|
|
@ -208,8 +208,7 @@ fn compare_predicate_entailment<'tcx>(
|
||||||
Reveal::UserFacing,
|
Reveal::UserFacing,
|
||||||
hir::Constness::NotConst,
|
hir::Constness::NotConst,
|
||||||
);
|
);
|
||||||
let param_env =
|
let param_env = traits::normalize_param_env_or_error(tcx, param_env, normalize_cause);
|
||||||
traits::normalize_param_env_or_error(tcx, impl_m.def_id, param_env, normalize_cause);
|
|
||||||
|
|
||||||
tcx.infer_ctxt().enter(|infcx| {
|
tcx.infer_ctxt().enter(|infcx| {
|
||||||
let inh = Inherited::new(infcx, impl_m.def_id.expect_local());
|
let inh = Inherited::new(infcx, impl_m.def_id.expect_local());
|
||||||
|
@ -1247,12 +1246,7 @@ fn compare_type_predicate_entailment<'tcx>(
|
||||||
Reveal::UserFacing,
|
Reveal::UserFacing,
|
||||||
hir::Constness::NotConst,
|
hir::Constness::NotConst,
|
||||||
);
|
);
|
||||||
let param_env = traits::normalize_param_env_or_error(
|
let param_env = traits::normalize_param_env_or_error(tcx, param_env, normalize_cause.clone());
|
||||||
tcx,
|
|
||||||
impl_ty.def_id,
|
|
||||||
param_env,
|
|
||||||
normalize_cause.clone(),
|
|
||||||
);
|
|
||||||
tcx.infer_ctxt().enter(|infcx| {
|
tcx.infer_ctxt().enter(|infcx| {
|
||||||
let inh = Inherited::new(infcx, impl_ty.def_id.expect_local());
|
let inh = Inherited::new(infcx, impl_ty.def_id.expect_local());
|
||||||
let infcx = &inh.infcx;
|
let infcx = &inh.infcx;
|
||||||
|
|
|
@ -222,10 +222,8 @@ pub struct RegionCtxt<'a, 'tcx> {
|
||||||
|
|
||||||
// id of innermost fn body id
|
// id of innermost fn body id
|
||||||
body_id: hir::HirId,
|
body_id: hir::HirId,
|
||||||
|
// TODO: is this always equal to `body_id`?
|
||||||
body_owner: LocalDefId,
|
body_owner: LocalDefId,
|
||||||
|
|
||||||
// id of AST node being analyzed (the subject of the analysis).
|
|
||||||
subject_def_id: LocalDefId,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, 'tcx> Deref for RegionCtxt<'a, 'tcx> {
|
impl<'a, 'tcx> Deref for RegionCtxt<'a, 'tcx> {
|
||||||
|
@ -245,13 +243,7 @@ impl<'a, 'tcx> RegionCtxt<'a, 'tcx> {
|
||||||
param_env: ty::ParamEnv<'tcx>,
|
param_env: ty::ParamEnv<'tcx>,
|
||||||
) -> RegionCtxt<'a, 'tcx> {
|
) -> RegionCtxt<'a, 'tcx> {
|
||||||
let outlives_environment = OutlivesEnvironment::new(param_env);
|
let outlives_environment = OutlivesEnvironment::new(param_env);
|
||||||
RegionCtxt {
|
RegionCtxt { fcx, body_id: initial_body_id, body_owner: subject, outlives_environment }
|
||||||
fcx,
|
|
||||||
body_id: initial_body_id,
|
|
||||||
body_owner: subject,
|
|
||||||
subject_def_id: subject,
|
|
||||||
outlives_environment,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Try to resolve the type for the given node, returning `t_err` if an error results. Note that
|
/// Try to resolve the type for the given node, returning `t_err` if an error results. Note that
|
||||||
|
@ -369,10 +361,7 @@ impl<'a, 'tcx> RegionCtxt<'a, 'tcx> {
|
||||||
self.param_env,
|
self.param_env,
|
||||||
);
|
);
|
||||||
|
|
||||||
self.fcx.resolve_regions_and_report_errors(
|
self.fcx.resolve_regions_and_report_errors(&self.outlives_environment);
|
||||||
self.subject_def_id.to_def_id(),
|
|
||||||
&self.outlives_environment,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn constrain_bindings_in_pat(&mut self, pat: &hir::Pat<'_>) {
|
fn constrain_bindings_in_pat(&mut self, pat: &hir::Pat<'_>) {
|
||||||
|
|
|
@ -661,7 +661,7 @@ fn resolve_regions_with_wf_tys<'tcx>(
|
||||||
|
|
||||||
add_constraints(&infcx, region_bound_pairs);
|
add_constraints(&infcx, region_bound_pairs);
|
||||||
|
|
||||||
let errors = infcx.resolve_regions(id.expect_owner().to_def_id(), &outlives_environment);
|
let errors = infcx.resolve_regions(&outlives_environment);
|
||||||
|
|
||||||
debug!(?errors, "errors");
|
debug!(?errors, "errors");
|
||||||
|
|
||||||
|
|
|
@ -349,7 +349,7 @@ fn visit_implementation_of_dispatch_from_dyn<'tcx>(tcx: TyCtxt<'tcx>, impl_did:
|
||||||
|
|
||||||
// Finally, resolve all regions.
|
// Finally, resolve all regions.
|
||||||
let outlives_env = OutlivesEnvironment::new(param_env);
|
let outlives_env = OutlivesEnvironment::new(param_env);
|
||||||
infcx.resolve_regions_and_report_errors(impl_did.to_def_id(), &outlives_env);
|
infcx.resolve_regions_and_report_errors(&outlives_env);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
|
@ -606,7 +606,7 @@ pub fn coerce_unsized_info<'tcx>(tcx: TyCtxt<'tcx>, impl_did: DefId) -> CoerceUn
|
||||||
|
|
||||||
// Finally, resolve all regions.
|
// Finally, resolve all regions.
|
||||||
let outlives_env = OutlivesEnvironment::new(param_env);
|
let outlives_env = OutlivesEnvironment::new(param_env);
|
||||||
infcx.resolve_regions_and_report_errors(impl_did.to_def_id(), &outlives_env);
|
infcx.resolve_regions_and_report_errors(&outlives_env);
|
||||||
|
|
||||||
CoerceUnsizedInfo { custom_kind: kind }
|
CoerceUnsizedInfo { custom_kind: kind }
|
||||||
})
|
})
|
||||||
|
|
|
@ -150,7 +150,7 @@ fn get_impl_substs<'tcx>(
|
||||||
|
|
||||||
// Conservatively use an empty `ParamEnv`.
|
// Conservatively use an empty `ParamEnv`.
|
||||||
let outlives_env = OutlivesEnvironment::new(ty::ParamEnv::empty());
|
let outlives_env = OutlivesEnvironment::new(ty::ParamEnv::empty());
|
||||||
infcx.resolve_regions_and_report_errors(impl1_def_id.to_def_id(), &outlives_env);
|
infcx.resolve_regions_and_report_errors(&outlives_env);
|
||||||
let Ok(impl2_substs) = infcx.fully_resolve(impl2_substs) else {
|
let Ok(impl2_substs) = infcx.fully_resolve(impl2_substs) else {
|
||||||
let span = tcx.def_span(impl1_def_id);
|
let span = tcx.def_span(impl1_def_id);
|
||||||
tcx.sess.emit_err(SubstsOnOverriddenImpl { span });
|
tcx.sess.emit_err(SubstsOnOverriddenImpl { span });
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue