Skip to content

regression: error[E0512]: cannot transmute between types of different sizes, or dependently-sized types (Thread) #134711

Closed as not planned
@cuviper

Description

@cuviper
  1. https://crater-reports.s3.amazonaws.com/beta-1.84.0-4-retry2/beta-2024-12-08/gh/DoumanAsh.nng-c/log.txt
  2. https://crater-reports.s3.amazonaws.com/beta-1.84.0-4-retry2/beta-2024-12-08/reg/thread-waker-1.1.0/log.txt
  3. https://crater-reports.s3.amazonaws.com/beta-1.84.0-4-retry2/beta-2024-12-08/reg/utils-atomics-1.1.2/log.txt

They are all variants of transmuting Thread, including the Lock(Thread) in the 3rd one:

[INFO] [stdout] error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
[INFO] [stdout]   --> src/locks.rs:42:33
[INFO] [stdout]    |
[INFO] [stdout] 42 |                 return unsafe { core::mem::transmute(self) }
[INFO] [stdout]    |                                 ^^^^^^^^^^^^^^^^^^^^
[INFO] [stdout]    |
[INFO] [stdout]    = note: source type: `Lock` (128 bits)
[INFO] [stdout]    = note: target type: `*mut ()` (64 bits)
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
[INFO] [stdout]   --> src/locks.rs:54:29
[INFO] [stdout]    |
[INFO] [stdout] 54 |                 return Self(core::mem::transmute(raw))
[INFO] [stdout]    |                             ^^^^^^^^^^^^^^^^^^^^
[INFO] [stdout]    |
[INFO] [stdout]    = note: source type: `*mut ()` (64 bits)
[INFO] [stdout]    = note: target type: `Thread` (128 bits)

I'm sure the answer is "don't do that!" -- but at least we can have an issue for reference.

Version it worked on

It most recently worked on: 1.83.0

Version with regression

Using rustc 1.84.0-beta.4 in crater #134138.

@rustbot modify labels: +regression-from-stable-to-beta -regression-untriaged

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions