You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 24, 2022. It is now read-only.
#[pre_init] requires that the function it is applied to is unsafe, since the function is run before .bss/.data is initialized. However, unsafe fn means that the function is unsafe to call, while a #[pre_init] function is actually unsafe to implement (it might additionally be unsafe to call from any other place than the pre-init hook). One way to express this would be to require the function body to contain only an unsafe {} block (similar to how #[naked] functions work).
Another issue is that it is neither clear nor documented what happens to promoted statics, which are easy to accidentally create. Presumably, accessing them and creating them is immediate UB.