mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
rename ReLateBound
to ReBound
other changes: - `Region::new_late_bound` -> `Region::new_bound` - `Region::is_late_bound` -> `Region::is_bound`
This commit is contained in:
parent
67cc4b0cad
commit
c4971f9f65
@ -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 {
|
||||
|
@ -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(®ion) =>
|
||||
{
|
||||
continue;
|
||||
|
@ -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(_)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user