Skip to content

Compilation fails with Rust 1.72 #299

Closed
@direc85

Description

@direc85
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
   --> qmetaobject/src/scenegraph.rs:158:32
    |
158 |             raw = cpp!(unsafe [type_id as "quint64", len as "std::size_t"] -> *mut c_void as "QSGNode*" {
    |                                ^^^^^^^
    |
    = note: source type: `TypeId` (128 bits)
    = note: target type: `[u8; 8]` (64 bits)
    = note: this error originates in the macro `__cpp_closure_impl` which comes from the expansion of the macro `cpp` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
   --> qmetaobject/src/scenegraph.rs:163:58
    |
163 |             mask = cpp!(unsafe [raw as "ContainerNode*", type_id as "quint64", len as "std::size_t"] -> u64 as "quint64" {
    |                                                          ^^^^^^^
    |
    = note: source type: `TypeId` (128 bits)
    = note: target type: `[u8; 8]` (64 bits)
    = note: this error originates in the macro `__cpp_closure_impl` which comes from the expansion of the macro `cpp` (in Nightly builds, run with -Z macro-backtrace for more info)
(...)

This is caused by Rust 1.72 change Use 128 bits for TypeId hash

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