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