aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2023-06-28 16:21:05 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 18:49:34 +0100
commit578068682130e6a438ef2c43692a51415fa1e6b1 (patch)
treed3332c03bb1790aa4d826e7eae93a7719908b4cd /gcc
parent6e2ed1e1efb18aa59c1856be20c3b16c753d617c (diff)
downloadgcc-578068682130e6a438ef2c43692a51415fa1e6b1.zip
gcc-578068682130e6a438ef2c43692a51415fa1e6b1.tar.gz
gcc-578068682130e6a438ef2c43692a51415fa1e6b1.tar.bz2
gccrs: expected: Adapt type to GCC's requirements.
Disable exceptions and remove inclusion of poisoned headers. gcc/rust/ChangeLog: * util/expected.h: Adapt class to GCC requirements.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/util/expected.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/gcc/rust/util/expected.h b/gcc/rust/util/expected.h
index cbefafc..a7ddd55 100644
--- a/gcc/rust/util/expected.h
+++ b/gcc/rust/util/expected.h
@@ -1,3 +1,4 @@
+// clang-format off
///
// expected - An implementation of std::expected with extensions
// Written in 2017 by Sy Brand (tartanllama@gmail.com, @TartanLlama)
@@ -20,10 +21,7 @@
#define TL_EXPECTED_VERSION_MINOR 1
#define TL_EXPECTED_VERSION_PATCH 0
-#include <exception>
-#include <functional>
-#include <type_traits>
-#include <utility>
+#include "rust-system.h"
#if defined(__EXCEPTIONS) || defined(_CPPUNWIND)
#define TL_EXPECTED_EXCEPTIONS_ENABLED
@@ -215,9 +213,7 @@ template <typename E>
#else
(void)e;
#ifdef _MSC_VER
- __assume(0);
-#else
- __builtin_unreachable();
+ gcc_unreachable();
#endif
#endif
}