diff options
| author | lcnr <rust@lcnr.de> | 2025-03-06 11:04:35 +0100 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2025-03-06 11:04:35 +0100 |
| commit | ad45962939cd901fbb3c6e47d9ad8310eea52536 (patch) | |
| tree | dd62044545bfd0f1c609729e63066b071e355a6a | |
| parent | 30f168ef811aec63124eac677e14699baa9395bd (diff) | |
| download | rust-ad45962939cd901fbb3c6e47d9ad8310eea52536.tar.gz rust-ad45962939cd901fbb3c6e47d9ad8310eea52536.zip | |
`apply_closure_requirement` use `LocalDefId`
| -rw-r--r-- | compiler/rustc_borrowck/src/type_check/constraint_conversion.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_borrowck/src/type_check/mod.rs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_borrowck/src/type_check/constraint_conversion.rs b/compiler/rustc_borrowck/src/type_check/constraint_conversion.rs index 3b48ca305c4..8dff40ba6ac 100644 --- a/compiler/rustc_borrowck/src/type_check/constraint_conversion.rs +++ b/compiler/rustc_borrowck/src/type_check/constraint_conversion.rs @@ -1,4 +1,4 @@ -use rustc_hir::def_id::DefId; +use rustc_hir::def_id::LocalDefId; use rustc_infer::infer::canonical::QueryRegionConstraints; use rustc_infer::infer::outlives::env::RegionBoundPairs; use rustc_infer::infer::outlives::obligations::{TypeOutlives, TypeOutlivesDelegate}; @@ -88,7 +88,7 @@ impl<'a, 'tcx> ConstraintConversion<'a, 'tcx> { pub(crate) fn apply_closure_requirements( &mut self, closure_requirements: &ClosureRegionRequirements<'tcx>, - closure_def_id: DefId, + closure_def_id: LocalDefId, closure_args: ty::GenericArgsRef<'tcx>, ) { // Extract the values of the free regions in `closure_args` @@ -98,7 +98,7 @@ impl<'a, 'tcx> ConstraintConversion<'a, 'tcx> { self.tcx, closure_args, closure_requirements.num_external_vids, - closure_def_id.expect_local(), + closure_def_id, ); debug!(?closure_mapping); diff --git a/compiler/rustc_borrowck/src/type_check/mod.rs b/compiler/rustc_borrowck/src/type_check/mod.rs index 6d05696e146..8edd3912366 100644 --- a/compiler/rustc_borrowck/src/type_check/mod.rs +++ b/compiler/rustc_borrowck/src/type_check/mod.rs @@ -2582,7 +2582,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { ConstraintCategory::Boring, // same as above. self.constraints, ) - .apply_closure_requirements(closure_requirements, def_id.to_def_id(), args); + .apply_closure_requirements(closure_requirements, def_id, args); } // Now equate closure args to regions inherited from `typeck_root_def_id`. Fixes #98589. |
