rust-embedded / book

Documentation on how to use the Rust Programming Language to develop firmware for bare metal (microcontroller) devices
https://docs.rust-embedded.org/book/
Apache License 2.0
1.09k stars 172 forks source link

Fix use of unaligned references in example #317

Closed adamgreig closed 2 years ago

adamgreig commented 2 years ago

A recent change in Rust to deny unaligned reference by default (https://github.com/rust-lang/rust/pull/95372) caused the upstream rust build of this book to break: https://github.com/rust-lang/rust/pull/96108#issuecomment-1100646376

This PR removes the unaligned references, instead using addr_of!() to get a raw pointer to print.

rust-highfive commented 2 years ago

r? @therealprof

(rust-highfive has picked a reviewer for you, use r? to override)

bors[bot] commented 2 years ago

Build succeeded: