We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
c2rust-analyze/tests
extern "rust-intrinsic" foreign
2 parents 0021ec9 + 3024135 commit 9487535Copy full SHA for 9487535
c2rust-analyze/tests/analyze.rs
@@ -31,6 +31,7 @@ macro_rules! define_tests {
31
define_tests! {
32
macros,
33
ptr_addr_of,
34
+ rust_intrinsic,
35
string_literals,
36
string_casts,
37
}
c2rust-analyze/tests/analyze/rust_intrinsic.rs
@@ -0,0 +1,9 @@
1
+/// Check that `extern "rust-intrinsic"` (which can be generic) foreign `fn`s
2
+/// like [`std::mem::transmute`] don't crash `c2rust-analyze`.
3
+///
4
+/// They currently do (in [`Instance::mono`] where there are generic args),
5
+/// which is why this is `#[cfg]`ed out for now.
6
+#[cfg(any())]
7
+pub unsafe fn f(x: *const u8) -> *const i8 {
8
+ std::mem::transmute(x)
9
+}
0 commit comments