Skip to content

Commit 7820d2c

Browse files
Don't use relation just to equate regions in response
1 parent 3d86494 commit 7820d2c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

compiler/rustc_infer/src/infer/canonical/query_response.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use crate::infer::canonical::{
2323
QueryOutlivesConstraint, QueryRegionConstraints, QueryResponse,
2424
};
2525
use crate::infer::region_constraints::{Constraint, RegionConstraintData};
26-
use crate::infer::{DefineOpaqueTypes, InferCtxt, InferOk, InferResult};
26+
use crate::infer::{DefineOpaqueTypes, InferCtxt, InferOk, InferResult, SubregionOrigin};
2727
use crate::traits::query::NoSolution;
2828
use crate::traits::{
2929
Obligation, ObligationCause, PredicateObligation, PredicateObligations, ScrubbedTraitError,
@@ -593,10 +593,10 @@ impl<'tcx> InferCtxt<'tcx> {
593593
// no action needed
594594
}
595595
(GenericArgKind::Lifetime(v1), GenericArgKind::Lifetime(v2)) => {
596-
obligations.extend(
597-
self.at(cause, param_env)
598-
.eq(DefineOpaqueTypes::Yes, v1, v2)?
599-
.into_obligations(),
596+
self.inner.borrow_mut().unwrap_region_constraints().make_eqregion(
597+
SubregionOrigin::RelateRegionParamBound(cause.span, None),
598+
v1,
599+
v2,
600600
);
601601
}
602602
(GenericArgKind::Const(v1), GenericArgKind::Const(v2)) => {

0 commit comments

Comments
 (0)