Skip to content

Commit 19ce2bd

Browse files
committed
(c2rust-analyze) Fix cast_fn_item_to_fn_ptr test to correctly create a PointerCast::ReifyFnPointer.
1 parent b20cea7 commit 19ce2bd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

c2rust-analyze/tests/analyze/string_casts.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ pub fn cast_from_literal_explicit() {
3535
}
3636

3737
/// [`PointerCast::ReifyFnPointer`]
38-
/// Can't figure out how to create a [`PointerCast::ReifyFnPointer`].
39-
#[cfg(any())]
40-
pub fn cast_fn_item_to_fn_ptr(f: impl Fn(u8) -> i8) {
38+
pub fn cast_fn_item_to_fn_ptr() {
39+
fn f(x: u8) -> i8 {
40+
x as i8
41+
}
4142
f as fn(u8) -> i8;
4243
}
4344

0 commit comments

Comments
 (0)