Open ryan-summers opened 4 days ago
https://github.com/rust-embedded/cortex-m-rt/issues/300 is the discussion where we removed this pattern from cortex-m-rt
https://github.com/rust-lang/unsafe-code-guidelines/issues/259
I hadn't seen this update, it may be that statics are now more magical than I was arguing.
Currently, pointer provenance appears to make it entirely impossible to correctly initialize a memory section within rust code because linkers communicate with the application by setting the address of variables. These passed-back variables then have a provenance that does not cover the entire memory region that needs to be defined. For example:
Right now, it doesn't appear possible to soundly perform section initialization using data provided by the linker due to these provenance issues. I'm opening this issue to track the topic, as we were discussing this extensively in the Matrix channel earlier.