From 61bceb831ce2b11afc4dd33a6479b9de72c1d0f8 Mon Sep 17 00:00:00 2001 From: Compression Team Date: Mon, 21 Oct 2024 15:20:26 +0200 Subject: [PATCH] Remove `absl_nullability_compatible` tag. As of [this change](https://github.com/abseil/abseil-cpp/commit/485f2be7c1d2f1a2ad2d89f6aef308dd7bfede8d), this no longer has any effect; instead, the `ABSL_NULLABILITY_COMPATIBLE` attribute (which is already present on the classes in question) determines whether a class is compatible with nullability annotations. PiperOrigin-RevId: 688111839 --- riegeli/base/BUILD | 3 +++ riegeli/base/any.h | 9 ++++++--- riegeli/base/dependency.h | 3 +-- riegeli/base/intrusive_shared_ptr.h | 3 --- riegeli/base/shared_ptr.h | 3 --- riegeli/base/stable_dependency.h | 3 +-- riegeli/bytes/cfile_handle.h | 9 --------- riegeli/bytes/fd_handle.h | 3 --- riegeli/digests/digester_handle.h | 3 --- 9 files changed, 11 insertions(+), 28 deletions(-) diff --git a/riegeli/base/BUILD b/riegeli/base/BUILD index 29f6ad8e..cd5de3e1 100644 --- a/riegeli/base/BUILD +++ b/riegeli/base/BUILD @@ -246,6 +246,7 @@ cc_library( ":type_id", ":type_traits", "@com_google_absl//absl/base:core_headers", + "@com_google_absl//absl/base:nullability", "@com_google_absl//absl/meta:type_traits", "@com_google_absl//absl/strings", "@com_google_absl//absl/types:optional", @@ -272,6 +273,7 @@ cc_library( ":initializer", ":type_traits", "@com_google_absl//absl/base:core_headers", + "@com_google_absl//absl/base:nullability", "@com_google_absl//absl/meta:type_traits", ], ) @@ -295,6 +297,7 @@ cc_library( ":type_traits", "@com_google_absl//absl/base", "@com_google_absl//absl/base:core_headers", + "@com_google_absl//absl/base:nullability", "@com_google_absl//absl/meta:type_traits", "@com_google_absl//absl/strings", ], diff --git a/riegeli/base/any.h b/riegeli/base/any.h index 37f86180..f1a9778c 100644 --- a/riegeli/base/any.h +++ b/riegeli/base/any.h @@ -26,6 +26,7 @@ #include #include "absl/base/attributes.h" +#include "absl/base/nullability.h" #include "absl/base/optimization.h" #include "absl/meta/type_traits.h" #include "absl/strings/string_view.h" @@ -231,8 +232,6 @@ class }; public: - using absl_nullability_compatible = void; - // `Any::Inlining` enlarges inline storage of // `Any`. // @@ -386,7 +385,11 @@ class DependencyManagerImpl< // an owned dependency by rvalue reference instead of by value, which avoids // moving it. template -class AnyRef : public any_internal::AnyBase { +class +#ifdef ABSL_NULLABILITY_COMPATIBLE + ABSL_NULLABILITY_COMPATIBLE +#endif + AnyRef : public any_internal::AnyBase { public: // Creates an empty `AnyRef`. AnyRef() noexcept { this->Initialize(); } diff --git a/riegeli/base/dependency.h b/riegeli/base/dependency.h index 286f5980..17ee7897 100644 --- a/riegeli/base/dependency.h +++ b/riegeli/base/dependency.h @@ -20,6 +20,7 @@ #include #include "absl/base/attributes.h" +#include "absl/base/nullability.h" #include "absl/meta/type_traits.h" #include "absl/strings/string_view.h" #include "absl/types/span.h" @@ -934,8 +935,6 @@ class dependency_internal::DependencyDeref, Handle, Manager> { public: - using absl_nullability_compatible = void; - using Dependency::DependencyDerived::DependencyDerived; Dependency(const Dependency& that) = default; diff --git a/riegeli/base/intrusive_shared_ptr.h b/riegeli/base/intrusive_shared_ptr.h index c3c6d69e..84c4cd01 100644 --- a/riegeli/base/intrusive_shared_ptr.h +++ b/riegeli/base/intrusive_shared_ptr.h @@ -293,9 +293,6 @@ class return a.get() == nullptr; } - // Allow Nullability annotations on `IntrusiveSharedPtr`. - using absl_nullability_compatible = void; - // Indicate support for: // * `ExternalRef(const IntrusiveSharedPtr&, substr)` // * `ExternalRef(IntrusiveSharedPtr&&, substr)` diff --git a/riegeli/base/shared_ptr.h b/riegeli/base/shared_ptr.h index 014481c2..312fa1d3 100644 --- a/riegeli/base/shared_ptr.h +++ b/riegeli/base/shared_ptr.h @@ -222,9 +222,6 @@ class return a.ptr_ == nullptr; } - // Allow Nullability annotations on `IntrusiveSharedPtr`. - using absl_nullability_compatible = void; - // Indicate support for: // * `ExternalRef(const SharedPtr&, substr)` // * `ExternalRef(SharedPtr&&, substr)` diff --git a/riegeli/base/stable_dependency.h b/riegeli/base/stable_dependency.h index f6d94abb..27d8201c 100644 --- a/riegeli/base/stable_dependency.h +++ b/riegeli/base/stable_dependency.h @@ -21,6 +21,7 @@ #include #include "absl/base/attributes.h" +#include "absl/base/nullability.h" #include "absl/base/optimization.h" #include "absl/meta/type_traits.h" #include "riegeli/base/dependency.h" @@ -176,8 +177,6 @@ class std::enable_if_t::kIsStable>> : public Dependency { public: - using absl_nullability_compatible = void; - using StableDependency::Dependency::Dependency; StableDependency(StableDependency&& that) = default; diff --git a/riegeli/bytes/cfile_handle.h b/riegeli/bytes/cfile_handle.h index 337f8387..34059d90 100644 --- a/riegeli/bytes/cfile_handle.h +++ b/riegeli/bytes/cfile_handle.h @@ -68,9 +68,6 @@ class friend bool operator==(const OwnedCFile& a, FILE* b) { return a.get() == b; } - // Allow Nullability annotations on `OwnedCFile`. - using absl_nullability_compatible = void; - // Opens a new `FILE*`, like with `fopen()` but taking // `absl::string_view filename`, `absl::string_view mode`, and returning // `absl::Status`. @@ -161,9 +158,6 @@ class } friend bool operator==(UnownedCFile a, FILE* b) { return a.get() == b; } - // Allow Nullability annotations on `UnownedCFile`. - using absl_nullability_compatible = void; - private: FILE* file_ = nullptr; }; @@ -251,9 +245,6 @@ class return a.target_ == b.target_; } - // Allow Nullability annotations on `CFileHandle`. - using absl_nullability_compatible = void; - // Returns `true` if the `CFileHandle` owns the `FILE*`, i.e. is responsible // for closing it and the `FILE*` is present. bool IsOwning() const { return methods_->is_owning(target_); } diff --git a/riegeli/bytes/fd_handle.h b/riegeli/bytes/fd_handle.h index 7357477c..a914d565 100644 --- a/riegeli/bytes/fd_handle.h +++ b/riegeli/bytes/fd_handle.h @@ -265,9 +265,6 @@ class return a.target_ == b.target_; } - // Allow Nullability annotations on `FdHandle`. - using absl_nullability_compatible = void; - // Returns `true` if the `FdHandle` owns the fd, i.e. is responsible for // closing it and the fd is present. bool IsOwning() const { return methods_->is_owning(target_); } diff --git a/riegeli/digests/digester_handle.h b/riegeli/digests/digester_handle.h index 0441a82b..3a876ef3 100644 --- a/riegeli/digests/digester_handle.h +++ b/riegeli/digests/digester_handle.h @@ -148,9 +148,6 @@ class return a.target() == b.target(); } - // Allow Nullability annotations on `DigesterBaseHandle`. - using absl_nullability_compatible = void; - // If `write_size_hint` is not `absl::nullopt`, hints that this amount of data // will be written from the current position. This may improve performance and // memory usage.