Scope modes
This topic is not available in the selected language or version. Showing the start of this section.
explc — explicit references
Section titled “explc — explicit references”#![explc] applies to the immediately following function. #scope[explc] { ... } enables explicit references within a block. A caller needs its own annotation.
#![explc]fn append_shared(values: &mut Vec<Int>) { values.push(3);}References still obey the copy, move, and borrow rules.
opt — optimization in marked blocks
Section titled “opt — optimization in marked blocks”Applies to code marked with #scope[opt] { ... }. build, run, and test default to --opt=basic; use --opt=off to disable it. Unmarked code is unaffected. --opt-report and --opt-cache=directory require basic and are unavailable for check.
bb — low-level overview
Section titled “bb — low-level overview”A facility for raw memory and operating-system calls. The user documentation supplied for this release does not define its detailed APIs and guarantees. Use the standard library for ordinary files, I/O, and paths.
Learn more: Copies, moves, and references · Command-line tools · Syntax and common problems
For a complete program and diagnostic walkthrough, read Scope modes in Learn.