- Series: Rust (mir) compiler bites
- Channel: Regional Tantrums
- Demo repo:
zst-in-mir-demo(this repo —cargo rustc -- -Zunpretty=mir)
This document explains how Rust handles promoted constants, why they exist.
When you write |x| x + factor, Rust creates an anonymous struct, implements a trait on it, and calls a method.
For a video version of this — https://www.youtube.com/watch?v=lfi2pCOaGGk&t=927s
- Simplified, control-flow-oriented representation.
./x build
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.07s
$ cargo +nightly-aarch64-apple-darwin build --manifest-path /Users/nihalpasham/devspace/rust/compiler/rustc_public/rustc_public/Cargo.toml --all-targets
Compiling rustc_public v0.1.0-preview (/Users/nihalpasham/devspace/rust/compiler/rustc_public/rustc_public)
error[E0412]: cannot find type `DynKind` in module `rustc_ty`
--> rustc_public/src/unstable/convert/internal.rs:464:30
|
464 | type T<'tcx> = rustc_ty::DynKind;
| ^^^^^^^NewerOlder






