pub struct OptMeta {Show 13 fields
pub opt: Opt,
pub keyword: &'static str,
pub label: &'static str,
pub group: &'static str,
pub default_on: bool,
pub paths: u8,
pub emits_unsafe: bool,
pub mem_class: MemClass,
pub cost: OptCost,
pub requires: &'static [Opt],
pub conflicts: &'static [Opt],
pub preempts: &'static [Opt],
pub scope: Scope,
}Expand description
One row of the optimization registry — the complete static description of a
single optimization. Adding an optimization means adding one Opt variant
and one row here; nothing else hardcodes the list.
Fields§
§opt: OptThe optimization this row describes.
keyword: &'static strThe ## No <Keyword> decorator word (lowercase, single token).
label: &'static strHuman-readable label for UIs.
group: &'static strWhich group the UI files this under.
default_on: boolWhether this optimization is on in the default (all-on, speed) config.
paths: u8Execution paths it affects (bitmask of path constants).
emits_unsafe: boolWhether enabling it can emit unsafe Rust (disabled by the Safety profile).
mem_class: MemClassIts memory/speed trade-off classification.
cost: OptCostHow expensive the pass is to run — the hotness tier at which the tiered
optimizer starts paying for it (HOTSWAP §3). For every row,
cost(requires) ≤ cost, so a tier that admits this opt admits its deps.
requires: &'static [Opt]Optimizations that must be on for this one to apply; if any is off,
normalize turns this one off too.
conflicts: &'static [Opt]Optimizations mutually exclusive with this one — GLOBAL exclusion (both on
→ normalize disables the later-declared). Distinct from preempts.
preempts: &'static [Opt]Optimizations this one takes PRECEDENCE over, per instance: when both are
enabled, this one is tried/applied first for a given function/loop/array/
map, and the listed ones act as the fallback for the instances it did not
claim. Both stay enabled (unlike conflicts); the listed optimization
fires only where this one declined. Disabling THIS one is what can let a
preempted optimization surface — the edge the menu-tree walks.
scope: ScopeWhere its decorator may appear.