aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/peripheral/mod.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/peripheral/mod.rs b/src/peripheral/mod.rs
index c9c8ad6..c84003f 100644
--- a/src/peripheral/mod.rs
+++ b/src/peripheral/mod.rs
@@ -89,7 +89,6 @@ mod test;
/// Core peripherals
#[allow(non_snake_case)]
-#[non_exhaustive]
pub struct Peripherals {
/// Cache and branch predictor maintenance operations (not present on Cortex-M0 variants)
pub CBP: CBP,
@@ -126,6 +125,10 @@ pub struct Peripherals {
/// Trace Port Interface Unit (not present on Cortex-M0 variants)
pub TPIU: TPIU,
+
+ // Private field making `Peripherals` non-exhaustive. We don't use `#[non_exhaustive]` so we
+ // can support older Rust versions.
+ _priv: (),
}
// NOTE `no_mangle` is used here to prevent linking different minor versions of this crate as that
@@ -188,6 +191,7 @@ impl Peripherals {
TPIU: TPIU {
_marker: PhantomData,
},
+ _priv: (),
}
}
}