From 1e540a11752f887672e9ab39092a808a28809a84 Mon Sep 17 00:00:00 2001 From: Astro Date: Tue, 7 May 2019 00:05:38 +0200 Subject: [PATCH] replace #[repr(packed)] with #[repr(C)] avoids warnings regarding unsafe behaviour --- src/regs.rs | 2 +- src/uart/regs.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/regs.rs b/src/regs.rs index 4a0265f..e7ee651 100644 --- a/src/regs.rs +++ b/src/regs.rs @@ -16,7 +16,7 @@ pub trait Register { #[macro_export] macro_rules! register { ($mod_name: ident, $struct_name: ident, $inner: ty) => ( - #[repr(packed)] + #[repr(C)] pub struct $struct_name { inner: RW<$inner>, } diff --git a/src/uart/regs.rs b/src/uart/regs.rs index b9ea604..09b2d36 100644 --- a/src/uart/regs.rs +++ b/src/uart/regs.rs @@ -11,7 +11,7 @@ pub enum ParityMode { ForceTo1 = 0b011, } -#[repr(packed)] +#[repr(C)] pub struct RegisterBlock { control: Control, mode: Mode,