[libc++][modules] Move __noexcept_move_assign_container out of __type_traits (#107140)
That header depends on allocator traits, which is fundamentally tied to
`<memory>`, not to `<type_traits>`. This breaks a cycle betweeen
__type_traits and __memory.
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index 3257927..210beaf 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -536,6 +536,7 @@
__memory/construct_at.h
__memory/destruct_n.h
__memory/inout_ptr.h
+ __memory/noexcept_move_assign_container.h
__memory/out_ptr.h
__memory/pointer_traits.h
__memory/ranges_construct_at.h
@@ -824,7 +825,6 @@
__type_traits/maybe_const.h
__type_traits/nat.h
__type_traits/negation.h
- __type_traits/noexcept_move_assign_container.h
__type_traits/promote.h
__type_traits/rank.h
__type_traits/remove_all_extents.h
diff --git a/libcxx/include/__type_traits/noexcept_move_assign_container.h b/libcxx/include/__memory/noexcept_move_assign_container.h
similarity index 85%
rename from libcxx/include/__type_traits/noexcept_move_assign_container.h
rename to libcxx/include/__memory/noexcept_move_assign_container.h
index baaf36d..b006351 100644
--- a/libcxx/include/__type_traits/noexcept_move_assign_container.h
+++ b/libcxx/include/__memory/noexcept_move_assign_container.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___TYPE_TRAITS_NOEXCEPT_MOVE_ASSIGN_CONTAINER_H
-#define _LIBCPP___TYPE_TRAITS_NOEXCEPT_MOVE_ASSIGN_CONTAINER_H
+#ifndef _LIBCPP___MEMORY_NOEXCEPT_MOVE_ASSIGN_CONTAINER_H
+#define _LIBCPP___MEMORY_NOEXCEPT_MOVE_ASSIGN_CONTAINER_H
#include <__config>
#include <__memory/allocator_traits.h>
@@ -34,4 +34,4 @@
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP___TYPE_TRAITS_NOEXCEPT_MOVE_ASSIGN_CONTAINER_H
+#endif // _LIBCPP___MEMORY_NOEXCEPT_MOVE_ASSIGN_CONTAINER_H
diff --git a/libcxx/include/module.modulemap b/libcxx/include/module.modulemap
index f193b5d..297d155 100644
--- a/libcxx/include/module.modulemap
+++ b/libcxx/include/module.modulemap
@@ -1531,6 +1531,7 @@
module std_private_memory_destruct_n [system] { header "__memory/destruct_n.h" }
module std_private_memory_fwd [system] { header "__fwd/memory.h" }
module std_private_memory_inout_ptr [system] { header "__memory/inout_ptr.h" }
+module std_private_memory_noexcept_move_assign_container [system] { header "__memory/noexcept_move_assign_container.h" }
module std_private_memory_out_ptr [system] { header "__memory/out_ptr.h" }
module std_private_memory_pointer_traits [system] { header "__memory/pointer_traits.h" }
module std_private_memory_ranges_construct_at [system] { header "__memory/ranges_construct_at.h" }
@@ -2023,7 +2024,6 @@
module std_private_type_traits_maybe_const [system] { header "__type_traits/maybe_const.h" }
module std_private_type_traits_nat [system] { header "__type_traits/nat.h" }
module std_private_type_traits_negation [system] { header "__type_traits/negation.h" }
-module std_private_type_traits_noexcept_move_assign_container [system] { header "__type_traits/noexcept_move_assign_container.h" }
module std_private_type_traits_promote [system] { header "__type_traits/promote.h" }
module std_private_type_traits_rank [system] { header "__type_traits/rank.h" }
module std_private_type_traits_remove_all_extents [system] { header "__type_traits/remove_all_extents.h" }
diff --git a/libcxx/include/string b/libcxx/include/string
index 15c7a2f..5cb0693 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -609,6 +609,7 @@
#include <__memory/allocator_traits.h>
#include <__memory/compressed_pair.h>
#include <__memory/construct_at.h>
+#include <__memory/noexcept_move_assign_container.h>
#include <__memory/pointer_traits.h>
#include <__memory/swap_allocator.h>
#include <__memory_resource/polymorphic_allocator.h>
@@ -629,7 +630,6 @@
#include <__type_traits/is_standard_layout.h>
#include <__type_traits/is_trivial.h>
#include <__type_traits/is_trivially_relocatable.h>
-#include <__type_traits/noexcept_move_assign_container.h>
#include <__type_traits/remove_cvref.h>
#include <__type_traits/void_t.h>
#include <__utility/auto_cast.h>
diff --git a/libcxx/include/vector b/libcxx/include/vector
index 0f852e7..2442852c 100644
--- a/libcxx/include/vector
+++ b/libcxx/include/vector
@@ -334,6 +334,7 @@
#include <__memory/addressof.h>
#include <__memory/allocate_at_least.h>
#include <__memory/allocator_traits.h>
+#include <__memory/noexcept_move_assign_container.h>
#include <__memory/pointer_traits.h>
#include <__memory/swap_allocator.h>
#include <__memory/temp_value.h>
@@ -348,7 +349,6 @@
#include <__type_traits/is_allocator.h>
#include <__type_traits/is_constructible.h>
#include <__type_traits/is_nothrow_assignable.h>
-#include <__type_traits/noexcept_move_assign_container.h>
#include <__type_traits/type_identity.h>
#include <__utility/exception_guard.h>
#include <__utility/forward.h>