Skip to content

call to unsafe function std::intrinsics::transmute is unsafe and requires unsafe block #3243

Open
@JMS55

Description

@JMS55

When compiling https://github.com/JMS55/dlss_wgpu/tree/deabf142d371b0f7700afc2741b9b43eb670b286.

warning[E0133]: call to unsafe function `std::intrinsics::transmute` is unsafe and requires unsafe block
  --> D:\dlss_wgpu\target\debug\build\dlss_wgpu-6adfd00d523bab83\out/bindings.rs:12:9
   |
12 |         ::std::mem::transmute(self)
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html>
   = note: consult the function's documentation for information on how to avoid undefined behavior
note: an unsafe function restricts its caller, but its body is safe by default
  --> D:\dlss_wgpu\target\debug\build\dlss_wgpu-6adfd00d523bab83\out/bindings.rs:11:5
   |
11 |     pub unsafe fn as_ref(&self) -> &T {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = note: `#[warn(unsafe_op_in_unsafe_fn)]` on by default

warning[E0133]: call to unsafe function `std::intrinsics::transmute` is unsafe and requires unsafe block
  --> D:\dlss_wgpu\target\debug\build\dlss_wgpu-6adfd00d523bab83\out/bindings.rs:16:9
   |
16 |         ::std::mem::transmute(self)
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html>
   = note: consult the function's documentation for information on how to avoid undefined behavior
note: an unsafe function restricts its caller, but its body is safe by default
  --> D:\dlss_wgpu\target\debug\build\dlss_wgpu-6adfd00d523bab83\out/bindings.rs:15:5
   |
15 |     pub unsafe fn as_mut(&mut self) -> &mut T {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0133`.

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