Skip to content

Commit 2d99b5a

Browse files
authored
Unrolled build for #142637
Rollup merge of #142637 - compiler-errors:less-globs, r=lcnr Remove some glob imports from the type system Namely, remove the glob imports for `BoundRegionConversionTime`, `RegionVariableOrigin`, `SubregionOrigin`, `TyOrConstInferVar`, `RegionResolutionError`, `SelectionError`, `ProjectionCandidate`, `ProjectionCandidateSet`, and some more specific scoped globs (like `Inserted` in the impl overlap graph construction. These glob imports are IMO very low value, since they're not used nearly as often as other globs (like `TyKind`).
2 parents 513999b + c995070 commit 2d99b5a

File tree

40 files changed

+259
-208
lines changed

40 files changed

+259
-208
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/input_output.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,9 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
6666
Ty::new_tup(self.tcx(), user_provided_sig.inputs()),
6767
args.tupled_upvars_ty(),
6868
args.coroutine_captures_by_ref_ty(),
69-
self.infcx
70-
.next_region_var(RegionVariableOrigin::MiscVariable(self.body.span), || {
71-
RegionCtxt::Unknown
72-
}),
69+
self.infcx.next_region_var(RegionVariableOrigin::Misc(self.body.span), || {
70+
RegionCtxt::Unknown
71+
}),
7372
);
7473

7574
let next_ty_var = || self.infcx.next_ty_var(self.body.span);

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/check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ fn check_opaque_meets_bounds<'tcx>(
312312
// here rather than using ReErased.
313313
let hidden_ty = tcx.type_of(def_id.to_def_id()).instantiate(tcx, args);
314314
let hidden_ty = fold_regions(tcx, hidden_ty, |re, _dbi| match re.kind() {
315-
ty::ReErased => infcx.next_region_var(RegionVariableOrigin::MiscVariable(span)),
315+
ty::ReErased => infcx.next_region_var(RegionVariableOrigin::Misc(span)),
316316
_ => re,
317317
});
318318

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;
@@ -739,7 +739,7 @@ fn ty_known_to_outlive<'tcx>(
739739
infcx.register_type_outlives_constraint_inner(infer::TypeOutlivesConstraint {
740740
sub_region: region,
741741
sup_type: ty,
742-
origin: infer::RelateParamBound(DUMMY_SP, ty, None),
742+
origin: SubregionOrigin::RelateParamBound(DUMMY_SP, ty, None),
743743
});
744744
})
745745
}
@@ -755,7 +755,11 @@ fn region_known_to_outlive<'tcx>(
755755
region_b: ty::Region<'tcx>,
756756
) -> bool {
757757
test_region_obligations(tcx, id, param_env, wf_tys, |infcx| {
758-
infcx.sub_regions(infer::RelateRegionParamBound(DUMMY_SP, None), region_b, region_a);
758+
infcx.sub_regions(
759+
SubregionOrigin::RelateRegionParamBound(DUMMY_SP, None),
760+
region_b,
761+
region_a,
762+
);
759763
})
760764
}
761765

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,
@@ -219,7 +219,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
219219
let closure_sig = args.as_closure().sig();
220220
let closure_sig = self.instantiate_binder_with_fresh_vars(
221221
call_expr.span,
222-
infer::FnCall,
222+
BoundRegionConversionTime::FnCall,
223223
closure_sig,
224224
);
225225
let adjustments = self.adjust_steps(autoderef);
@@ -246,7 +246,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
246246
let closure_args = args.as_coroutine_closure();
247247
let coroutine_closure_sig = self.instantiate_binder_with_fresh_vars(
248248
call_expr.span,
249-
infer::FnCall,
249+
BoundRegionConversionTime::FnCall,
250250
closure_args.coroutine_closure_sig(),
251251
);
252252
let tupled_upvars_ty = self.next_ty_var(callee_expr.span);
@@ -545,7 +545,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
545545
// renormalize the associated types at this point, since they
546546
// previously appeared within a `Binder<>` and hence would not
547547
// have been normalized before.
548-
let fn_sig = self.instantiate_binder_with_fresh_vars(call_expr.span, infer::FnCall, fn_sig);
548+
let fn_sig = self.instantiate_binder_with_fresh_vars(
549+
call_expr.span,
550+
BoundRegionConversionTime::FnCall,
551+
fn_sig,
552+
);
549553
let fn_sig = self.normalize(call_expr.span, fn_sig);
550554

551555
self.check_argument_types(

compiler/rustc_hir_typeck/src/check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub(super) fn check_fn<'a, 'tcx>(
5858
let maybe_va_list = fn_sig.c_variadic.then(|| {
5959
let span = body.params.last().unwrap().span;
6060
let va_list_did = tcx.require_lang_item(LangItem::VaList, span);
61-
let region = fcx.next_region_var(RegionVariableOrigin::MiscVariable(span));
61+
let region = fcx.next_region_var(RegionVariableOrigin::Misc(span));
6262

6363
tcx.type_of(va_list_did).instantiate(tcx, &[region.into()])
6464
});

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
MatchExpressionArmCause, Obligation, PredicateObligation, PredicateObligations, SelectionError,
5050
};
@@ -430,7 +430,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
430430
} else {
431431
if r_borrow_var.is_none() {
432432
// create var lazily, at most once
433-
let coercion = Coercion(span);
433+
let coercion = RegionVariableOrigin::Coercion(span);
434434
let r = self.next_region_var(coercion);
435435
r_borrow_var = Some(r); // [4] above
436436
}
@@ -548,7 +548,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
548548
(&ty::Ref(_, ty_a, mutbl_a), &ty::Ref(_, _, mutbl_b)) => {
549549
coerce_mutbls(mutbl_a, mutbl_b)?;
550550

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

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

compiler/rustc_hir_typeck/src/expr.rs

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

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
@@ -15,7 +15,7 @@ use rustc_hir::{self as hir, HirId, ItemLocalMap};
1515
use rustc_hir_analysis::hir_ty_lowering::{
1616
HirTyLowerer, InherentAssocCandidate, RegionInferReason,
1717
};
18-
use rustc_infer::infer;
18+
use rustc_infer::infer::{self, RegionVariableOrigin};
1919
use rustc_infer::traits::{DynCompatibilityViolation, Obligation};
2020
use rustc_middle::ty::{self, Const, Ty, TyCtxt, TypeVisitableExt};
2121
use rustc_session::Session;
@@ -244,8 +244,10 @@ impl<'tcx> HirTyLowerer<'tcx> for FnCtxt<'_, 'tcx> {
244244

245245
fn re_infer(&self, span: Span, reason: RegionInferReason<'_>) -> ty::Region<'tcx> {
246246
let v = match reason {
247-
RegionInferReason::Param(def) => infer::RegionParameterDefinition(span, def.name),
248-
_ => infer::MiscVariable(span),
247+
RegionInferReason::Param(def) => {
248+
RegionVariableOrigin::RegionParameterDefinition(span, def.name)
249+
}
250+
_ => RegionVariableOrigin::Misc(span),
249251
};
250252
self.next_region_var(v)
251253
}

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);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy