aboutsummaryrefslogtreecommitdiff
path: root/macros/src/check.rs
diff options
context:
space:
mode:
Diffstat (limited to 'macros/src/check.rs')
-rw-r--r--macros/src/check.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/macros/src/check.rs b/macros/src/check.rs
index c22a0f1f..619ec8fb 100644
--- a/macros/src/check.rs
+++ b/macros/src/check.rs
@@ -20,6 +20,28 @@ impl<'a> Extra<'a> {
}
pub fn app<'a>(app: &'a App, analysis: &Analysis) -> parse::Result<Extra<'a>> {
+ if cfg!(feature = "homogeneous") {
+ // this RTFM mode uses the same namespace for all cores so we need to check that the
+ // identifiers used for each core `#[init]` and `#[idle]` functions don't collide
+ let mut seen = HashSet::new();
+
+ for name in app
+ .inits
+ .values()
+ .map(|init| &init.name)
+ .chain(app.idles.values().map(|idle| &idle.name))
+ {
+ if seen.contains(name) {
+ return Err(parse::Error::new(
+ name.span(),
+ "this identifier is already being used by another core",
+ ));
+ } else {
+ seen.insert(name);
+ }
+ }
+ }
+
// check that all exceptions are valid; only exceptions with configurable priorities are
// accepted
for (name, task) in app