mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 13:13:34 +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
4 changed files with 5 additions and 5 deletions
|
@ -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.
|
/// 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 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 {
|
fn check_region(from_region: Region<'_>, to_region: Region<'_>) -> bool {
|
||||||
matches!(from_region.kind(), RegionKind::ReLateBound(..))
|
matches!(from_region.kind(), RegionKind::ReBound(..))
|
||||||
&& !matches!(to_region.kind(), RegionKind::ReLateBound(..))
|
&& !matches!(to_region.kind(), RegionKind::ReBound(..))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn check_subs(from_subs: &[GenericArg<'_>], to_subs: &[GenericArg<'_>]) -> bool {
|
fn check_subs(from_subs: &[GenericArg<'_>], to_subs: &[GenericArg<'_>]) -> bool {
|
||||||
|
|
|
@ -168,7 +168,7 @@ impl<'tcx> PassByRefOrValue {
|
||||||
match *ty.skip_binder().kind() {
|
match *ty.skip_binder().kind() {
|
||||||
ty::Ref(lt, ty, Mutability::Not) => {
|
ty::Ref(lt, ty, Mutability::Not) => {
|
||||||
match lt.kind() {
|
match lt.kind() {
|
||||||
RegionKind::ReLateBound(index, region)
|
RegionKind::ReBound(index, region)
|
||||||
if index.as_u32() == 0 && output_regions.contains(®ion) =>
|
if index.as_u32() == 0 && output_regions.contains(®ion) =>
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -466,7 +466,7 @@ fn check_fn_args<'cx, 'tcx: 'cx>(
|
||||||
.filter_map(|arg| {
|
.filter_map(|arg| {
|
||||||
arg.as_region().and_then(|lifetime| match lifetime.kind() {
|
arg.as_region().and_then(|lifetime| match lifetime.kind() {
|
||||||
ty::ReEarlyBound(r) => Some(r.def_id),
|
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::ReFree(r) => r.bound_region.get_id(),
|
||||||
ty::ReStatic
|
ty::ReStatic
|
||||||
| ty::ReVar(_)
|
| 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> {
|
impl<'tcx, B, F: FnMut(BoundRegion) -> ControlFlow<B>> TypeVisitor<TyCtxt<'tcx>> for V<F> {
|
||||||
type BreakTy = B;
|
type BreakTy = B;
|
||||||
fn visit_region(&mut self, r: Region<'tcx>) -> ControlFlow<Self::BreakTy> {
|
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
|
&& idx.as_u32() == self.index
|
||||||
{
|
{
|
||||||
(self.f)(bound)
|
(self.f)(bound)
|
||||||
|
|
Loading…
Reference in a new issue