Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
Inline assembly Support for inline assembly is provided via the asm!, naked_asm!, and global_asm! macros. It can be used to embed handwritten assembly in the assembly output generated by the compiler. Support for inline assembly is stable o...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~56 min read
Linkage [!NOTE] This section is described more in terms of the compiler than of the language. The compiler supports various methods to link crates together both statically and dynamically. This section will explore the various methods to li...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~10 min read
Panic Rust provides a mechanism to prevent a function from returning normally, and instead "panic," which is a response to an error condition that is typically not expected to be recoverable within the context in which the error is encounte...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~4 min read
Variables A variable is a component of a stack frame, either a named function parameter, an anonymous temporary, or a named local variable. A local variable (or stack-local allocation) holds a value directly, allocated within the stack's me...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~1 min read
Memory allocation and lifetime The items of a program are those functions, modules, and types that have their value calculated at compile-time and stored uniquely in the memory image of the rust process. Items are neither dynamically alloca...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~1 min read
Memory model [!WARNING] The memory model of Rust is incomplete and not fully decided. Bytes The most basic unit of memory in Rust is a byte. [!NOTE] While bytes are typically lowered to hardware bytes, Rust uses an "abstract" notion of byte...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~1 min read
Visibility and privacy Visibility -> `pub` | `pub` `(` `crate` `)` | `pub` `(` `self` `)` | `pub` `(` `super` `)` | `pub` `(` `in` SimplePath `)` These two terms are often used interchangeably, and what they are attempting to convey is the...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~7 min read
Name resolution Name resolution is the process of tying paths and other identifiers to the declarations of those entities. Names are segregated into different namespaces, allowing entities in different namespaces to share the same name with...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~11 min read
Paths A path is a sequence of one or more path segments separated by :: tokens. Paths are used to refer to items, values, types, macros, and attributes. Two examples of simple paths consisting of only identifier segments: x; x::y::z; Types...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~9 min read
Preludes A prelude is a collection of names that are automatically brought into scope of every module in a crate. These prelude names are not part of the module itself: they are implicitly queried during name resolution. For example, even t...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~5 min read
Scopes A scope is the region of source text where a named entity may be referenced with that name. The following sections provide details on the scoping rules and behavior, which depend on the kind of entity and where it is declared. The pr...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~8 min read
Namespaces A namespace is a logical grouping of declared names. Names are segregated into separate namespaces based on the kind of entity the name refers to. Namespaces allow the occurrence of a name in one namespace to not conflict with th...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~3 min read
Names An entity is a language construct that can be referred to in some way within the source program, usually via a path. Entities include types, items, generic parameters, variable bindings, loop labels, lifetimes, fields, attributes, and...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~2 min read
Special types and traits Certain types and traits that exist in the standard library are known to the Rust compiler. This chapter documents the special features of these types and traits. Box<T> [Box<T>] has a few special features that Rust...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~4 min read
Lifetime elision Rust has rules that allow lifetimes to be elided in various places where the compiler can infer a sensible default choice. Lifetime elision in functions In order to make common patterns more ergonomic, lifetime arguments ca...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~5 min read
Destructors When an initialized variable or temporary goes out of scope, its destructor is run or it is dropped. Assignment also runs the destructor of its left-hand operand, if it's initialized. If a variable has been partially initialized...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~16 min read
Divergence A diverging expression is an expression that never completes normal execution. fn diverges() -> ! { panic!("This function never returns!"); } fn example() { let x: i32 = diverges(); // This line never completes. println!("This is...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~1 min read
Type coercions Type coercions are implicit operations that change the type of a value. They happen automatically at specific locations and are highly restricted in what types actually coerce. Any conversions allowed by coercion can also be...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~7 min read
Trait and lifetime bounds Bounds -> Bound ( `+` Bound )* `+`? Bound -> Lifetime | TraitBound | UseBound TraitBound -> ( `?` | ForLifetimes )? TypePath | `(` ( `?` | ForLifetimes )? TypePath `)` LifetimeBounds -> ( Lifetime `+` )* Lifetime?...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~5 min read
Subtyping and variance Subtyping is implicit and can occur at any stage in type checking or inference. Subtyping is restricted to two cases: variance with respect to lifetimes and between types with higher ranked lifetimes. If we were to er...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~3 min read
"Rust has no theoretical inconsistencies... a remarkable achievement..."

Search tips

Type anything to search across articles, videos (including conference talks), podcasts, and research. These operators give you finer control — click an example to try it.

Find pages containing all your words. Pages where the words appear together rank higher.
Quote part of your query to keep those words together as an exact phrase within a larger search.
Wrap the whole query in quotes for a verbatim search that matches text exactly, punctuation and all — perfect for Rust syntax. Needs at least 3 characters.
Limit results to a single site. Works on its own () too. One site: per search.

Use the tabs and filters above the results to narrow by content type, publication year, and sort order.