This is because it was too specific to the optimize attribute. Similar diagnostics occur for other attributes too. The example here will now emit E0539
The optimize attribute was malformed.
Erroneous code example:
#![allow(unused)]
#![feature(optimize_attribute)]
fn main() {
#[optimize(something)] // error: invalid argument
pub fn something() {}
} The #[optimize] attribute should be used as follows:
#[optimize(size)] -- instructs the optimization pipeline to generate code that's smaller rather than faster
#[optimize(speed)] -- instructs the optimization pipeline to generate code that's faster rather than smaller
For example:
#![allow(unused)]
#![feature(optimize_attribute)]
fn main() {
#[optimize(size)]
pub fn something() {}
} See RFC 2412 for more details.
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/error_codes/E0722.html