Skip to content

Commit ad45962

Browse files
committed
apply_closure_requirement use LocalDefId
1 parent 30f168e commit ad45962

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler/rustc_borrowck/src/type_check/constraint_conversion.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use rustc_hir::def_id::DefId;
1+
use rustc_hir::def_id::LocalDefId;
22
use rustc_infer::infer::canonical::QueryRegionConstraints;
33
use rustc_infer::infer::outlives::env::RegionBoundPairs;
44
use rustc_infer::infer::outlives::obligations::{TypeOutlives, TypeOutlivesDelegate};
@@ -88,7 +88,7 @@ impl<'a, 'tcx> ConstraintConversion<'a, 'tcx> {
8888
pub(crate) fn apply_closure_requirements(
8989
&mut self,
9090
closure_requirements: &ClosureRegionRequirements<'tcx>,
91-
closure_def_id: DefId,
91+
closure_def_id: LocalDefId,
9292
closure_args: ty::GenericArgsRef<'tcx>,
9393
) {
9494
// Extract the values of the free regions in `closure_args`
@@ -98,7 +98,7 @@ impl<'a, 'tcx> ConstraintConversion<'a, 'tcx> {
9898
self.tcx,
9999
closure_args,
100100
closure_requirements.num_external_vids,
101-
closure_def_id.expect_local(),
101+
closure_def_id,
102102
);
103103
debug!(?closure_mapping);
104104

compiler/rustc_borrowck/src/type_check/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2582,7 +2582,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
25822582
ConstraintCategory::Boring, // same as above.
25832583
self.constraints,
25842584
)
2585-
.apply_closure_requirements(closure_requirements, def_id.to_def_id(), args);
2585+
.apply_closure_requirements(closure_requirements, def_id, args);
25862586
}
25872587

25882588
// Now equate closure args to regions inherited from `typeck_root_def_id`. Fixes #98589.

0 commit comments

Comments
 (0)