aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Jonas Schievink <jonasschievink@gmail.com> 2020-01-16 23:22:44 +0100
committerGravatar Jonas Schievink <jonasschievink@gmail.com> 2020-01-16 23:22:44 +0100
commitd44a5fa86a75a97acef5321d2e061a914cf8d871 (patch)
tree0103dd21b95fa3bd4ec7f6a73d1b60066060b70d /src
parent6e63b1e9b94bc08b8cd84383c51b93f6170eb594 (diff)
downloadcortex-m-d44a5fa86a75a97acef5321d2e061a914cf8d871.tar.gz
cortex-m-d44a5fa86a75a97acef5321d2e061a914cf8d871.tar.zst
cortex-m-d44a5fa86a75a97acef5321d2e061a914cf8d871.zip
Use a private field instead of `#[non_exhaustive]`
Diffstat (limited to 'src')
-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: (),
}
}
}