Files
rust/tests/rustdoc-json/attrs/optimize.rs
Luca Versari 5e2ccb2c7f stabilize optimize attribute (size, speed, and none)
This commit stabilizes the `#[optimize]` attribute, which allows for more fine-grained control
of optimization levels.
2026-09-15 00:29:14 +02:00

12 lines
372 B
Rust

//@ is "$.index[?(@.name=='speed')].attrs" '[{"other": "#[attr = Optimize(Speed)]"}]'
#[optimize(speed)]
pub fn speed() {}
//@ is "$.index[?(@.name=='size')].attrs" '[{"other": "#[attr = Optimize(Size)]"}]'
#[optimize(size)]
pub fn size() {}
//@ is "$.index[?(@.name=='none')].attrs" '[{"other": "#[attr = Optimize(DoNotOptimize)]"}]'
#[optimize(none)]
pub fn none() {}