Skip to content

Cannot take address of a temporary #1514

@randomPoison

Description

@randomPoison

Currently when translating json-c and zstd we are producing code that doesn't compile because it's attempting to take the address of a temporary:

json-c: cargo.transpile(tests/json-c/cargo.transpile.gen.sh)...... FAIL
error[E0745]: cannot take address of a temporary
   --> src/json_object.rs:731:24
    |
731 |               &raw const ::core::mem::transmute::<
    |  ________________________^
732 | |                 [u8; 58],
733 | |                 [::core::ffi::c_char; 58],
734 | |             >(*b"struct json_object *json_object_get(struct json_object *)\0")
    | |______________________________________________________________________________^ temporary value

Note that this made it onto master because there is also a bug in CI that's causing CI to not report when tests fail.

cc @Rua

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions