-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(
c2rust-analyze/tests
) Add a generic `extern "rust-intrinsic" forei…
- Loading branch information
Showing
2 changed files
with
10 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} |