Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions c2rust-analyze/tests/analyze.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ macro_rules! define_tests {
define_tests! {
macros,
ptr_addr_of,
rust_intrinsic,
string_literals,
string_casts,
}
Expand Down
9 changes: 9 additions & 0 deletions c2rust-analyze/tests/analyze/rust_intrinsic.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/// Check that `extern "rust-intrinsic"` (which can be generic) foreign `fn`s
/// like [`std::mem::transmute`] don't crash `c2rust-analyze`.
///
/// They currently do (in [`Instance::mono`] where there are generic args),
/// which is why this is `#[cfg]`ed out for now.
#[cfg(any())]
pub unsafe fn f(x: *const u8) -> *const i8 {
std::mem::transmute(x)
}