add working code example

This commit is contained in:
Chris Midgley 2021-07-21 10:29:20 +01:00
parent 320d049e87
commit e09d782609

View File

@ -19,6 +19,16 @@ The `#[optimize]` attribute should be used as follows:
- `#[optimize(speed)]` -- instructs the optimization pipeline to generate code
that's faster rather than smaller
For example:
```
#![feature(optimize_attribute)]
#[optimize(size)]
pub fn something() {}
fn main() {}
```
See [RFC 2412] for more details.
[RFC 2412]: https://rust-lang.github.io/rfcs/2412-optimize-attr.html