Skip to content

Build failure on new toolchain #58

Open
@ivq

Description

@ivq

At least current stable toolchain(1.74.0) is complaining:

error: assigning to `&T` is undefined behavior, consider using an `UnsafeCell`
   --> /home/user/gd32vf103xx-hal/src/serial.rs:422:17
    |
422 |                 ptr::write_volatile(&(*USART::ptr()).data as *const _ as *mut _, byte)
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: for more information, visit <https://doc.rust-lang.org/book/ch15-05-interior-mutability.html>
    = note: `#[deny(invalid_reference_casting)]` on by default

This kind of compile errors seem start to exist in 1.73.0: rust-lang/rust#116410

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