Skip to content

Commit 9457dfd

Browse files
Abseil Teamcopybara-github
authored andcommitted
Fix nullability annotations in ABSL code.
PiperOrigin-RevId: 667621254 Change-Id: Ibff25d275c1c6846f857d90ed905c70f9545d8dd
1 parent 63322a2 commit 9457dfd

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

absl/log/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ absl_cc_library(
4949
absl::log_internal_nullguard
5050
absl::log_internal_nullstream
5151
absl::log_internal_strip
52+
absl::nullability
5253
absl::strings
5354
)
5455

absl/log/internal/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ cc_library(
6363
":strip",
6464
"//absl/base:config",
6565
"//absl/base:core_headers",
66+
"//absl/base:nullability",
6667
"//absl/strings",
6768
],
6869
)

absl/log/internal/check_op.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
#include "absl/base/attributes.h"
3535
#include "absl/base/config.h"
36+
#include "absl/base/nullability.h"
3637
#include "absl/base/optimization.h"
3738
#include "absl/log/internal/nullguard.h"
3839
#include "absl/log/internal/nullstream.h"
@@ -166,8 +167,9 @@ template <typename T>
166167
class StatusOr;
167168

168169
namespace status_internal {
169-
ABSL_ATTRIBUTE_PURE_FUNCTION std::string* MakeCheckFailString(
170-
const absl::Status* status, const char* prefix);
170+
ABSL_ATTRIBUTE_PURE_FUNCTION absl::Nonnull<std::string*> MakeCheckFailString(
171+
absl::Nonnull<const absl::Status*> status,
172+
absl::Nonnull<const char*> prefix);
171173
} // namespace status_internal
172174

173175
namespace log_internal {

absl/status/status.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ class ABSL_ATTRIBUTE_TRIVIAL_ABI Status final {
649649

650650
// Converts between StatusRep* and the external uintptr_t representation used
651651
// by rep_. See rep_ for details.
652-
static uintptr_t PointerToRep(status_internal::StatusRep* r);
652+
static uintptr_t PointerToRep(absl::Nonnull<status_internal::StatusRep*> r);
653653
static absl::Nonnull<const status_internal::StatusRep*> RepToPointer(
654654
uintptr_t r);
655655

0 commit comments

Comments
 (0)