Skip to content

Commit

Permalink
(c2rust-analyze/tests) Add a disabled `cast_array_to_slice_ptr_expl…
Browse files Browse the repository at this point in the history
…icit` test b/c it still doesn't work even explicitly.
  • Loading branch information
kkysen committed May 2, 2023
1 parent e41cec1 commit 2915b8d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions c2rust-analyze/tests/analyze/string_casts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ pub fn cast_array_to_slice_ptr(s: &[u8; 0]) {
s as *const [u8];
}

/// Unlike the other `*_explicit` tests, this one
/// still doesn't work even with an explicit `std::ptr::addr_of!`.
#[cfg(any())]
pub fn cast_array_to_slice_ptr_explicit(s: &[u8; 0]) {
std::ptr::addr_of!(*s) as *const [u8];
}

#[cfg(any())]
pub fn cast_array_to_ptr(s: &[u8; 0]) {
s as *const u8;
Expand Down

0 comments on commit 2915b8d

Please sign in to comment.