Skip to content

Upcoming compilation error (in rust nightly) #8

@huitseeker

Description

@huitseeker

See: rust-lang/rust#111567

Benches also present this issue, but see tests (observed with rustc 1.72.0-nightly (2d0aa5768 2023-06-18)):

error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
  --> src/tests.rs:81:29
   |
81 | / ...                   *(&ret[work] as *const pallas::Scalar
82 | | ...                       as *mut pallas::Scalar) =
   | |_________________________________________________^
   |
   = note: `#[deny(cast_ref_to_mut)]` on by default

error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
   --> src/tests.rs:119:25
    |
119 | /                         *(&rets[tid.fetch_add(1, Ordering::Relaxed)]
120 | |                             as *const pallas::Point
121 | |                             as *mut pallas::Point) = ret
    | |__________________________________________________^

error: could not compile `pasta-msm` (lib test) due to 2 previous errors

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