From e09d78260908436e6bc1691f23cda2ee8382545a Mon Sep 17 00:00:00 2001 From: Chris Midgley Date: Wed, 21 Jul 2021 10:29:20 +0100 Subject: add working code example --- compiler/rustc_error_codes/src/error_codes/E0722.md | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'compiler/rustc_error_codes/src') 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 -- cgit 1.4.1-3-g733a5