BorrowCheck
Independent Rust tests built from open sources. Learn and practise the language with questions, code snippets, explanations and a readiness rating.
Rust language core
The core covers the Rust language itself, to the extent The Book, the Rustonomicon and Rust by Example describe it, without third-party crates or application areas. The topics go from syntax and the ownership system through types, traits, collections and error handling to smart pointers, concurrency, async, unsafe and macros; testing, memory layout and tooling close the core. Each topic is split into subtopics. The questions check the basic rules, the mechanism behind them and the edge cases; every question comes with an info page that links to the primary sources.
- Syntax, variables, types — Language basics: bindings, mutability, shadowing, scalar and compound types, integer overflow.
- Ownership, move, Copy/Clone — Ownership as the exclusive responsibility to drop a value; move semantics; how
Copydiffers fromClone. - Borrowing, references, NLL — Immutable vs mutable reference rules, non-lexical lifetimes, reborrowing, splitting borrows.
- Lifetimes, subtyping, variance — Annotations and elision,
'static, subtyping via substitutability, the three kinds of variance, HRTB. - Structs, enums, pattern matching — Structs, data-carrying enums,
matchexhaustiveness, refutability and pattern syntax. - Strings and text —
Stringvs&str, UTF-8 and indexing, chars/bytes/graphemes, formatting, OS and C strings. - Traits, generics, dyn / impl — Defining traits, monomorphization,
dyn Traitvsimpl Trait, object safety, coherence. - Associated types, GATs, const generics — Associated types vs type parameters, generic associated types, const generics.
- Collections and iterators — Choosing a collection, the
Iteratortrait and laziness, adapters and consumers,collect,into_iterforms, capacity. - Closures — Capture modes,
Fn/FnMut/FnOnce, themovekeyword, closures as parameters, function pointers. - Type conversions —
From/Into,TryFrom,ascasts, deref coercion,AsRef/Borrow,transmute. - Error handling —
OptionandResult, the?operator, panic and unwinding, custom error types,Box<dyn Error>. - Modules, Cargo, features, editions — Module tree, visibility, crates and workspaces, features and
cfg, editions and MSRV, SemVer. - Smart pointers, interior mutability —
Box,Rc/Arc,RefCell/Cell,Weakand cycles,Cow, theDereftrait. - Drop, RAII, drop order — The
Droptrait, drop order, drop flags,mem::forgetand leaks,ManuallyDrop, dropck. - Concurrency — Threads,
Send/Sync, channels,Mutex/RwLock, atomics and memory ordering, data races. - Async —
Futureandpoll,Waker,Pin/Unpin,async fndesugaring, cancellation safety, the runtime. - Unsafe, UB, FFI — Raw pointers, the
unsafecontract, the UB catalog,reprand ABI,extern "C", checking with Miri. - Macros —
macro_rules!, hygiene, repetitions, procedural macros,deriveand attributes. - Testing, benchmarks, profiling — Unit, integration and doc tests,
should_panic,criterion, profiling, fuzzing. - Memory and type layout — Stack and heap, sizes and alignment, zero-sized types, niches, allocation cost,
Sizedand DSTs. - Tooling —
rustup,clippyandrustfmt, Miri, Playground and Godbolt,cargocommands,rustdoc.
Packs
- Async runtime internals — Executors, schedulers, reactors, work stealing, how Tokio is built.
- Blockchain: Bitcoin — How the Bitcoin blockchain works and how to build it in Rust.
- Web backend — HTTP servers with axum, middleware, state, handler testing.
- Algorithms — Sorting, searching, graphs, dynamic programming and data structures, implemented in Rust with ownership, borrowing and iterators in mind.
- DeFi: Solana — Solana programs, accounts, Anchor.
- Distributed consensus — Raft: leader election, log replication; Rust implementations.
- Embedded —
no_std, HALs, interrupts, register access. - Idioms and patterns — Idiomatic Rust, design patterns and anti-patterns, API guidelines — from Rust Design Patterns, Effective Rust and the API Guidelines.
- Networking: TCP/IP and sockets — Socket internals, TCP states, kernel buffers, non-blocking I/O with Tokio.
- Observability — Metrics, tracing and logging:
tracing, Prometheus, Grafana. - Performance and profiling — Measurement methodology,
criterion, flamegraph, common optimizations. - Search indexing — Inverted index, tokenization, ranking, search data structures.
- WebAssembly — Compiling to WASM,
wasm-bindgen, JS interop. - Command-line tools — Arguments and
clap, I/O streams, exit codes, signals, human vs machine output, packaging a binary.