Create a list of compiler/cargo features desired to be stabilized/implemented for embedded use cases #838
Replies: 17 comments 1 reply
-
We haven't made any progress. Should probably discuss in an REWG meeting soon. |
Beta Was this translation helpful? Give feedback.
-
Throwing "stabilize build-std capabilities" onto the list! |
Beta Was this translation helpful? Give feedback.
-
Right now it's hard to make Cargo understand a crate that needs to be compiled differently for different platforms. Each platform may require its own target and also have platform-specific cfg in the code. There is currently no great way that I am aware of to provide a platform feature that (a) must be set to proceed and (b) selects both the target details and a set of features. I only know of hacky workarounds. I don't know exactly what I want, but I'm putting this in as a placeholder in case someone is inspired. ###Examples
|
Beta Was this translation helpful? Give feedback.
-
I know it's already a work in progress, but it's important for embedded use cases to make all the math functions for both integer and floating point Right now I'm doing this in my |
Beta Was this translation helpful? Give feedback.
-
I would love to have a mechanism to let proc macro crates know the target arch of the main compilation. This is especially useful in embedded development. For example, in Currently, we use custom environment variables to do the trick. However, it would be way easier to have an environment variable with the "main" target architecture so we can do more complex checks. without needing to customize |
Beta Was this translation helpful? Give feedback.
-
i think quite a few things have already been mentioned here: #835 (comment) |
Beta Was this translation helpful? Give feedback.
-
I would love to be able to get stack size from a stable toolchain. I was looking into a microcontroller application which ran low on (stack) memory and therefor tried to get this information. cargo-callstack failed to build the application with a current nightly toolchain and the recipe from emit-stack-sizes from the Rust Unstable Book gave me no stack size information in the generated binary. |
Beta Was this translation helpful? Give feedback.
-
Common Datapath ExtensionLink: https://developer.arm.com/documentation/ka001501/latest/ Currently the CDE compiler flag generates a warning as follows: No RFC or compiler issue open about it. |
Beta Was this translation helpful? Give feedback.
-
Stack protectorCurrent Limitation: see github issue Github Issue: rust-lang/rust#114903 |
Beta Was this translation helpful? Give feedback.
-
ARM TrustZone for Cortex-MLink: https://developer.arm.com/documentation/100690/latest/ Stabilization of the support for TrustZone. Github Issue: rust-lang/rust#81391 and rust-lang/rust#75835 ** Other Information: Rust tools: https://github.com/tweedegolf/trustzone-m-tools Blog Post: https://tweedegolf.nl/en/blog/85/trustzone-trials-tribulations |
Beta Was this translation helpful? Give feedback.
-
Simplify generics with type alias impl traitManaging complex type signatures in embedded systems can be cumbersome. type_alias_impl_trait allows users to abstract these generics behind impl Trait, improving code readability and usability. Use-case: GitHub issue: |
Beta Was this translation helpful? Give feedback.
-
Support ptr_metadata for efficient dyn Trait handlingThe ptr_metadata feature enables splitting wide pointers into thin pointers and metadata. This improves the usability of dyn Trait in memory-constrained, heapless environments. Use-case: GitHub issue: |
Beta Was this translation helpful? Give feedback.
-
Improve pin ergonomics for embedded driverspin_ergonomics simplifies using Pin, making it safer and easier to handle self-referential data structures without requiring unsafe code. Use-case: GitHub issue: |
Beta Was this translation helpful? Give feedback.
-
Add unsafe_pinned for better aliasing controlThe unsafe_pinned feature provides explicit semantics for aliasing in heapless data structures, ensuring safety and clarity in resource-constrained environments. Use-case: GitHub issue: |
Beta Was this translation helpful? Give feedback.
-
Enable atomic volatile for safer memory accessThe "volatile 2.0" feature clarifies concurrency interactions for volatile operations, improving safety with DMA and shared memory in embedded systems. Use-case: GitHub issue: |
Beta Was this translation helpful? Give feedback.
-
See https://doc.rust-lang.org/nightly/rustc/platform-support/thumbv8m.main-none-eabi.html, which I was told off for adding because we aren't supposed to document unstable things in the Platform docs. No idea where it should be documented. |
Beta Was this translation helpful? Give feedback.
-
I lost 30 minutes of my life today to: env:
RUSTFLAGS: "-Dwarnings" in github CI, causing cargo to completely ignore this in my [target.thumbv7em-none-eabihf]
rustflags = [
"-Clink-arg=-Tlink.x",
"-Clink-arg=-Tdefmt.x",
] Those
Doing I wish cargo was better at merging rustflags rather than entirely replacing them. (Copy of #835 (reply in thread)) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
As discussed in the Unconf Rustweek2025 a list of features for the compiler that are necessary for embedded use cases (e.g. security extensions) and cargo features (e.g. support of multiple runners, workspaces with multiple targets)
Beta Was this translation helpful? Give feedback.
All reactions