Open mwcampbell opened 3 weeks ago
While we can probably add/update a sample, there's not really much to illustrate here beyond adding #![no_std]
to your lib.rs
or main.rs
and taking it for a spin. The compiler should quickly point out what you might be missing.
Actually, I attempted to port a sample to use no_std
and ran into a few minor issues so I'll use this issue to track those and then make sure we have test coverage and a working sample.
Note to self: sample_direct2d
is a good test case for this.
What I had in mind for a complete no_std sample was things like setting up a panic handler, allocator (if you've actually figured out a way to use no_std with alloc in user space), and any other bits that are required for non-trivial no_std projects on Windows.
If you mean the alloc
crate then you can find various examples by searching this repo. It is used for allocation support under no_std
.
If you mean a custom allocator then you may want to look at https://github.com/microsoft/windows-drivers-rs for examples.
Since the windows crate recently gained support for using no_std while still supporting alloc, it would be useful to have a complete example of an executable or DLL built this way. I read in #3047 that some low-level components, including in Windows itself, use the crate this way. I understand if this is an impractical request because all the real examples are too tightly coupled to Windows's build system or other proprietary bits.