aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jorge Aparicio <jorge@japaric.io> 2018-05-29 12:23:09 +0200
committerGravatar Jorge Aparicio <jorge@japaric.io> 2018-05-29 12:23:09 +0200
commit7b598c0749aa5390cfefc8e138c05fafa7599dc6 (patch)
tree96ad83412844c6228e8973e6ea532e75a8e58623
parent8e49af1cc0b8b3f4a3c9c4080e63d8d2ee1e6c36 (diff)
downloadrtic-tq.tar.gz
rtic-tq.tar.zst
rtic-tq.zip
bump rtfm-syntaxtq
-rw-r--r--examples/event-task.rs1
-rw-r--r--examples/idle.rs1
-rw-r--r--examples/minimal.rs1
-rw-r--r--examples/periodic-payload.rs1
-rw-r--r--examples/periodic-preemption-payload.rs1
-rw-r--r--examples/periodic-preemption.rs3
-rw-r--r--examples/periodic.rs1
-rw-r--r--examples/schedule-after-from-event-task.rs1
-rw-r--r--examples/schedule-after.rs1
-rw-r--r--examples/schedule-now-from-event-task.rs1
-rw-r--r--examples/schedule-now.rs1
-rw-r--r--examples/user-struct.rs1
-rw-r--r--macros/Cargo.toml6
-rw-r--r--macros/src/analyze.rs46
-rw-r--r--macros/src/trans.rs180
-rw-r--r--tests/cfail/critical-section.rs1
-rw-r--r--tests/cfail/exception.rs1
-rw-r--r--tests/cfail/idle.rs1
-rw-r--r--tests/cfail/init-resource-share-idle.rs1
-rw-r--r--tests/cfail/init-resource-share-task.rs1
-rw-r--r--tests/cfail/init.rs1
-rw-r--r--tests/cfail/interrupt.rs1
-rw-r--r--tests/cfail/late-resource-init.rs1
-rw-r--r--tests/cfail/lock.rs1
-rw-r--r--tests/cfail/priority-too-high.rs1
-rw-r--r--tests/cfail/priority-too-low.rs1
-rw-r--r--tests/cfail/resource-alias.rs1
-rw-r--r--tests/cfail/resource-not-send-sync.rs1
-rw-r--r--tests/cfail/token-outlive.rs1
-rw-r--r--tests/cfail/token-transfer.rs1
-rw-r--r--tests/cfail/wrong-threshold.rs1
31 files changed, 176 insertions, 86 deletions
diff --git a/examples/event-task.rs b/examples/event-task.rs
index 0f51bbfa..6c367626 100644
--- a/examples/event-task.rs
+++ b/examples/event-task.rs
@@ -1,6 +1,7 @@
#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
+#![feature(proc_macro_gen)]
#![no_main]
#![no_std]
diff --git a/examples/idle.rs b/examples/idle.rs
index e4303b91..ae1e284d 100644
--- a/examples/idle.rs
+++ b/examples/idle.rs
@@ -1,6 +1,7 @@
#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
+#![feature(proc_macro_gen)]
#![no_main]
#![no_std]
diff --git a/examples/minimal.rs b/examples/minimal.rs
index da76629d..42ce9c54 100644
--- a/examples/minimal.rs
+++ b/examples/minimal.rs
@@ -1,6 +1,7 @@
#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
+#![feature(proc_macro_gen)]
#![no_main]
#![no_std]
diff --git a/examples/periodic-payload.rs b/examples/periodic-payload.rs
index e99001ea..452cdacb 100644
--- a/examples/periodic-payload.rs
+++ b/examples/periodic-payload.rs
@@ -35,6 +35,7 @@
#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
+#![feature(proc_macro_gen)]
#![no_main]
#![no_std]
diff --git a/examples/periodic-preemption-payload.rs b/examples/periodic-preemption-payload.rs
index 1397ac2f..0cdf204b 100644
--- a/examples/periodic-preemption-payload.rs
+++ b/examples/periodic-preemption-payload.rs
@@ -64,6 +64,7 @@
#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
+#![feature(proc_macro_gen)]
#![no_main]
#![no_std]
diff --git a/examples/periodic-preemption.rs b/examples/periodic-preemption.rs
index 3ca45806..069e61b2 100644
--- a/examples/periodic-preemption.rs
+++ b/examples/periodic-preemption.rs
@@ -65,6 +65,7 @@
#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
+#![feature(proc_macro_gen)]
#![no_main]
#![no_std]
@@ -78,7 +79,7 @@ extern crate stm32f103xx;
use cortex_m::peripheral::{DWT, ITM};
use rt::ExceptionFrame;
-use rtfm::{app, Resource};
+use rtfm::app;
app! {
device: stm32f103xx,
diff --git a/examples/periodic.rs b/examples/periodic.rs
index 875d5b89..61fe1406 100644
--- a/examples/periodic.rs
+++ b/examples/periodic.rs
@@ -33,6 +33,7 @@
#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
+#![feature(proc_macro_gen)]
#![no_main]
#![no_std]
diff --git a/examples/schedule-after-from-event-task.rs b/examples/schedule-after-from-event-task.rs
index de7da763..c7190d3c 100644
--- a/examples/schedule-after-from-event-task.rs
+++ b/examples/schedule-after-from-event-task.rs
@@ -1,5 +1,6 @@
#![deny(warnings)]
#![feature(proc_macro)]
+#![feature(proc_macro_gen)]
#![no_main]
#![no_std]
diff --git a/examples/schedule-after.rs b/examples/schedule-after.rs
index f8a00a19..72d45164 100644
--- a/examples/schedule-after.rs
+++ b/examples/schedule-after.rs
@@ -1,6 +1,7 @@
#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
+#![feature(proc_macro_gen)]
#![no_main]
#![no_std]
diff --git a/examples/schedule-now-from-event-task.rs b/examples/schedule-now-from-event-task.rs
index d900e8fe..ddcf6d58 100644
--- a/examples/schedule-now-from-event-task.rs
+++ b/examples/schedule-now-from-event-task.rs
@@ -1,5 +1,6 @@
#![deny(warnings)]
#![feature(proc_macro)]
+#![feature(proc_macro_gen)]
#![no_main]
#![no_std]
diff --git a/examples/schedule-now.rs b/examples/schedule-now.rs
index c8fca6d5..f1b03832 100644
--- a/examples/schedule-now.rs
+++ b/examples/schedule-now.rs
@@ -9,6 +9,7 @@
#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
+#![feature(proc_macro_gen)]
#![no_main]
#![no_std]
diff --git a/examples/user-struct.rs b/examples/user-struct.rs
index 9a85eaf3..b46d7a5a 100644
--- a/examples/user-struct.rs
+++ b/examples/user-struct.rs
@@ -1,6 +1,7 @@
#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
+#![feature(proc_macro_gen)]
#![no_main]
#![no_std]
diff --git a/macros/Cargo.toml b/macros/Cargo.toml
index 81b788c5..cc893cd2 100644
--- a/macros/Cargo.toml
+++ b/macros/Cargo.toml
@@ -11,11 +11,11 @@ version = "0.3.1"
[dependencies]
failure = "0.1.1"
-proc-macro2 = "0.3.6"
-quote = "0.5.1"
+proc-macro2 = "0.4.4"
+quote = "0.6.3"
# rtfm-syntax = "0.4.0"
rtfm-syntax = { git = "https://github.com/japaric/rtfm-syntax", branch = "tq" }
-syn = "0.13.1"
+syn = "0.14.1"
[dependencies.either]
version = "1"
diff --git a/macros/src/analyze.rs b/macros/src/analyze.rs
index 3bfc72f3..365030ca 100644
--- a/macros/src/analyze.rs
+++ b/macros/src/analyze.rs
@@ -13,14 +13,19 @@ pub fn app(app: &App) -> Context {
let mut tq = TimerQueue::new();
let mut free_interrupts = app.free_interrupts.iter().cloned().collect::<Vec<_>>();
- schedule_now.extend(&app.init.schedule_now);
+ schedule_now.extend(app.init.schedule_now.iter().cloned());
for task in &app.init.schedule_after {
- schedule_after.insert(*task);
+ schedule_after.insert(task.clone());
// Timer queue
- if let Entry::Vacant(entry) = tq.tasks.entry(*task) {
- tq.capacity += app.tasks[task].interrupt_or_instances.right().unwrap();
+ if let Entry::Vacant(entry) = tq.tasks.entry(task.clone()) {
+ tq.capacity += app.tasks[task]
+ .interrupt_or_instances
+ .as_ref()
+ .right()
+ .clone()
+ .unwrap();
entry.insert(app.tasks[task].priority);
}
}
@@ -28,28 +33,33 @@ pub fn app(app: &App) -> Context {
// compute dispatchers
for (name, task) in &app.tasks {
match task.interrupt_or_instances {
- Either::Left(interrupt) => {
- triggers.insert(interrupt, (*name, task.priority));
+ Either::Left(ref interrupt) => {
+ triggers.insert(interrupt.clone(), (name.clone(), task.priority));
}
Either::Right(instances) => {
let dispatcher = dispatchers.entry(task.priority).or_insert_with(|| {
Dispatcher::new(free_interrupts.pop().expect("not enough free interrupts"))
});
- dispatcher.tasks.push(*name);
+ dispatcher.tasks.push(name.clone());
dispatcher.capacity += instances;
}
}
for task in &task.schedule_now {
- schedule_now.insert(*task);
+ schedule_now.insert(task.clone());
}
for task in &task.schedule_after {
- schedule_after.insert(*task);
+ schedule_after.insert(task.clone());
// Timer queue
- if let Entry::Vacant(entry) = tq.tasks.entry(*task) {
- tq.capacity += app.tasks[task].interrupt_or_instances.right().unwrap();
+ if let Entry::Vacant(entry) = tq.tasks.entry(task.clone()) {
+ tq.capacity += app.tasks[task]
+ .interrupt_or_instances
+ .as_ref()
+ .right()
+ .clone()
+ .unwrap();
entry.insert(app.tasks[task].priority);
}
}
@@ -83,7 +93,7 @@ pub fn app(app: &App) -> Context {
})) {
let ceiling = ceilings
.resources
- .entry(*resource)
+ .entry(resource.clone())
.or_insert(Ceiling::Owned(priority));
if priority > (*ceiling).into() {
*ceiling = Ceiling::Shared(priority);
@@ -101,7 +111,10 @@ pub fn app(app: &App) -> Context {
}) {
// schedule_now callers contend for the consumer end of the task slot queue (#task::SQ) and
// ..
- let ceiling = ceilings.slot_queues.entry(*task).or_insert(caller_priority);
+ let ceiling = ceilings
+ .slot_queues
+ .entry(task.clone())
+ .or_insert(caller_priority);
if caller_priority > *ceiling {
*ceiling = caller_priority;
@@ -128,7 +141,10 @@ pub fn app(app: &App) -> Context {
}) {
// schedule_after callers contend for the consumer end of the task slot queue (#task::SQ)
// and ..
- let ceiling = ceilings.slot_queues.entry(*task).or_insert(caller_priority);
+ let ceiling = ceilings
+ .slot_queues
+ .entry(task.clone())
+ .or_insert(caller_priority);
if caller_priority > *ceiling {
*ceiling = caller_priority;
@@ -209,7 +225,7 @@ impl Dispatcher {
}
pub fn interrupt(&self) -> Ident {
- self.interrupt
+ self.interrupt.clone()
}
pub fn tasks(&self) -> &[Ident] {
diff --git a/macros/src/trans.rs b/macros/src/trans.rs
index d21a8a5b..d80eface 100644
--- a/macros/src/trans.rs
+++ b/macros/src/trans.rs
@@ -1,14 +1,14 @@
-use quote::Tokens;
-
use either::Either;
+use proc_macro2::Span;
+use proc_macro2::TokenStream;
use syn::Ident;
use syntax::check::App;
use analyze::Context;
-pub fn app(ctxt: &Context, app: &App) -> Tokens {
+pub fn app(ctxt: &Context, app: &App) -> TokenStream {
let mut root = vec![];
- let k = Ident::from("_rtfm");
+ let k = Ident::new("_rtfm", Span::call_site());
let device = &app.device;
let needs_tq = !ctxt.schedule_after.is_empty();
@@ -34,15 +34,18 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens {
.map(|e| quote!(#e))
.unwrap_or_else(|| quote!(unsafe { ::#k::_impl::uninitialized() }));
- let ceiling = Ident::from(format!(
- "U{}",
- ctxt.ceilings
- .resources()
- .get(name)
- .cloned()
- .map(u8::from)
- .unwrap_or(0) // 0 = resource owned by `init`
- ));
+ let ceiling = Ident::new(
+ &format!(
+ "U{}",
+ ctxt.ceilings
+ .resources()
+ .get(name)
+ .cloned()
+ .map(u8::from)
+ .unwrap_or(0) // 0 = resource owned by `init`
+ ),
+ Span::call_site(),
+ );
root.push(quote! {
#[allow(unsafe_code)]
unsafe impl ::#k::Resource for _resource::#name {
@@ -183,7 +186,8 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens {
for (name, task) in &app.tasks {
let path = &task.path;
- let lifetime = if task.resources
+ let lifetime = if task
+ .resources
.iter()
.any(|res| ctxt.ceilings.resources()[res].is_owned())
{
@@ -192,11 +196,10 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens {
None
};
- let _context = Ident::from(format!(
- "_ZN{}{}7ContextE",
- name.as_ref().as_bytes().len(),
- name
- ));
+ let _context = Ident::new(
+ &format!("_ZN{}{}7ContextE", name.to_string().as_bytes().len(), name),
+ Span::call_site(),
+ );
let mut mod_ = vec![];
@@ -206,7 +209,8 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens {
quote!(scheduled_time)
};
- let input_ = task.input
+ let input_ = task
+ .input
.as_ref()
.map(|input| quote!(#input))
.unwrap_or(quote!(()));
@@ -261,7 +265,8 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens {
});
}
- let res_fields = task.resources
+ let res_fields = task
+ .resources
.iter()
.map(|res| {
if ctxt.ceilings.resources()[res].is_owned() {
@@ -281,7 +286,8 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens {
}
});
- let tasks_fields = task.schedule_now
+ let tasks_fields = task
+ .schedule_now
.iter()
.map(|task| quote!(pub #task: ::_schedule_now::#task))
.chain(
@@ -291,7 +297,8 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens {
)
.collect::<Vec<_>>();
- let tasks_exprs = task.schedule_now
+ let tasks_exprs = task
+ .schedule_now
.iter()
.map(|task| {
if cfg!(feature = "timer-queue") {
@@ -307,7 +314,7 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens {
)
.collect::<Vec<_>>();
- let priority = Ident::from(format!("U{}", task.priority));
+ let priority = Ident::new(&format!("U{}", task.priority), Span::call_site());
mod_.push(quote! {
#[allow(unused_imports)]
use ::#k::Resource;
@@ -363,9 +370,9 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens {
}
match task.interrupt_or_instances {
- Either::Left(interrupt) => {
- let export_name = interrupt.as_ref();
- let fn_name = Ident::from(format!("_{}", interrupt));
+ Either::Left(ref interrupt) => {
+ let export_name = interrupt.to_string();
+ let fn_name = Ident::new(&format!("_{}", interrupt), Span::call_site());
let bl = if cfg!(feature = "timer-queue") {
Some(quote!(_now,))
@@ -387,7 +394,7 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens {
});
}
Either::Right(instances) => {
- let ucapacity = Ident::from(format!("U{}", instances));
+ let ucapacity = Ident::new(&format!("U{}", instances), Span::call_site());
let capacity = instances as usize;
root.push(quote! {
@@ -408,13 +415,19 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens {
});
- let ceiling = Ident::from(format!(
- "U{}",
- ctxt.ceilings.slot_queues().get(name).cloned() // 0 = owned by init
+ let ceiling = Ident::new(
+ &format!(
+ "U{}",
+ ctxt.ceilings.slot_queues().get(name).cloned() // 0 = owned by init
.unwrap_or(0)
- ));
+ ),
+ Span::call_site(),
+ );
- let mangled = Ident::from(format!("_ZN{}{}6PAYLOADSE", name.as_ref().len(), name));
+ let mangled = Ident::new(
+ &format!("_ZN{}{}6PAYLOADSE", name.to_string().len(), name),
+ Span::call_site(),
+ );
// NOTE must be in the root because of `#input`
root.push(quote! {
@@ -459,15 +472,17 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens {
}
/* schedule_now */
- let schedule_now = ctxt.schedule_now
+ let schedule_now = ctxt
+ .schedule_now
.iter()
.map(|name| {
let task = &app.tasks[name];
let priority = task.priority;
- let _priority = Ident::from(format!("_{}", priority));
+ let _priority = Ident::new(&format!("_{}", priority), Span::call_site());
let interrupt = ctxt.dispatchers[&priority].interrupt();
- let input_ = task.input
+ let input_ = task
+ .input
.as_ref()
.map(|input| quote!(#input))
.unwrap_or(quote!(()));
@@ -477,12 +492,18 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens {
(quote!(), quote!(()))
};
- let sqc = Ident::from(format!(
- "U{}",
- ctxt.ceilings.slot_queues().get(name).cloned() // 0 = owned by init
+ let sqc = Ident::new(
+ &format!(
+ "U{}",
+ ctxt.ceilings.slot_queues().get(name).cloned() // 0 = owned by init
.unwrap_or(0)
- ));
- let qc = Ident::from(format!("U{}", ctxt.ceilings.dispatch_queues()[&priority]));
+ ),
+ Span::call_site(),
+ );
+ let qc = Ident::new(
+ &format!("U{}", ctxt.ceilings.dispatch_queues()[&priority]),
+ Span::call_site(),
+ );
if cfg!(feature = "timer-queue") {
root.push(quote! {
@@ -620,18 +641,26 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens {
});
/* schedule_after */
- let schedule_after = ctxt.schedule_after
+ let schedule_after = ctxt
+ .schedule_after
.iter()
.map(|name| {
let task = &app.tasks[name];
- let sqc = Ident::from(format!(
- "U{}",
- ctxt.ceilings.slot_queues().get(name).unwrap_or(&0) // 0 = owned by init
- ));
- let tqc = Ident::from(format!("U{}", ctxt.ceilings.timer_queue()));
-
- let input_ = task.input
+ let sqc = Ident::new(
+ &format!(
+ "U{}",
+ ctxt.ceilings.slot_queues().get(name).unwrap_or(&0) // 0 = owned by init
+ ),
+ Span::call_site(),
+ );
+ let tqc = Ident::new(
+ &format!("U{}", ctxt.ceilings.timer_queue()),
+ Span::call_site(),
+ );
+
+ let input_ = task
+ .input
.as_ref()
.map(|input| quote!(#input))
.unwrap_or(quote!(()));
@@ -649,7 +678,7 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens {
#[inline]
pub fn schedule_after<P>(
&self,
- p: &::#k::Priority<P>,
+ _p: &::#k::Priority<P>,
after: u32,
#payload_in
) -> Result<(), #input_>
@@ -722,13 +751,17 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens {
/* Timer queue */
if needs_tq {
- let capacity = Ident::from(format!("U{}", ctxt.timer_queue.capacity()));
+ let capacity = Ident::new(
+ &format!("U{}", ctxt.timer_queue.capacity()),
+ Span::call_site(),
+ );
let tasks = ctxt.timer_queue.tasks().keys();
- let arms = ctxt.timer_queue
+ let arms = ctxt
+ .timer_queue
.tasks()
.iter()
.map(|(name, priority)| {
- let _priority = Ident::from(format!("_{}", priority));
+ let _priority = Ident::new(&format!("_{}", priority), Span::call_site());
let interrupt = ctxt.dispatchers[priority].interrupt();
quote! {
@@ -743,8 +776,11 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens {
})
.collect::<Vec<_>>();
- let ceiling = Ident::from(format!("U{}", ctxt.ceilings.timer_queue()));
- let priority = Ident::from(format!("U{}", ctxt.sys_tick));
+ let ceiling = Ident::new(
+ &format!("U{}", ctxt.ceilings.timer_queue()),
+ Span::call_site(),
+ );
+ let priority = Ident::new(&format!("U{}", ctxt.sys_tick), Span::call_site());
root.push(quote! {
mod _tq {
#[allow(non_camel_case_types)]
@@ -800,10 +836,13 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens {
/* Dispatchers */
for (priority, dispatcher) in &ctxt.dispatchers {
- let _priority = Ident::from(format!("_{}", priority));
- let capacity = Ident::from(format!("U{}", dispatcher.capacity()));
+ let _priority = Ident::new(&format!("_{}", priority), Span::call_site());
+ let capacity = Ident::new(&format!("U{}", dispatcher.capacity()), Span::call_site());
let tasks = dispatcher.tasks();
- let ceiling = Ident::from(format!("U{}", ctxt.ceilings.dispatch_queues()[priority]));
+ let ceiling = Ident::new(
+ &format!("U{}", ctxt.ceilings.dispatch_queues()[priority]),
+ Span::call_site(),
+ );
root.push(quote! {
mod #_priority {
@@ -873,8 +912,8 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens {
.collect::<Vec<_>>();
let interrupt = dispatcher.interrupt();
- let export_name = interrupt.as_ref();
- let fn_name = Ident::from(format!("_{}", export_name));
+ let export_name = interrupt.to_string();
+ let fn_name = Ident::new(&format!("_{}", export_name), Span::call_site());
root.push(quote! {
#[allow(non_snake_case)]
#[allow(unsafe_code)]
@@ -956,7 +995,8 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens {
};
/* init */
- let res_fields = app.init
+ let res_fields = app
+ .init
.resources
.iter()
.map(|r| {
@@ -968,13 +1008,15 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens {
})
.collect::<Vec<_>>();
- let res_exprs = app.init
+ let res_exprs = app
+ .init
.resources
.iter()
.map(|r| quote!(#r: #r::_new()))
.collect::<Vec<_>>();
- let tasks_fields = app.init
+ let tasks_fields = app
+ .init
.schedule_now
.iter()
.map(|task| quote!(pub #task: ::_schedule_now::#task))
@@ -986,7 +1028,8 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens {
)
.collect::<Vec<_>>();
- let tasks_exprs = app.init
+ let tasks_exprs = app
+ .init
.schedule_now
.iter()
.map(|task| {
@@ -1004,7 +1047,8 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens {
)
.collect::<Vec<_>>();
- let late_resources = app.resources
+ let late_resources = app
+ .resources
.iter()
.filter_map(|(name, res)| {
if res.expr.is_none() && !app.init.resources.contains(name) {
@@ -1158,7 +1202,8 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens {
/* idle */
if let Some(idle) = app.idle.as_ref() {
- let res_fields = idle.resources
+ let res_fields = idle
+ .resources
.iter()
.map(|res| {
if ctxt.ceilings.resources()[res].is_owned() {
@@ -1171,7 +1216,8 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens {
})
.collect::<Vec<_>>();
- let res_exprs = idle.resources
+ let res_exprs = idle
+ .resources
.iter()
.map(|res| {
if ctxt.ceilings.resources()[res].is_owned() {
diff --git a/tests/cfail/critical-section.rs b/tests/cfail/critical-section.rs
index ca521a80..b15bd888 100644
--- a/tests/cfail/critical-section.rs
+++ b/tests/cfail/critical-section.rs
@@ -2,6 +2,7 @@
#![deny(warnings)]
#![feature(const_fn)]
#![feature(proc_macro)]
+#![feature(proc_macro_gen)]
#![no_main]
#![no_std]
diff --git a/tests/cfail/exception.rs b/tests/cfail/exception.rs
index 894c42ae..9cb2debf 100644
--- a/tests/cfail/exception.rs
+++ b/tests/cfail/exception.rs
@@ -1,6 +1,7 @@
#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
+#![feature(proc_macro_gen)]
#![no_main]
#![no_std]
diff --git a/tests/cfail/idle.rs b/tests/cfail/idle.rs
index 6de08b37..ec30fd4c 100644
--- a/tests/cfail/idle.rs
+++ b/tests/cfail/idle.rs
@@ -2,6 +2,7 @@
#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
+#![feature(proc_macro_gen)]
#![no_main]
#![no_std]
diff --git a/tests/cfail/init-resource-share-idle.rs b/tests/cfail/init-resource-share-idle.rs
index f795b0a8..51d160f7 100644
--- a/tests/cfail/init-resource-share-idle.rs
+++ b/tests/cfail/init-resource-share-idle.rs
@@ -1,5 +1,6 @@
#![deny(warnings)]
#![feature(proc_macro)]
+#![feature(proc_macro_gen)]
#![no_main]
#![no_std]
diff --git a/tests/cfail/init-resource-share-task.rs b/tests/cfail/init-resource-share-task.rs
index e016a18f..1643442e 100644
--- a/tests/cfail/init-resource-share-task.rs
+++ b/tests/cfail/init-resource-share-task.rs
@@ -1,6 +1,7 @@
#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
+#![feature(proc_macro_gen)]
#![no_main]
#![no_std]
diff --git a/tests/cfail/init.rs b/tests/cfail/init.rs
index 7a356e12..9176c4db 100644
--- a/tests/cfail/init.rs
+++ b/tests/cfail/init.rs
@@ -1,6 +1,7 @@
#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
+#![feature(proc_macro_gen)]
#![no_main]
#![no_std]
diff --git a/tests/cfail/interrupt.rs b/tests/cfail/interrupt.rs
index faeb96bd..8566b031 100644
--- a/tests/cfail/interrupt.rs
+++ b/tests/cfail/interrupt.rs
@@ -1,6 +1,7 @@
#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
+#![feature(proc_macro_gen)]
#![no_main]
#![no_std]
diff --git a/tests/cfail/late-resource-init.rs b/tests/cfail/late-resource-init.rs
index 30ddd0a6..de48f0b0 100644
--- a/tests/cfail/late-resource-init.rs
+++ b/tests/cfail/late-resource-init.rs
@@ -1,6 +1,7 @@
#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
+#![feature(proc_macro_gen)]
#![no_main]
#![no_std]
diff --git a/tests/cfail/lock.rs b/tests/cfail/lock.rs
index bc3c47b2..82d0bd43 100644
--- a/tests/cfail/lock.rs
+++ b/tests/cfail/lock.rs
@@ -2,6 +2,7 @@
#![deny(warnings)]
#![feature(const_fn)]
#![feature(proc_macro)]
+#![feature(proc_macro_gen)]
#![no_main]
#![no_std]
diff --git a/tests/cfail/priority-too-high.rs b/tests/cfail/priority-too-high.rs
index 7092b488..80a7e39d 100644
--- a/tests/cfail/priority-too-high.rs
+++ b/tests/cfail/priority-too-high.rs
@@ -1,4 +1,5 @@
#![feature(proc_macro)]
+#![feature(proc_macro_gen)]
#![no_main]
#![no_std]
diff --git a/tests/cfail/priority-too-low.rs b/tests/cfail/priority-too-low.rs
index 369b66dc..a72641b1 100644
--- a/tests/cfail/priority-too-low.rs
+++ b/tests/cfail/priority-too-low.rs
@@ -1,6 +1,7 @@
#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
+#![feature(proc_macro_gen)]
#![no_main]
#![no_std]
diff --git a/tests/cfail/resource-alias.rs b/tests/cfail/resource-alias.rs
index 76a04302..1e7b9f98 100644
--- a/tests/cfail/resource-alias.rs
+++ b/tests/cfail/resource-alias.rs
@@ -1,6 +1,7 @@
#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
+#![feature(proc_macro_gen)]
#![no_main]
#![no_std]
diff --git a/tests/cfail/resource-not-send-sync.rs b/tests/cfail/resource-not-send-sync.rs
index 42558355..e0296089 100644
--- a/tests/cfail/resource-not-send-sync.rs
+++ b/tests/cfail/resource-not-send-sync.rs
@@ -1,6 +1,7 @@
#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
+#![feature(proc_macro_gen)]
#![no_main]
#![no_std]
diff --git a/tests/cfail/token-outlive.rs b/tests/cfail/token-outlive.rs
index dde18c2a..7d0656ae 100644
--- a/tests/cfail/token-outlive.rs
+++ b/tests/cfail/token-outlive.rs
@@ -1,6 +1,7 @@
#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
+#![feature(proc_macro_gen)]
#![no_main]
#![no_std]
diff --git a/tests/cfail/token-transfer.rs b/tests/cfail/token-transfer.rs
index adac222f..0574197a 100644
--- a/tests/cfail/token-transfer.rs
+++ b/tests/cfail/token-transfer.rs
@@ -2,6 +2,7 @@
#![deny(warnings)]
#![feature(const_fn)]
#![feature(proc_macro)]
+#![feature(proc_macro_gen)]
#![no_main]
#![no_std]
diff --git a/tests/cfail/wrong-threshold.rs b/tests/cfail/wrong-threshold.rs
index 21127980..ac4c088c 100644
--- a/tests/cfail/wrong-threshold.rs
+++ b/tests/cfail/wrong-threshold.rs
@@ -1,6 +1,7 @@
#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
+#![feature(proc_macro_gen)]
#![no_main]
#![no_std]