Skip to content

Commit

Permalink
Remove absl_nullability_compatible tag.
Browse files Browse the repository at this point in the history
As of [this
change](abseil/abseil-cpp@485f2be),
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
  • Loading branch information
Compression Team authored and QrczakMK committed Oct 21, 2024
1 parent 5b2ac60 commit 61bceb8
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 28 deletions.
3 changes: 3 additions & 0 deletions riegeli/base/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
],
)
Expand All @@ -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",
],
Expand Down
9 changes: 6 additions & 3 deletions riegeli/base/any.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <utility>

#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"
Expand Down Expand Up @@ -231,8 +232,6 @@ class
};

public:
using absl_nullability_compatible = void;

// `Any<Handle>::Inlining<InlineManagers...>` enlarges inline storage of
// `Any<Handle>`.
//
Expand Down Expand Up @@ -386,7 +385,11 @@ class DependencyManagerImpl<
// an owned dependency by rvalue reference instead of by value, which avoids
// moving it.
template <typename Handle>
class AnyRef : public any_internal::AnyBase<Handle, 0, 0> {
class
#ifdef ABSL_NULLABILITY_COMPATIBLE
ABSL_NULLABILITY_COMPATIBLE
#endif
AnyRef : public any_internal::AnyBase<Handle, 0, 0> {
public:
// Creates an empty `AnyRef`.
AnyRef() noexcept { this->Initialize(); }
Expand Down
3 changes: 1 addition & 2 deletions riegeli/base/dependency.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <utility>

#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"
Expand Down Expand Up @@ -934,8 +935,6 @@ class
dependency_internal::DependencyDeref<Handle, Manager>,
Handle, Manager> {
public:
using absl_nullability_compatible = void;

using Dependency::DependencyDerived::DependencyDerived;

Dependency(const Dependency& that) = default;
Expand Down
3 changes: 0 additions & 3 deletions riegeli/base/intrusive_shared_ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)`
Expand Down
3 changes: 0 additions & 3 deletions riegeli/base/shared_ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)`
Expand Down
3 changes: 1 addition & 2 deletions riegeli/base/stable_dependency.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <utility>

#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"
Expand Down Expand Up @@ -176,8 +177,6 @@ class
std::enable_if_t<Dependency<Handle, Manager>::kIsStable>>
: public Dependency<Handle, Manager> {
public:
using absl_nullability_compatible = void;

using StableDependency::Dependency::Dependency;

StableDependency(StableDependency&& that) = default;
Expand Down
9 changes: 0 additions & 9 deletions riegeli/bytes/cfile_handle.h
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down Expand Up @@ -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;
};
Expand Down Expand Up @@ -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_); }
Expand Down
3 changes: 0 additions & 3 deletions riegeli/bytes/fd_handle.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_); }
Expand Down
3 changes: 0 additions & 3 deletions riegeli/digests/digester_handle.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 61bceb8

Please sign in to comment.