Skip to content

Commit 74e2b50

Browse files
Feat: allow downcasting (useful for certain cases where uint32_t needs
to be cast to float16_t because the bits are stored in the lower half of the type)
1 parent 53b18b0 commit 74e2b50

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/intrinsic-test/src/x86/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ pub const PLATFORM_C_FORWARD_DECLARATIONS: &str = r#"
329329
std::memcpy(&ret, &x, sizeof(T1));
330330
return ret;
331331
} else {
332-
static_assert(sizeof(T1) == sizeof(T2) || std::is_convertible_v<T2, T1>,
332+
static_assert(sizeof(T1) <= sizeof(T2) || std::is_convertible_v<T2, T1>,
333333
"T2 must either be convertible to T1, or have the same size as T1!");
334334
return T1{};
335335
}

0 commit comments

Comments
 (0)