Skip to content

Commit e02903c

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

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

c2rust-analyze/tests/analyze/string_casts.rs

Lines changed: 3 additions & 2 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())]
4038
pub fn cast_fn_item_to_fn_ptr(f: impl Fn(u8) -> i8) {
39+
fn f(x: u8) -> i8 {
40+
x as i8
41+
}
4142
f as fn(u8) -> i8;
4243
}
4344

0 commit comments

Comments
 (0)