commit daba0f5181e51abfe934559115d0dc23104baa95
parent 8d9d8265d3d180e06132ad86541c2a3a1b0ef462
Author: serge-sans-paille <sguelton@mozilla.com>
Date: Fri, 10 Oct 2025 13:56:35 +0000
Bug 1993181 - Cleanup mfbt/NotNull.h r=emilio
- Remove unused includes
- use std::nullptr_t instead of decltype(nullptr)
Differential Revision: https://phabricator.services.mozilla.com/D267925
Diffstat:
4 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp
@@ -49,7 +49,6 @@
#include "mozilla/MappedDeclarationsBuilder.h"
#include "mozilla/Maybe.h"
#include "mozilla/MouseEvents.h"
-#include "mozilla/NotNull.h"
#include "mozilla/PointerLockManager.h"
#include "mozilla/PresShell.h"
#include "mozilla/PresShellForwards.h"
diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp
@@ -99,7 +99,6 @@
#include "mozilla/Maybe.h"
#include "mozilla/MediaFeatureChange.h"
#include "mozilla/MouseEvents.h"
-#include "mozilla/NotNull.h"
#include "mozilla/NullPrincipal.h"
#include "mozilla/OriginAttributes.h"
#include "mozilla/Preferences.h"
diff --git a/dom/base/nsFrameMessageManager.cpp b/dom/base/nsFrameMessageManager.cpp
@@ -37,7 +37,6 @@
#include "mozilla/Assertions.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/ErrorResult.h"
-#include "mozilla/NotNull.h"
#include "mozilla/OwningNonNull.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/RefPtr.h"
diff --git a/mfbt/NotNull.h b/mfbt/NotNull.h
@@ -62,8 +62,7 @@
// NotNull is an alternative that can be used in any of the above cases except
// for the last one, where the handle type is |void|. See below.
-#include <stddef.h>
-
+#include <cstddef>
#include <type_traits>
#include <utility>
@@ -434,15 +433,15 @@ constexpr bool operator!=(const T& aLhs, const NotNull<U>& aRhs) {
// Disallow comparing a NotNull to a nullptr.
template <typename T>
-bool operator==(const NotNull<T>&, decltype(nullptr)) = delete;
+bool operator==(const NotNull<T>&, std::nullptr_t) = delete;
template <typename T>
-bool operator!=(const NotNull<T>&, decltype(nullptr)) = delete;
+bool operator!=(const NotNull<T>&, std::nullptr_t) = delete;
// Disallow comparing a nullptr to a NotNull.
template <typename T>
-bool operator==(decltype(nullptr), const NotNull<T>&) = delete;
+bool operator==(std::nullptr_t, const NotNull<T>&) = delete;
template <typename T>
-bool operator!=(decltype(nullptr), const NotNull<T>&) = delete;
+bool operator!=(std::nullptr_t, const NotNull<T>&) = delete;
} // namespace mozilla