add working code example
This commit is contained in:
parent
320d049e87
commit
e09d782609
1 changed files with 10 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue