Warning
This post was published 68 days ago. The information described in this article may have changed.
Hi rust community,
I'm trying to create a proc-macro that takes a struct and wraps its fields in volatile_register::RW
.
For example, a struct
struct A {
x: u32,
y: u32,
}
becomes
struct A {
x: volatile_register::RW<u32>,
y: volatile_register::RW<u32>,
}
I got the macro to work, however, for the code to work in the user crate, I need to add as a dependency both the proc macro crate and volatile_register
, which feels incorrect. How can I make the macro bring all its necessary dependencies to the user crate.
3 posts - 2 participants
🏷️ rust_feed