diff options
author | 2021-07-22 00:47:00 -0700 | |
---|---|---|
committer | 2021-07-22 01:00:57 -0700 | |
commit | 5f395658f03ccd092d9e17edc949804012869157 (patch) | |
tree | 8e366827901e5b29400c586c21f0559309ff982c /macros/src/codegen/pre_init.rs | |
parent | 2f3b5cba805d7e7b736869249f46298e59bc944d (diff) | |
download | rtic-5f395658f03ccd092d9e17edc949804012869157.tar.gz rtic-5f395658f03ccd092d9e17edc949804012869157.tar.zst rtic-5f395658f03ccd092d9e17edc949804012869157.zip |
Propogate the task attributes to the spawn handles
This allows tasks to be gated by `cfg` attributes when also using
monotonics. For example:
```rust
#[cfg(feature = "logging")]
#[task(shared = [logger])]
fn logger_init(mut cx: logger_init::Context) {
/* ... */
}
```
Without this change, the reschedule_at() implementation is
unconditionally included even though it references the SpawnHandle from
its task module, which is _conditionally_ included. This resulted in
compiler errors like the following:
```
error[E0433]: failed to resolve: use of undeclared crate or module `logger_init`
--> src/main.rs:243:8
|
243 | fn logger_init(mut cx: logger_init::Context) {
| ^^^^^^^^^^^ use of undeclared crate or module `logger_init`
```
Diffstat (limited to 'macros/src/codegen/pre_init.rs')
0 files changed, 0 insertions, 0 deletions