Skip to content

Commit 8b89d80

Browse files
Remove some glob imports from the type system
1 parent f9c15f4 commit 8b89d80

File tree

32 files changed

+243
-185
lines changed

32 files changed

+243
-185
lines changed

compiler/rustc_borrowck/src/diagnostics/region_errors.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rustc_hir::def::Res::Def;
1010
use rustc_hir::def_id::DefId;
1111
use rustc_hir::intravisit::VisitorExt;
1212
use rustc_hir::{PolyTraitRef, TyKind, WhereBoundPredicate};
13-
use rustc_infer::infer::{NllRegionVariableOrigin, RelateParamBound};
13+
use rustc_infer::infer::{NllRegionVariableOrigin, SubregionOrigin};
1414
use rustc_middle::bug;
1515
use rustc_middle::hir::place::PlaceBase;
1616
use rustc_middle::mir::{AnnotationSource, ConstraintCategory, ReturnConstraint};
@@ -329,7 +329,8 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
329329
self.infcx.tcx,
330330
type_test.generic_kind.to_ty(self.infcx.tcx),
331331
);
332-
let origin = RelateParamBound(type_test_span, generic_ty, None);
332+
let origin =
333+
SubregionOrigin::RelateParamBound(type_test_span, generic_ty, None);
333334
self.buffer_error(self.infcx.err_ctxt().construct_generic_bound_failure(
334335
self.body.source.def_id().expect_local(),
335336
type_test_span,

compiler/rustc_borrowck/src/type_check/constraint_conversion.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use rustc_infer::infer::canonical::QueryRegionConstraints;
33
use rustc_infer::infer::outlives::env::RegionBoundPairs;
44
use rustc_infer::infer::outlives::obligations::{TypeOutlives, TypeOutlivesDelegate};
55
use rustc_infer::infer::region_constraints::{GenericKind, VerifyBound};
6-
use rustc_infer::infer::{self, InferCtxt, SubregionOrigin};
6+
use rustc_infer::infer::{InferCtxt, SubregionOrigin};
77
use rustc_infer::traits::query::type_op::DeeplyNormalize;
88
use rustc_middle::bug;
99
use rustc_middle::ty::{
@@ -172,7 +172,7 @@ impl<'a, 'tcx> ConstraintConversion<'a, 'tcx> {
172172
ty::Region::new_var(tcx, universal_regions.implicit_region_bound());
173173
// we don't actually use this for anything, but
174174
// the `TypeOutlives` code needs an origin.
175-
let origin = infer::RelateParamBound(self.span, t1, None);
175+
let origin = SubregionOrigin::RelateParamBound(self.span, t1, None);
176176
TypeOutlives::new(
177177
&mut *self,
178178
tcx,

compiler/rustc_borrowck/src/type_check/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use rustc_infer::infer::canonical::QueryRegionConstraints;
1616
use rustc_infer::infer::outlives::env::RegionBoundPairs;
1717
use rustc_infer::infer::region_constraints::RegionConstraintData;
1818
use rustc_infer::infer::{
19-
BoundRegion, BoundRegionConversionTime, InferCtxt, NllRegionVariableOrigin,
19+
BoundRegionConversionTime, InferCtxt, NllRegionVariableOrigin, RegionVariableOrigin,
2020
};
2121
use rustc_infer::traits::PredicateObligations;
2222
use rustc_middle::mir::visit::{NonMutatingUseContext, PlaceContext, Visitor};
@@ -794,7 +794,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
794794
};
795795

796796
self.infcx.next_region_var(
797-
BoundRegion(
797+
RegionVariableOrigin::BoundRegion(
798798
term.source_info.span,
799799
br.kind,
800800
BoundRegionConversionTime::FnCall,

compiler/rustc_hir_analysis/src/check/compare_impl_item.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_errors::{Applicability, ErrorGuaranteed, MultiSpan, pluralize, struct_
99
use rustc_hir::def::{DefKind, Res};
1010
use rustc_hir::intravisit::VisitorExt;
1111
use rustc_hir::{self as hir, AmbigArg, GenericParamKind, ImplItemKind, intravisit};
12-
use rustc_infer::infer::{self, InferCtxt, TyCtxtInferExt};
12+
use rustc_infer::infer::{self, BoundRegionConversionTime, InferCtxt, TyCtxtInferExt};
1313
use rustc_infer::traits::util;
1414
use rustc_middle::ty::error::{ExpectedFound, TypeError};
1515
use rustc_middle::ty::{
@@ -311,7 +311,7 @@ fn compare_method_predicate_entailment<'tcx>(
311311

312312
let unnormalized_impl_sig = infcx.instantiate_binder_with_fresh_vars(
313313
impl_m_span,
314-
infer::HigherRankedType,
314+
BoundRegionConversionTime::HigherRankedType,
315315
tcx.fn_sig(impl_m.def_id).instantiate_identity(),
316316
);
317317

@@ -518,7 +518,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
518518
param_env,
519519
infcx.instantiate_binder_with_fresh_vars(
520520
return_span,
521-
infer::HigherRankedType,
521+
BoundRegionConversionTime::HigherRankedType,
522522
tcx.fn_sig(impl_m.def_id).instantiate_identity(),
523523
),
524524
);

compiler/rustc_hir_analysis/src/check/wfcheck.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc_hir::def_id::{DefId, LocalDefId};
1111
use rustc_hir::lang_items::LangItem;
1212
use rustc_hir::{AmbigArg, ItemKind};
1313
use rustc_infer::infer::outlives::env::OutlivesEnvironment;
14-
use rustc_infer::infer::{self, InferCtxt, TyCtxtInferExt};
14+
use rustc_infer::infer::{self, InferCtxt, SubregionOrigin, TyCtxtInferExt};
1515
use rustc_lint_defs::builtin::SUPERTRAIT_ITEM_SHADOWING_DEFINITION;
1616
use rustc_macros::LintDiagnostic;
1717
use rustc_middle::mir::interpret::ErrorHandled;
@@ -741,7 +741,7 @@ fn ty_known_to_outlive<'tcx>(
741741
infcx.register_type_outlives_constraint_inner(infer::TypeOutlivesConstraint {
742742
sub_region: region,
743743
sup_type: ty,
744-
origin: infer::RelateParamBound(DUMMY_SP, ty, None),
744+
origin: SubregionOrigin::RelateParamBound(DUMMY_SP, ty, None),
745745
});
746746
})
747747
}
@@ -757,7 +757,11 @@ fn region_known_to_outlive<'tcx>(
757757
region_b: ty::Region<'tcx>,
758758
) -> bool {
759759
test_region_obligations(tcx, id, param_env, wf_tys, |infcx| {
760-
infcx.sub_regions(infer::RelateRegionParamBound(DUMMY_SP, None), region_b, region_a);
760+
infcx.sub_regions(
761+
SubregionOrigin::RelateRegionParamBound(DUMMY_SP, None),
762+
region_b,
763+
region_a,
764+
);
761765
})
762766
}
763767

compiler/rustc_hir_analysis/src/coherence/builtin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rustc_hir as hir;
1010
use rustc_hir::ItemKind;
1111
use rustc_hir::def_id::{DefId, LocalDefId};
1212
use rustc_hir::lang_items::LangItem;
13-
use rustc_infer::infer::{self, RegionResolutionError, TyCtxtInferExt};
13+
use rustc_infer::infer::{self, RegionResolutionError, SubregionOrigin, TyCtxtInferExt};
1414
use rustc_infer::traits::Obligation;
1515
use rustc_middle::ty::adjustment::CoerceUnsizedInfo;
1616
use rustc_middle::ty::print::PrintTraitRefExt as _;
@@ -415,7 +415,7 @@ pub(crate) fn coerce_unsized_info<'tcx>(
415415
};
416416
let (source, target, trait_def_id, kind, field_span) = match (source.kind(), target.kind()) {
417417
(&ty::Ref(r_a, ty_a, mutbl_a), &ty::Ref(r_b, ty_b, mutbl_b)) => {
418-
infcx.sub_regions(infer::RelateObjectBound(span), r_b, r_a);
418+
infcx.sub_regions(SubregionOrigin::RelateObjectBound(span), r_b, r_a);
419419
let mt_a = ty::TypeAndMut { ty: ty_a, mutbl: mutbl_a };
420420
let mt_b = ty::TypeAndMut { ty: ty_b, mutbl: mutbl_b };
421421
check_mutbl(mt_a, mt_b, &|ty| Ty::new_imm_ref(tcx, r_b, ty))

compiler/rustc_hir_typeck/src/callee.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use rustc_hir::def::{self, CtorKind, Namespace, Res};
77
use rustc_hir::def_id::DefId;
88
use rustc_hir::{self as hir, HirId, LangItem};
99
use rustc_hir_analysis::autoderef::Autoderef;
10-
use rustc_infer::infer;
10+
use rustc_infer::infer::BoundRegionConversionTime;
1111
use rustc_infer::traits::{Obligation, ObligationCause, ObligationCauseCode};
1212
use rustc_middle::ty::adjustment::{
1313
Adjust, Adjustment, AllowTwoPhase, AutoBorrow, AutoBorrowMutability,
@@ -180,7 +180,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
180180
let closure_sig = args.as_closure().sig();
181181
let closure_sig = self.instantiate_binder_with_fresh_vars(
182182
call_expr.span,
183-
infer::FnCall,
183+
BoundRegionConversionTime::FnCall,
184184
closure_sig,
185185
);
186186
let adjustments = self.adjust_steps(autoderef);
@@ -207,7 +207,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
207207
let closure_args = args.as_coroutine_closure();
208208
let coroutine_closure_sig = self.instantiate_binder_with_fresh_vars(
209209
call_expr.span,
210-
infer::FnCall,
210+
BoundRegionConversionTime::FnCall,
211211
closure_args.coroutine_closure_sig(),
212212
);
213213
let tupled_upvars_ty = self.next_ty_var(callee_expr.span);
@@ -506,7 +506,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
506506
// renormalize the associated types at this point, since they
507507
// previously appeared within a `Binder<>` and hence would not
508508
// have been normalized before.
509-
let fn_sig = self.instantiate_binder_with_fresh_vars(call_expr.span, infer::FnCall, fn_sig);
509+
let fn_sig = self.instantiate_binder_with_fresh_vars(
510+
call_expr.span,
511+
BoundRegionConversionTime::FnCall,
512+
fn_sig,
513+
);
510514
let fn_sig = self.normalize(call_expr.span, fn_sig);
511515

512516
self.check_argument_types(

compiler/rustc_hir_typeck/src/coercion.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ use rustc_hir as hir;
4444
use rustc_hir::def_id::{DefId, LocalDefId};
4545
use rustc_hir_analysis::hir_ty_lowering::HirTyLowerer;
4646
use rustc_infer::infer::relate::RelateResult;
47-
use rustc_infer::infer::{Coercion, DefineOpaqueTypes, InferOk, InferResult};
47+
use rustc_infer::infer::{DefineOpaqueTypes, InferOk, InferResult, RegionVariableOrigin};
4848
use rustc_infer::traits::{
4949
IfExpressionCause, MatchExpressionArmCause, Obligation, PredicateObligation,
5050
PredicateObligations, SelectionError,
@@ -431,7 +431,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
431431
} else {
432432
if r_borrow_var.is_none() {
433433
// create var lazily, at most once
434-
let coercion = Coercion(span);
434+
let coercion = RegionVariableOrigin::Coercion(span);
435435
let r = self.next_region_var(coercion);
436436
r_borrow_var = Some(r); // [4] above
437437
}
@@ -549,7 +549,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
549549
(&ty::Ref(_, ty_a, mutbl_a), &ty::Ref(_, _, mutbl_b)) => {
550550
coerce_mutbls(mutbl_a, mutbl_b)?;
551551

552-
let coercion = Coercion(self.cause.span);
552+
let coercion = RegionVariableOrigin::Coercion(self.cause.span);
553553
let r_borrow = self.next_region_var(coercion);
554554

555555
// We don't allow two-phase borrows here, at least for initial
@@ -672,7 +672,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
672672
return Err(TypeError::Mismatch);
673673
}
674674
}
675-
Err(traits::Unimplemented) => {
675+
Err(SelectionError::Unimplemented) => {
676676
debug!("coerce_unsized: early return - can't prove obligation");
677677
return Err(TypeError::Mismatch);
678678
}

compiler/rustc_hir_typeck/src/expr.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ use rustc_hir::lang_items::LangItem;
2121
use rustc_hir::{Attribute, ExprKind, HirId, QPath};
2222
use rustc_hir_analysis::NoVariantNamed;
2323
use rustc_hir_analysis::hir_ty_lowering::{FeedConstTy, HirTyLowerer as _};
24-
use rustc_infer::infer;
25-
use rustc_infer::infer::{DefineOpaqueTypes, InferOk};
24+
use rustc_infer::infer::{self, DefineOpaqueTypes, InferOk, RegionVariableOrigin};
2625
use rustc_infer::traits::query::NoSolution;
2726
use rustc_middle::ty::adjustment::{Adjust, Adjustment, AllowTwoPhase};
2827
use rustc_middle::ty::error::{ExpectedFound, TypeError};
@@ -704,7 +703,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
704703
// this time with enough precision to check that the value
705704
// whose address was taken can actually be made to live as long
706705
// as it needs to live.
707-
let region = self.next_region_var(infer::BorrowRegion(expr.span));
706+
let region = self.next_region_var(RegionVariableOrigin::BorrowRegion(expr.span));
708707
Ty::new_ref(self.tcx, region, ty, mutbl)
709708
}
710709
}

compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc_hir::{ExprKind, HirId, LangItem, Node, QPath};
1111
use rustc_hir_analysis::check::potentially_plural_count;
1212
use rustc_hir_analysis::hir_ty_lowering::{HirTyLowerer, PermitVariants};
1313
use rustc_index::IndexVec;
14-
use rustc_infer::infer::{DefineOpaqueTypes, InferOk, TypeTrace};
14+
use rustc_infer::infer::{BoundRegionConversionTime, DefineOpaqueTypes, InferOk, TypeTrace};
1515
use rustc_middle::ty::adjustment::AllowTwoPhase;
1616
use rustc_middle::ty::error::TypeError;
1717
use rustc_middle::ty::{self, IsSuggestable, Ty, TyCtxt, TypeVisitableExt};
@@ -30,7 +30,6 @@ use crate::TupleArgumentsFlag::*;
3030
use crate::coercion::CoerceMany;
3131
use crate::errors::SuggestPtrNullMut;
3232
use crate::fn_ctxt::arg_matrix::{ArgMatrix, Compatibility, Error, ExpectedIdx, ProvidedIdx};
33-
use crate::fn_ctxt::infer::FnCall;
3433
use crate::gather_locals::Declaration;
3534
use crate::inline_asm::InlineAsmCtxt;
3635
use crate::method::probe::IsSuggestion;
@@ -657,7 +656,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
657656
let args = self.infcx.fresh_args_for_item(call_name.span, assoc.def_id);
658657
let fn_sig = tcx.fn_sig(assoc.def_id).instantiate(tcx, args);
659658

660-
self.instantiate_binder_with_fresh_vars(call_name.span, FnCall, fn_sig);
659+
self.instantiate_binder_with_fresh_vars(
660+
call_name.span,
661+
BoundRegionConversionTime::FnCall,
662+
fn_sig,
663+
);
661664
}
662665
None
663666
};

compiler/rustc_hir_typeck/src/fn_ctxt/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rustc_errors::DiagCtxtHandle;
1313
use rustc_hir::def_id::{DefId, LocalDefId};
1414
use rustc_hir::{self as hir, HirId, ItemLocalMap};
1515
use rustc_hir_analysis::hir_ty_lowering::{HirTyLowerer, RegionInferReason};
16-
use rustc_infer::infer;
16+
use rustc_infer::infer::{self, RegionVariableOrigin};
1717
use rustc_infer::traits::{DynCompatibilityViolation, Obligation};
1818
use rustc_middle::ty::{self, Const, Ty, TyCtxt, TypeVisitableExt};
1919
use rustc_session::Session;
@@ -240,8 +240,10 @@ impl<'tcx> HirTyLowerer<'tcx> for FnCtxt<'_, 'tcx> {
240240

241241
fn re_infer(&self, span: Span, reason: RegionInferReason<'_>) -> ty::Region<'tcx> {
242242
let v = match reason {
243-
RegionInferReason::Param(def) => infer::RegionParameterDefinition(span, def.name),
244-
_ => infer::MiscVariable(span),
243+
RegionInferReason::Param(def) => {
244+
RegionVariableOrigin::RegionParameterDefinition(span, def.name)
245+
}
246+
_ => RegionVariableOrigin::MiscVariable(span),
245247
};
246248
self.next_region_var(v)
247249
}

compiler/rustc_hir_typeck/src/method/confirm.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ use rustc_hir_analysis::hir_ty_lowering::generics::{
99
use rustc_hir_analysis::hir_ty_lowering::{
1010
FeedConstTy, GenericArgsLowerer, HirTyLowerer, IsMethodCall, RegionInferReason,
1111
};
12-
use rustc_infer::infer::{self, DefineOpaqueTypes, InferOk};
12+
use rustc_infer::infer::{
13+
BoundRegionConversionTime, DefineOpaqueTypes, InferOk, RegionVariableOrigin,
14+
};
1315
use rustc_lint::builtin::SUPERTRAIT_ITEM_SHADOWING_USAGE;
1416
use rustc_middle::traits::ObligationCauseCode;
1517
use rustc_middle::ty::adjustment::{
@@ -194,7 +196,7 @@ impl<'a, 'tcx> ConfirmContext<'a, 'tcx> {
194196

195197
match pick.autoref_or_ptr_adjustment {
196198
Some(probe::AutorefOrPtrAdjustment::Autoref { mutbl, unsize }) => {
197-
let region = self.next_region_var(infer::Autoref(self.span));
199+
let region = self.next_region_var(RegionVariableOrigin::Autoref(self.span));
198200
// Type we're wrapping in a reference, used later for unsizing
199201
let base_ty = target;
200202

@@ -239,7 +241,7 @@ impl<'a, 'tcx> ConfirmContext<'a, 'tcx> {
239241
}
240242

241243
Some(probe::AutorefOrPtrAdjustment::ReborrowPin(mutbl)) => {
242-
let region = self.next_region_var(infer::Autoref(self.span));
244+
let region = self.next_region_var(RegionVariableOrigin::Autoref(self.span));
243245

244246
target = match target.kind() {
245247
ty::Adt(pin, args) if self.tcx.is_lang_item(pin.did(), hir::LangItem::Pin) => {
@@ -752,6 +754,10 @@ impl<'a, 'tcx> ConfirmContext<'a, 'tcx> {
752754
where
753755
T: TypeFoldable<TyCtxt<'tcx>> + Copy,
754756
{
755-
self.fcx.instantiate_binder_with_fresh_vars(self.span, infer::FnCall, value)
757+
self.fcx.instantiate_binder_with_fresh_vars(
758+
self.span,
759+
BoundRegionConversionTime::FnCall,
760+
value,
761+
)
756762
}
757763
}

compiler/rustc_hir_typeck/src/method/mod.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc_errors::{Applicability, Diag, SubdiagMessage};
1111
use rustc_hir as hir;
1212
use rustc_hir::def::{CtorOf, DefKind, Namespace};
1313
use rustc_hir::def_id::DefId;
14-
use rustc_infer::infer::{self, InferOk};
14+
use rustc_infer::infer::{BoundRegionConversionTime, InferOk};
1515
use rustc_infer::traits::PredicateObligations;
1616
use rustc_middle::query::Providers;
1717
use rustc_middle::traits::ObligationCause;
@@ -400,8 +400,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
400400
// function signature so that normalization does not need to deal
401401
// with bound regions.
402402
let fn_sig = tcx.fn_sig(def_id).instantiate(self.tcx, args);
403-
let fn_sig =
404-
self.instantiate_binder_with_fresh_vars(obligation.cause.span, infer::FnCall, fn_sig);
403+
let fn_sig = self.instantiate_binder_with_fresh_vars(
404+
obligation.cause.span,
405+
BoundRegionConversionTime::FnCall,
406+
fn_sig,
407+
);
405408

406409
let InferOk { value: fn_sig, obligations: o } =
407410
self.at(&obligation.cause, self.param_env).normalize(fn_sig);

compiler/rustc_hir_typeck/src/method/probe.rs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use rustc_hir::HirId;
1212
use rustc_hir::def::DefKind;
1313
use rustc_hir_analysis::autoderef::{self, Autoderef};
1414
use rustc_infer::infer::canonical::{Canonical, OriginalQueryValues, QueryResponse};
15-
use rustc_infer::infer::{self, DefineOpaqueTypes, InferOk, TyCtxtInferExt};
15+
use rustc_infer::infer::{BoundRegionConversionTime, DefineOpaqueTypes, InferOk, TyCtxtInferExt};
1616
use rustc_infer::traits::ObligationCauseCode;
1717
use rustc_middle::middle::stability;
1818
use rustc_middle::query::Providers;
@@ -995,7 +995,11 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
995995
ty::AssocKind::Fn { .. } => self.probe(|_| {
996996
let args = self.fresh_args_for_item(self.span, method.def_id);
997997
let fty = self.tcx.fn_sig(method.def_id).instantiate(self.tcx, args);
998-
let fty = self.instantiate_binder_with_fresh_vars(self.span, infer::FnCall, fty);
998+
let fty = self.instantiate_binder_with_fresh_vars(
999+
self.span,
1000+
BoundRegionConversionTime::FnCall,
1001+
fty,
1002+
);
9991003
self.can_eq(self.param_env, fty.output(), expected)
10001004
}),
10011005
_ => false,
@@ -1757,8 +1761,11 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
17571761
CandidateSource::Trait(candidate.item.container_id(self.tcx))
17581762
}
17591763
TraitCandidate(trait_ref) => self.probe(|_| {
1760-
let trait_ref =
1761-
self.instantiate_binder_with_fresh_vars(self.span, infer::FnCall, trait_ref);
1764+
let trait_ref = self.instantiate_binder_with_fresh_vars(
1765+
self.span,
1766+
BoundRegionConversionTime::FnCall,
1767+
trait_ref,
1768+
);
17621769
let (xform_self_ty, _) =
17631770
self.xform_self_ty(candidate.item, trait_ref.self_ty(), trait_ref.args);
17641771
// Guide the trait selection to show impls that have methods whose type matches
@@ -1874,7 +1881,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
18741881

18751882
let trait_ref = self.instantiate_binder_with_fresh_vars(
18761883
self.span,
1877-
infer::FnCall,
1884+
BoundRegionConversionTime::FnCall,
18781885
poly_trait_ref,
18791886
);
18801887
let trait_ref = ocx.normalize(cause, self.param_env, trait_ref);
@@ -1937,7 +1944,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
19371944
ObjectCandidate(poly_trait_ref) | WhereClauseCandidate(poly_trait_ref) => {
19381945
let trait_ref = self.instantiate_binder_with_fresh_vars(
19391946
self.span,
1940-
infer::FnCall,
1947+
BoundRegionConversionTime::FnCall,
19411948
poly_trait_ref,
19421949
);
19431950
(xform_self_ty, xform_ret_ty) =

0 commit comments

Comments
 (0)