about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-11-13 15:33:01 +0000
committerbors <bors@rust-lang.org>2023-11-13 15:33:01 +0000
commit4bd2fd5c831a3ce74dc0ffd37b93af775d71ae70 (patch)
tree14cef82cfdb27284ae634e35b2823ec40240f24f /src/tools
parent1ab2bcda4303b81b1124b88ddff6f5e9a68d7bc2 (diff)
parent8935a1be016cc0734f081d85d4414a5b534eeac1 (diff)
downloadrust-4bd2fd5c831a3ce74dc0ffd37b93af775d71ae70.tar.gz
rust-4bd2fd5c831a3ce74dc0ffd37b93af775d71ae70.zip
Auto merge of #117876 - lcnr:region-kind-rename, r=BoxyUwU
`ReLateBound` -> `ReBound`

first step of https://github.com/rust-lang/types-team/issues/95

already fairly large xx

there's some future work here I intentionally did not contribute as part of this PR, from my notes:
- `DescriptionCtx` to `DescriptionCtxt`
- what is `CheckRegions::Bound`?
- `collect_late_bound_regions` et al
- `erase_late_bound_regions` -> `instantiate_bound_regions_with_erased`?
- `EraseEarlyRegions` should be removed, feels duplicate

r? `@BoxyUwU`
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/clippy/clippy_lints/src/eta_reduction.rs6
-rw-r--r--src/tools/clippy/clippy_lints/src/pass_by_ref_or_value.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/ptr.rs2
-rw-r--r--src/tools/clippy/clippy_utils/src/ty.rs6
4 files changed, 8 insertions, 8 deletions
diff --git a/src/tools/clippy/clippy_lints/src/eta_reduction.rs b/src/tools/clippy/clippy_lints/src/eta_reduction.rs
index fad8fbf0449..02c53fafd69 100644
--- a/src/tools/clippy/clippy_lints/src/eta_reduction.rs
+++ b/src/tools/clippy/clippy_lints/src/eta_reduction.rs
@@ -247,8 +247,8 @@ fn check_sig<'tcx>(cx: &LateContext<'tcx>, closure: ClosureArgs<'tcx>, call_sig:
 /// This is needed because rustc is unable to late bind early-bound regions in a function signature.
 fn has_late_bound_to_non_late_bound_regions(from_sig: FnSig<'_>, to_sig: FnSig<'_>) -> bool {
     fn check_region(from_region: Region<'_>, to_region: Region<'_>) -> bool {
-        matches!(from_region.kind(), RegionKind::ReLateBound(..))
-            && !matches!(to_region.kind(), RegionKind::ReLateBound(..))
+        matches!(from_region.kind(), RegionKind::ReBound(..))
+            && !matches!(to_region.kind(), RegionKind::ReBound(..))
     }
 
     fn check_subs(from_subs: &[GenericArg<'_>], to_subs: &[GenericArg<'_>]) -> bool {
@@ -290,7 +290,7 @@ fn has_late_bound_to_non_late_bound_regions(from_sig: FnSig<'_>, to_sig: FnSig<'
                         .zip(to_tys)
                         .any(|(from_ty, to_ty)| check_ty(from_ty, to_ty))
             },
-            _ => from_ty.has_late_bound_regions(),
+            _ => from_ty.has_bound_regions(),
         }
     }
 
diff --git a/src/tools/clippy/clippy_lints/src/pass_by_ref_or_value.rs b/src/tools/clippy/clippy_lints/src/pass_by_ref_or_value.rs
index 4d7a055dae1..d6fa742b796 100644
--- a/src/tools/clippy/clippy_lints/src/pass_by_ref_or_value.rs
+++ b/src/tools/clippy/clippy_lints/src/pass_by_ref_or_value.rs
@@ -168,7 +168,7 @@ impl<'tcx> PassByRefOrValue {
             match *ty.skip_binder().kind() {
                 ty::Ref(lt, ty, Mutability::Not) => {
                     match lt.kind() {
-                        RegionKind::ReLateBound(index, region)
+                        RegionKind::ReBound(index, region)
                             if index.as_u32() == 0 && output_regions.contains(&region) =>
                         {
                             continue;
diff --git a/src/tools/clippy/clippy_lints/src/ptr.rs b/src/tools/clippy/clippy_lints/src/ptr.rs
index 83863b92caf..c6ac96a4539 100644
--- a/src/tools/clippy/clippy_lints/src/ptr.rs
+++ b/src/tools/clippy/clippy_lints/src/ptr.rs
@@ -466,7 +466,7 @@ fn check_fn_args<'cx, 'tcx: 'cx>(
                                     .filter_map(|arg| {
                                         arg.as_region().and_then(|lifetime| match lifetime.kind() {
                                             ty::ReEarlyBound(r) => Some(r.def_id),
-                                            ty::ReLateBound(_, r) => r.kind.get_id(),
+                                            ty::ReBound(_, r) => r.kind.get_id(),
                                             ty::ReFree(r) => r.bound_region.get_id(),
                                             ty::ReStatic
                                             | ty::ReVar(_)
diff --git a/src/tools/clippy/clippy_utils/src/ty.rs b/src/tools/clippy/clippy_utils/src/ty.rs
index 7eff93881b2..2ff979f2dcb 100644
--- a/src/tools/clippy/clippy_utils/src/ty.rs
+++ b/src/tools/clippy/clippy_utils/src/ty.rs
@@ -890,7 +890,7 @@ pub fn for_each_top_level_late_bound_region<B>(
     impl<'tcx, B, F: FnMut(BoundRegion) -> ControlFlow<B>> TypeVisitor<TyCtxt<'tcx>> for V<F> {
         type BreakTy = B;
         fn visit_region(&mut self, r: Region<'tcx>) -> ControlFlow<Self::BreakTy> {
-            if let RegionKind::ReLateBound(idx, bound) = r.kind()
+            if let RegionKind::ReBound(idx, bound) = r.kind()
                 && idx.as_u32() == self.index
             {
                 (self.f)(bound)
@@ -1160,7 +1160,7 @@ pub fn make_normalized_projection<'tcx>(
 ) -> Option<Ty<'tcx>> {
     fn helper<'tcx>(tcx: TyCtxt<'tcx>, param_env: ParamEnv<'tcx>, ty: AliasTy<'tcx>) -> Option<Ty<'tcx>> {
         #[cfg(debug_assertions)]
-        if let Some((i, arg)) = ty.args.iter().enumerate().find(|(_, arg)| arg.has_late_bound_regions()) {
+        if let Some((i, arg)) = ty.args.iter().enumerate().find(|(_, arg)| arg.has_bound_regions()) {
             debug_assert!(
                 false,
                 "args contain late-bound region at index `{i}` which can't be normalized.\n\
@@ -1233,7 +1233,7 @@ pub fn make_normalized_projection_with_regions<'tcx>(
 ) -> Option<Ty<'tcx>> {
     fn helper<'tcx>(tcx: TyCtxt<'tcx>, param_env: ParamEnv<'tcx>, ty: AliasTy<'tcx>) -> Option<Ty<'tcx>> {
         #[cfg(debug_assertions)]
-        if let Some((i, arg)) = ty.args.iter().enumerate().find(|(_, arg)| arg.has_late_bound_regions()) {
+        if let Some((i, arg)) = ty.args.iter().enumerate().find(|(_, arg)| arg.has_bound_regions()) {
             debug_assert!(
                 false,
                 "args contain late-bound region at index `{i}` which can't be normalized.\n\