Are attributes/procedural macros allowed on expressions


#1

Is it possible to have macros/attributes on an expression like so:

fn main() {
    #[flimflam]
    let x = y+3;

}

And if not, are there any RFC for such syntax?


#2

This is part of RFC 16, which is not fully stabilized. On stable Rust, it works if you wrap the affected statement(s) in a block.


#3

Thanks, that the info that I was looking for!