diff options
| author | bors <bors@rust-lang.org> | 2023-11-15 12:55:42 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-11-15 12:55:42 +0000 |
| commit | 1500db73145da12e90ca1a040622a9eaa0bdad2e (patch) | |
| tree | 1f4f5853c8dee0a95bcc77d2a4082f6e95479fd7 /src | |
| parent | 383bf020f2d797c139733dc22e1d120da6274e1c (diff) | |
| parent | 18281d39cf425eecfc3b6058875832ef4dba3bac (diff) | |
| download | rust-1500db73145da12e90ca1a040622a9eaa0bdad2e.tar.gz rust-1500db73145da12e90ca1a040622a9eaa0bdad2e.zip | |
Auto merge of #117908 - lcnr:region-kind-rename, r=BoxyUwU
finish `RegionKind` renaming second step of https://github.com/rust-lang/types-team/issues/95 continues the work from #117876. While working on this and I encountered a bunch of further cleanup which I'll either open a tracking issue for or will do in a separate PR: - rewrite the `RegionKind` docs, they still talk about `ReEmpty` and are generally out of date - rename `DescriptionCtx` to `DescriptionCtxt` - what is `CheckRegions::Bound`? - `collect_late_bound_regions` et al - `erase_late_bound_regions` -> `instantiate_bound_regions_with_erased`? - `EraseEarlyRegions` visitor should be removed, feels duplicate r? `@BoxyUwU`
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/clean/auto_trait.rs | 4 | ||||
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 10 | ||||
| -rw-r--r-- | src/tools/clippy/clippy_lints/src/pass_by_ref_or_value.rs | 2 | ||||
| -rw-r--r-- | src/tools/clippy/clippy_lints/src/ptr.rs | 4 |
4 files changed, 10 insertions, 10 deletions
diff --git a/src/librustdoc/clean/auto_trait.rs b/src/librustdoc/clean/auto_trait.rs index eb946e82f39..007c5e113b7 100644 --- a/src/librustdoc/clean/auto_trait.rs +++ b/src/librustdoc/clean/auto_trait.rs @@ -723,7 +723,7 @@ where fn region_name(region: Region<'_>) -> Option<Symbol> { match *region { - ty::ReEarlyBound(r) => Some(r.name), + ty::ReEarlyParam(r) => Some(r.name), _ => None, } } @@ -743,7 +743,7 @@ impl<'a, 'tcx> TypeFolder<TyCtxt<'tcx>> for RegionReplacer<'a, 'tcx> { match *r { // These are the regions that can be seen in the AST. ty::ReVar(vid) => self.vid_to_region.get(&vid).cloned().unwrap_or(r), - ty::ReEarlyBound(_) | ty::ReStatic | ty::ReBound(..) | ty::ReError(_) => r, + ty::ReEarlyParam(_) | ty::ReStatic | ty::ReBound(..) | ty::ReError(_) => r, r => bug!("unexpected region: {r:?}"), } } diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index d33e41dc2b3..429589f01fd 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -287,9 +287,9 @@ pub(crate) fn clean_middle_region<'tcx>(region: ty::Region<'tcx>) -> Option<Life ty::ReStatic => Some(Lifetime::statik()), _ if !region.has_name() => None, ty::ReBound(_, ty::BoundRegion { kind: ty::BrNamed(_, name), .. }) => Some(Lifetime(name)), - ty::ReEarlyBound(ref data) => Some(Lifetime(data.name)), + ty::ReEarlyParam(ref data) => Some(Lifetime(data.name)), ty::ReBound(..) - | ty::ReFree(..) + | ty::ReLateParam(..) | ty::ReVar(..) | ty::ReError(_) | ty::RePlaceholder(..) @@ -1928,13 +1928,13 @@ fn clean_trait_object_lifetime_bound<'tcx>( // latter contrary to `clean_middle_region`. match *region { ty::ReStatic => Some(Lifetime::statik()), - ty::ReEarlyBound(region) if region.name != kw::Empty => Some(Lifetime(region.name)), + ty::ReEarlyParam(region) if region.name != kw::Empty => Some(Lifetime(region.name)), ty::ReBound(_, ty::BoundRegion { kind: ty::BrNamed(_, name), .. }) if name != kw::Empty => { Some(Lifetime(name)) } - ty::ReEarlyBound(_) + ty::ReEarlyParam(_) | ty::ReBound(..) - | ty::ReFree(_) + | ty::ReLateParam(_) | ty::ReVar(_) | ty::RePlaceholder(_) | ty::ReErased 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 d6fa742b796..4db65b0d04f 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 @@ -175,7 +175,7 @@ impl<'tcx> PassByRefOrValue { }, // Early bound regions on functions are either from the containing item, are bounded by another // lifetime, or are used as a bound for a type or lifetime. - RegionKind::ReEarlyBound(..) => continue, + RegionKind::ReEarlyParam(..) => continue, _ => (), } diff --git a/src/tools/clippy/clippy_lints/src/ptr.rs b/src/tools/clippy/clippy_lints/src/ptr.rs index c6ac96a4539..1d4b4d10d50 100644 --- a/src/tools/clippy/clippy_lints/src/ptr.rs +++ b/src/tools/clippy/clippy_lints/src/ptr.rs @@ -465,9 +465,9 @@ fn check_fn_args<'cx, 'tcx: 'cx>( .walk() .filter_map(|arg| { arg.as_region().and_then(|lifetime| match lifetime.kind() { - ty::ReEarlyBound(r) => Some(r.def_id), + ty::ReEarlyParam(r) => Some(r.def_id), ty::ReBound(_, r) => r.kind.get_id(), - ty::ReFree(r) => r.bound_region.get_id(), + ty::ReLateParam(r) => r.bound_region.get_id(), ty::ReStatic | ty::ReVar(_) | ty::RePlaceholder(_) |
