No_std program
A no_std Rust crate is configured not to link the standard library by default, relying instead on core and any explicitly selected libraries.
Embedded Software with Rust
no_std is a Rust crate configuration that excludes the standard library.
- How it is used
- Uses no_std to structure bare-metal firmware without operating-system services.
- How deep it goes
- Explains crate attributes, panic handling, storage choices, and minimal entry-point structure, with startup and memory-layout responsibilities.
- Examples
- Shows a fixed-capacity byte buffer, a minimal bare-metal entry point, and a Rust static library callable from C.
- What you can do after
- Builds and runs minimal no_std programs from scratch in an emulator and on hardware.
Read how Embedded Software with Rust explains no_std program →
Rust in Action: Systems programming concepts and techniques
no_std is a Rust crate attribute that prevents automatic linkage of the Rust standard library.
- How it is used
- Uses no_std to build a kernel without relying on an operating system’s services.
- How deep it goes
- Explains crate configuration, panic handling, and a minimal exception handler, stopping short of rigorous exception handling.
- Examples
- Illustrates a framebuffer write at address 0xb8000 and an infinite-loop alternative to aborting on panic.
- What you can do after
- Build a small no_std kernel that writes to a framebuffer and supplies a panic handler.
Read how Rust in Action: Systems programming concepts and techniques explains no_std program →
Learn Rust in a Month of Lunches
The no_std attribute prevents a Rust program from linking the standard library by default.
- How it is used
- Uses `#![no_std]` to omit the standard library when targeting small devices with limited memory or space.
- How deep it goes
- Defines the attribute and names unavailable standard-library types, without explaining how to replace them.
- Examples
- Uses small devices with limited memory or space as the motivating context.
- What you can do after
- Understand why a Rust program might omit the standard library for a small device.
Read how Learn Rust in a Month of Lunches explains no_std program →
What to know first
- enumAn enum is a type whose values are selected from a finite set of named alternatives.
Related concepts
- core libraryuses · Rust’s core library is a platform-independent foundational library of fundamental types, traits, and APIs that does not depend on an operating-system runtime.
- standard libraryconfigures · A standard library is a collection of reusable modules, types, functions, APIs, and other facilities distributed with a programming language implementation or platform.
- defmtused by · defmt is a binary logging framework for no_std firmware that stores format strings in the binary and defers message reconstruction to a host decoder.
- embedded Rustused by · Embedded Rust is the practice of developing firmware for resource-constrained bare-metal targets using the Rust language and ecosystem.
- emulationuses · Emulation is the reproduction of a computing system’s behavior in software so that software or operations designed for that system can run in another environment.
Questions about no_std program
What is no_std program?
A no_std Rust crate is configured not to link the standard library by default, relying instead on core and any explicitly selected libraries.
Which Manning books explain no_std program?
Embedded Software with Rust, Rust in Action: Systems programming concepts and techniques and Learn Rust in a Month of Lunches.
What should I know before learning no_std program?
Manning books that teach no_std program usually introduce enum first.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


