about summary refs log tree commit diff
path: root/compiler/rustc_error_codes/src
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_error_codes/src')
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0722.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0722.md b/compiler/rustc_error_codes/src/error_codes/E0722.md
index 4a687d74288..1513c4ce059 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0722.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0722.md
@@ -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