[rust] Remove constexpr from functions that call non-constexpr functions

The CHECK macros will call non-constexpr functions on failure. While
this is legal C++14 as long as the function doesn't actually get called,
GCC 5.4 will choke on it.
This commit is contained in:
Nikita Popov 2022-02-10 10:06:17 +01:00
parent 783da8c589
commit aaee1d2723
2 changed files with 2 additions and 2 deletions

View file

@ -443,7 +443,7 @@ inline uptr RoundUpToPowerOfTwo(uptr size) {
return 1ULL << (up + 1); return 1ULL << (up + 1);
} }
inline constexpr uptr RoundUpTo(uptr size, uptr boundary) { inline uptr RoundUpTo(uptr size, uptr boundary) {
RAW_CHECK(IsPowerOfTwo(boundary)); RAW_CHECK(IsPowerOfTwo(boundary));
return (size + boundary - 1) & ~(boundary - 1); return (size + boundary - 1) & ~(boundary - 1);
} }

View file

@ -61,7 +61,7 @@ class StackStore {
return frame_idx % kBlockSizeFrames; return frame_idx % kBlockSizeFrames;
} }
static constexpr uptr IdToOffset(Id id) { static uptr IdToOffset(Id id) {
CHECK_NE(id, 0); CHECK_NE(id, 0);
return id - 1; // Avoid zero as id. return id - 1; // Avoid zero as id.
} }