Skip to content

Commit 43cb506

Browse files
Rollup merge of #141541 - compiler-errors:nits, r=lcnr
Random nits Two completely random commits that I didn't know where to integrate into another PR. * Don't use the full type relation machinery to equate two regions (it's overkill). * Add a comment that `select_in_new_trait_solver` shouldn't be used directly. r? lcnr or reassign
2 parents 5cc2733 + 9a8cf3d commit 43cb506

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-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)) => {

compiler/rustc_trait_selection/src/solve/select.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use crate::solve::inspect::{self, ProofTreeInferCtxtExt};
1515

1616
#[extension(pub trait InferCtxtSelectExt<'tcx>)]
1717
impl<'tcx> InferCtxt<'tcx> {
18+
/// Do not use this directly. This is called from [`crate::traits::SelectionContext::select`].
1819
fn select_in_new_trait_solver(
1920
&self,
2021
obligation: &TraitObligation<'tcx>,

0 commit comments

Comments
 (0)