`#![no_std]` tells Rust not to bring in the standard library, so standard-library types such as `Vec` and `String` are unavailable. This can suit small devices with limited memory or space, where code may use the stack rather than the heap. section 13.1.5
No_std program
The no_std attribute prevents a Rust program from linking the standard library by default.
How Learn Rust in a Month of Lunches covers it
- 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.
- How it connects
- Connects the standard library and its `Vec` and `String` types with stack and heap use.
Also explained in
-
Rust in Action: Systems programming concepts and techniquesno_std is a Rust crate attribute that prevents automatic linkage of the Rust standard library.
Compare how 2 books explain no_std program →
Related concepts
- 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.
This explainer was generated by Manning's knowledge graph from the text of Learn Rust in a Month of Lunches. The section links point to the parts of the book it draws on.

