Skip to content

Commit e09d782

Browse files
committed
add working code example
1 parent 320d049 commit e09d782

File tree

1 file changed

+10
-0
lines changed
  • compiler/rustc_error_codes/src/error_codes

1 file changed

+10
-0
lines changed

compiler/rustc_error_codes/src/error_codes/E0722.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ The `#[optimize]` attribute should be used as follows:
1919
- `#[optimize(speed)]` -- instructs the optimization pipeline to generate code
2020
that's faster rather than smaller
2121

22+
For example:
23+
```
24+
#![feature(optimize_attribute)]
25+
26+
#[optimize(size)]
27+
pub fn something() {}
28+
29+
fn main() {}
30+
```
31+
2232
See [RFC 2412] for more details.
2333

2434
[RFC 2412]: https://rust-lang.github.io/rfcs/2412-optimize-attr.html

0 commit comments

Comments
 (0)