Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Unsafety Unsafe operations are those that can potentially violate the memory-safety guarantees of Rust's static semantics. The following language level features cannot be used in the safe subset of Rust: • Dereferencing a raw pointer. • Rea...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~1 min read
The unsafe keyword The unsafe keyword is used to create or discharge the obligation to prove something safe. Specifically: • It is used to mark code that defines extra safety conditions that must be upheld elsewhere. • This includes unsafe...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~3 min read
Behavior considered undefined Rust code is incorrect if it exhibits any of the behaviors in the following list. This includes code within unsafe blocks and unsafe functions. unsafe only means that avoiding undefined behavior is on the progr...
doc.rust-lang.org The Rust Reference Book 2024-01-01 ~9 min read
"In Rust, soundness is never just a convention."

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.