e.g.
struct Foo {
int y;
int x;
};
void f() {
struct Foo* f = malloc(sizeof(struct Foo));
}
compiles to:
pub fn f_0() {
let f: Value<Ptr<Foo>> = Rc::new(RefCell::new(libcc2rs::malloc_refcount(8usize)));
}
which gives:
error[E0308]: mismatched types
--> src/main.rs:38:51
|
38 | let f: Value<Ptr<Foo>> = Rc::new(RefCell::new(libcc2rs::malloc_refcount(8usize)));
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Ptr<Foo>`, found `AnyPtr`
| |
| arguments to this function are incorrect
|
= note: expected struct `libcc2rs::Ptr<Foo>`
found struct `AnyPtr`
It should instead compile to:
pub fn f_0() {
let f: Value<Ptr<Foo>> = Rc::new(RefCell::new(
libcc2rs::malloc_refcount(8usize).reinterpret_cast::<Foo>(),
));
}
e.g.
compiles to:
which gives:
It should instead compile to: