summaryrefslogtreecommitdiff
path: root/absl/status/statusor.cc
diff options
context:
space:
mode:
authorGravatar Dmitri Gribenko <dmitrig@google.com>2023-12-11 09:07:07 -0800
committerGravatar Copybara-Service <copybara-worker@google.com>2023-12-11 09:07:59 -0800
commit55621d1af55be7bf9a2c8e5dcef4368d9a6d4e51 (patch)
tree4c0e74b9a45b8875e35ee543089315a0d9989df1 /absl/status/statusor.cc
parentfad946221cec37175e762c399760f54b9de9a9fa (diff)
Add nullability annotations
PiperOrigin-RevId: 589842893 Change-Id: I9657761d1f71c665582406f278c6605f6d382f6d
Diffstat (limited to 'absl/status/statusor.cc')
-rw-r--r--absl/status/statusor.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/absl/status/statusor.cc b/absl/status/statusor.cc
index bfad75ef..7e6b334c 100644
--- a/absl/status/statusor.cc
+++ b/absl/status/statusor.cc
@@ -19,6 +19,7 @@
#include "absl/base/call_once.h"
#include "absl/base/config.h"
#include "absl/base/internal/raw_logging.h"
+#include "absl/base/nullability.h"
#include "absl/status/internal/statusor_internal.h"
#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
@@ -54,7 +55,7 @@ BadStatusOrAccess& BadStatusOrAccess::operator=(BadStatusOrAccess&& other) {
BadStatusOrAccess::BadStatusOrAccess(BadStatusOrAccess&& other)
: status_(std::move(other.status_)) {}
-const char* BadStatusOrAccess::what() const noexcept {
+absl::Nonnull<const char*> BadStatusOrAccess::what() const noexcept {
InitWhat();
return what_.c_str();
}
@@ -69,7 +70,7 @@ void BadStatusOrAccess::InitWhat() const {
namespace internal_statusor {
-void Helper::HandleInvalidStatusCtorArg(absl::Status* status) {
+void Helper::HandleInvalidStatusCtorArg(absl::Nonnull<absl::Status*> status) {
const char* kMessage =
"An OK status is not a valid constructor argument to StatusOr<T>";
#ifdef NDEBUG